/* ================================
   МИНИМАЛИСТИЧНАЯ ВЕБИНАР ПЛАТФОРМА
   Светлая тема, Roboto
   ================================ */

:root {
    /* Primary */
    --primary: #3c8aff;
    --primary-dark: #176ef0;
    --primary-darkest: #0259b2;
    --primary-light: #caeaff;

    /* Backgrounds */
    --bg-page: #f5f5f5;
    --bg-card: #fff;
    --bg-dark: #aeaeae;

    /* Text */
    --text-primary: #595959;
    --text-secondary: #555;
    --text-muted: #999;

    /* Borders */
    --border-color: #e0e0e0;

    /* Status */
    --success: #28b536;
    --success-light: #cef3d1;
    --error: #b9005b;
    --warn: #f86434;
    --warn-light: #ffe192;
    --info: #0481fd;

    /* Accents */
    --purple: #7a4495;
    --pink: #ffe6e6;
    --dark-pink: #b63f9c;
    --yellow: #fff6a9;
    --orange-dark: #bf4219;

    --header-height: 52px;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Roboto', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ===============================
   HEADER
   =============================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    gap: 0.75rem;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.3rem;
}

.webinar-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 0;
}

.room-name {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-badge {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
}

.role-badge.viewer {
    background: var(--text-secondary);
}

/* Live Indicator */
.header-center {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background: var(--pink);
    border: 1px solid rgba(185, 0, 91, 0.2);
    border-radius: 6px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-text {
    color: var(--error);
    font-weight: 700;
    font-size: 0.8rem;
}

.duration {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.viewers-count {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-page);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.viewers-icon {
    font-size: 0.9rem;
}

.viewers-number {
    font-weight: 600;
    font-size: 0.85rem;
}

.leave-btn {
    padding: 0.35rem 0.85rem;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.leave-btn:hover {
    opacity: 0.9;
}

/* ===============================
   MAIN CONTENT
   =============================== */
.main-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
}

/* Video Area */
.video-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: 0;
}

.main-video {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
}

#mainVideoElement {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.main-video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.placeholder-icon {
    font-size: 3.5rem;
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

.placeholder-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Unmute Button */
.unmute-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.85rem 1.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
}

.unmute-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.unmute-btn:active {
    transform: translate(-50%, -50%) scale(0.98);
}

.main-video-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #fff;
}

/* Video Controls */
.video-controls-overlay {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.video-control-btn img {
    width: 20px;
    height: 20px;
}

.video-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-control-btn.active {
    background: var(--success);
    border-color: var(--success);
}

.video-control-btn.active.screen {
    background: #6366f1;
    border-color: #6366f1;
}

/* Audio Level Indicator */
#audioLevel {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audio-level-bar {
    width: 100px;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.audio-level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #f59e0b, var(--error));
    width: 0%;
    transition: width 0.1s;
}

/* PiP Video */
.pip-video {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 160px;
    height: 90px;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

#pipVideoElement {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pip-label {
    position: absolute;
    bottom: 0.4rem;
    left: 0.4rem;
    padding: 0.15rem 0.4rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 3px;
    font-size: 0.7rem;
    color: #fff;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fullscreen-btn:hover {
    background: var(--primary);
}

/* ===============================
   PARTICIPANTS PANEL
   =============================== */
.participants-panel {
    flex-shrink: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 0.4rem;
}

/* Room Link */
.room-link-section {
    padding: 0.4rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
}

.room-link-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.room-link-row {
    display: flex;
    gap: 0.25rem;
}

.room-link-url {
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-page);
    color: var(--text-primary);
    cursor: text;
}

.room-link-url:focus {
    outline: none;
    border-color: var(--primary);
}

.room-link-copy {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-page);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.2s;
}

.room-link-copy:hover {
    background: var(--primary-light);
}

.room-link-copy.copied {
    background: var(--success-light);
    border-color: var(--success);
}

.participants-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.participant-card {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.participant-card:hover {
    background: #ececec;
}

.participant-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.participant-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.participant-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.participant-role.host {
    color: var(--primary-dark);
    font-weight: 600;
}

/* Chat */
.chat-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-messages {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    min-height: 140px;
    max-height: 260px;
    overflow-y: auto;
}

.chat-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-input {
    display: flex;
    gap: 0.4rem;
}

.chat-input input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-input input:disabled {
    opacity: 0.6;
    background: var(--bg-page);
}

.chat-input button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Media Indicators */
.media-indicators {
    display: flex;
    gap: 0.35rem;
}

.media-indicator {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.media-indicator img {
    width: 16px;
    height: 16px;
}

.media-indicator.active {
    background: var(--success-light);
    border-color: var(--success);
}

.media-indicator.inactive {
    opacity: 0.5;
}

.media-indicator.hand-raised {
    background: var(--warn-light);
    border-color: #f59e0b;
    animation: handPulse 1.5s ease-in-out infinite;
    font-size: 13px;
    opacity: 1;
}

.media-indicator.speaking {
    background: var(--success-light);
    border-color: var(--success);
    box-shadow: 0 0 6px rgba(40, 181, 54, 0.3);
}

.media-indicator.clickable {
    cursor: pointer;
}

.media-indicator.clickable:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

@keyframes handPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 10px 2px rgba(245, 158, 11, 0.3); }
}

/* Raise Hand Button (viewer) */
.hand-btn {
    font-size: 1.1rem;
}

.hand-btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.hand-btn.hand-raised-active {
    background: rgba(245, 158, 11, 0.3);
    border-color: #f59e0b;
    animation: handPulse 1.5s ease-in-out infinite;
}

.hand-btn.speaking-active {
    background: var(--success);
    border-color: var(--success);
}

/* Viewer Info */
.viewer-info {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
}

.status-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.status-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

/* ===============================
   MODAL / LOGIN
   =============================== */
html,
body {
    height: 100%;
}

.login-page {
    margin: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-page) 60%, #fff 100%);
}

.login-page .modal {
    position: static;
    width: 100%;
    height: 100%;
    background: transparent;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page .modal-content {
    width: min(680px, 94vw);
    max-height: 92vh;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
}

.login-page .modal-header {
    background: linear-gradient(135deg, var(--primary-darkest), var(--primary));
}

.login-page .modal-body {
    padding: 1rem 1.25rem 1.25rem;
}

.login-page .form-group {
    margin-bottom: 0.85rem;
}

.login-page .role-option {
    padding: 0.75rem;
}

.login-page .role-icon {
    font-size: 1.6rem;
}

.login-page .join-btn {
    padding: 0.65rem;
    font-size: 0.9rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 480px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-dark);
    border-radius: 10px 10px 0 0;
}

.modal-header h2 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 0.35rem;
}

.modal-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.modal-body {
    padding: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(60, 138, 255, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Role Selector */
.role-selector {
    display: flex;
    gap: 0.5rem;
}

.role-selector input[type="radio"] {
    display: none;
}

.role-option {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.role-option:hover {
    background: #ececec;
}

.role-selector input[type="radio"]:checked + .role-option {
    background: var(--primary-light);
    border-color: var(--primary);
}

.role-icon {
    font-size: 1.8rem;
    margin-bottom: 0.35rem;
    display: block;
}

.role-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.role-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.role-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.role-warning {
    color: var(--error);
    font-size: 0.7rem;
    margin-top: 0.2rem;
}

/* Choice Cards (Step 1) */
.choice-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.25rem;
    background: var(--bg-page);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.choice-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 138, 255, 0.15);
}

.choice-icon { font-size: 2.2rem; }
.choice-title { font-weight: 700; font-size: 1.05rem; color: var(--text-primary); }
.choice-desc { font-size: 0.85rem; color: var(--text-secondary); }

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.75rem;
}

.back-btn:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

.join-btn {
    width: 100%;
    padding: 0.7rem;
    background: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.join-btn:hover {
    opacity: 0.9;
}

/* ===============================
   UTILITIES
   =============================== */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Video Notifications (inside main-video) */
.video-notification {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    animation: videoNotifIn 0.3s ease forwards;
    border-left: 3px solid var(--primary);
}

.video-notification.success {
    border-left-color: var(--success);
}

.video-notification.error {
    border-left-color: var(--error);
}

.video-notification.fade-out {
    animation: videoNotifOut 0.3s ease forwards;
}

@keyframes videoNotifIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes videoNotifOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Legacy notification (fallback) */
.notification,
.notification-container {
    position: fixed;
    top: calc(var(--header-height) + 0.75rem);
    right: -400px;
    max-width: 340px;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    transition: right 0.3s ease;
    z-index: 3000;
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.notification.show {
    right: 0.75rem;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--error);
}

/* Custom Alert Modal */
.custom-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: alertFadeIn 0.25s ease forwards;
}

.custom-alert {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 380px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    animation: alertScaleIn 0.25s ease forwards;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.custom-alert-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.custom-alert-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.custom-alert-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.custom-alert-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-alert-btn:hover {
    background: var(--primary-dark);
}

@keyframes alertFadeIn {
    to { opacity: 1; }
}

@keyframes alertScaleIn {
    to { transform: scale(1); }
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */

/* Desktop: Video сбоку, participants справа */
@media (min-width: 769px) {
    .main-content {
        flex-direction: row;
    }

    .video-area {
        flex: 1;
    }

    .participants-panel {
        width: 300px;
        flex: 0 0 300px;
        border-top: none;
        border-left: 1px solid var(--border-color);
        overflow-y: auto;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .header {
        padding: 0 0.5rem;
    }

    .pip-video {
        width: 140px;
        height: 80px;
    }
}

/* Mobile: Video сверху, participants снизу */
@media (max-width: 768px) {
    :root {
        --header-height: 48px;
    }

    .header {
        padding: 0 0.5rem;
        gap: 0.4rem;
    }

    .logo-text {
        display: none;
    }

    .header-center {
        display: none !important;
    }

    .webinar-info .separator {
        display: none;
    }

    .main-content {
        flex-direction: column;
    }

    .video-area {
        height: 60vh;
        padding: 0.35rem;
    }

    .participants-panel {
        flex: 1;
        max-height: 40vh;
        overflow-y: auto;
    }

    .video-controls-overlay {
        gap: 0.4rem;
        padding: 0.4rem;
    }

    .video-control-btn {
        width: 40px;
        height: 40px;
    }

    .pip-video {
        width: 110px;
        height: 62px;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .role-selector {
        flex-direction: column;
    }

    .login-page .modal {
        padding: 0;
    }

    .login-page .modal-content {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .login-page .modal-header {
        padding: 1rem 0.75rem;
    }

    .login-page .modal-body {
        padding: 0.75rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header {
        padding: 0 0.4rem;
    }

    .room-name {
        max-width: 100px;
    }

    .leave-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .viewers-count {
        display: none;
    }

    .video-control-btn {
        width: 38px;
        height: 38px;
    }

    .video-control-btn img {
        width: 18px;
        height: 18px;
    }

    .pip-video {
        display: none;
    }

    .modal-header {
        padding: 0.85rem;
    }

    .modal-header h2 {
        font-size: 1.15rem;
    }

    .modal-body {
        padding: 0.85rem;
    }
}

@media (max-height: 740px) {
    .login-page .modal {
        padding: 0.75rem;
    }

    .login-page .modal-header {
        padding: 0.85rem;
    }

    .login-page .modal-header p {
        display: none;
    }

    .login-page .modal-body {
        padding: 0.75rem;
    }

    .login-page .form-group {
        margin-bottom: 0.6rem;
    }

    .login-page .role-desc {
        display: none;
    }
}

@media (max-height: 640px) {
    .login-page .role-option {
        padding: 0.5rem;
    }

    .login-page .role-icon {
        font-size: 1.3rem;
    }
}

/* ===============================
   CONNECTION INDICATOR
   =============================== */
.connection-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.conn-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.conn-text {
    white-space: nowrap;
}

.connection-indicator.good {
    background: var(--success-light);
    border-color: var(--success);
}

.connection-indicator.good .conn-icon {
    background: var(--success);
}

.connection-indicator.good .conn-text {
    color: var(--success);
}

.connection-indicator.warning {
    background: var(--warn-light);
    border-color: #f59e0b;
    animation: connPulse 2s ease-in-out infinite;
}

.connection-indicator.warning .conn-icon {
    background: #f59e0b;
}

.connection-indicator.warning .conn-text {
    color: #b45309;
}

.connection-indicator.critical {
    background: var(--pink);
    border-color: var(--error);
    animation: connPulse 1s ease-in-out infinite;
}

.connection-indicator.critical .conn-icon {
    background: var(--error);
}

.connection-indicator.critical .conn-text {
    color: var(--error);
}

.connection-indicator.reconnecting {
    background: var(--primary-light);
    border-color: var(--primary);
    animation: connPulse 1.5s ease-in-out infinite;
}

.connection-indicator.reconnecting .conn-icon {
    background: var(--primary);
}

.connection-indicator.reconnecting .conn-text {
    color: var(--primary-dark);
}

@keyframes connPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===============================
   RESERVATION BANNER
   =============================== */
.reservation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warn-light);
    border-bottom: 2px solid var(--warn);
    padding: 0.5rem 1rem;
    z-index: 6000;
}

.reservation-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.reservation-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.reservation-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.reservation-btn {
    padding: 0.35rem 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.reservation-btn:hover {
    opacity: 0.9;
}

.reservation-btn.return {
    background: var(--primary);
    color: #fff;
}

.reservation-btn.close {
    background: var(--error);
    color: #fff;
}

/* Close Room Button (header) */
.close-room-btn {
    background: var(--error);
    color: #fff;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.close-room-btn:hover {
    opacity: 0.9;
}

/* Host suspended overlay */
.host-suspended-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    color: #fff;
}

.host-suspended-overlay .suspended-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.host-suspended-overlay .suspended-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.host-suspended-overlay .suspended-timer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .reservation-banner-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Print */
@media print {
    .header,
    .participants-panel,
    .video-controls-overlay,
    .modal,
    .notification {
        display: none !important;
    }
}
