
/* GLOBAL */
:root {
    --header-height: 60px;
    --footer-height: 40px;
    --sidebar-width-collapsed: 60px;
    --sidebar-width-expanded: 320px;
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-color: #3b82f6;
    --border-color: #333;
}
        
body, html { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f2f5; }

/* PREVIEW CARD STYLES */
.flux-preview-body { 
    background: #f0f2f5; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden; /* Ensure banner bg doesn't cause scroll */
}

.flux-preview-card { 
    background: white; 
    padding: 0; 
    border-radius: 12px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); 
    max-width: 500px; 
    width: 90%; 
    text-align: center; 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
    backdrop-filter: blur(10px); /* Glassmorphism if background is present */
}

.flux-banner { width: 100%; height: 160px; background: #ddd; object-fit: cover; display: block; }
.flux-card-content { padding: 30px; display: flex; flex-direction: column; gap: 20px; }
.flux-room-header { display: flex; align-items: center; justify-content: flex-start; gap: 15px; margin-bottom: 5px; text-align: left;}
.flux-room-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.flux-room-title { margin: 0; color: #1d2327; font-size: 24px; line-height: 1.2; }
.flux-room-desc { color: #50575e; line-height: 1.6; font-size: 15px; margin-bottom: 5px; text-align: left;}

/* Buttons */
.flux-join-btn { display: flex; justify-content: center; align-items: center; background: #2271b1; color: white; padding: 12px 30px; text-decoration: none; border-radius: 6px; font-weight: 600; font-size: 16px; transition: background 0.2s; border: none; cursor: pointer; width: 100%; box-sizing: border-box; height: 48px; }
.flux-join-btn:hover { background: #135e96; }
.flux-join-btn.disabled { background: #ccc; cursor: not-allowed; pointer-events: none; }
.flux-request-btn { background: #e6a800; }
.flux-request-btn:hover { background: #cc9600; }
.flux-unlock-btn { background: #333; }
.flux-unlock-btn:hover { background: #111; }

.flux-icon-btn-large {
    background: #f0f2f5;
    border: 1px solid #ddd;
    color: #555;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 20px;
}
.flux-icon-btn-large:hover {
    background: #e5e5e5;
    color: #2271b1;
}

.flux-input-password { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 6px; margin-bottom: 15px; box-sizing: border-box; font-size: 16px; background: #f9f9f9; }
.flux-error-msg { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 10px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; text-align: left; margin: 20px; }
.flux-access-badge { display: inline-block; padding: 4px 10px; border-radius: 4px; background: #e2e3e5; color: #383d41; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; align-self: flex-start; }
.flux-access-badge.restricted { background: #fff3cd; color: #856404; }
.host-status { margin-top: 15px; font-size: 13px; color: #666; display: flex; align-items: center; justify-content: center; gap: 6px; }
.host-dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; display: inline-block; }
.host-dot.online { background: #46b450; }
#request-status { margin-top: 15px; font-size: 14px; color: #2271b1; font-weight: bold; display:none; }

/* DEVICE SETTINGS */
.flux-device-settings { text-align: left; width: 100%; }
.flux-form-group { margin-bottom: 15px; position: relative; }
.flux-form-group label { display: block; font-weight: 600; font-size: 13px; color: #555; margin-bottom: 5px; }
.flux-form-select, .flux-form-input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff; box-sizing: border-box; }
.video-preview-container { width: 100%; height: 200px; background: #000; border-radius: 8px; margin-bottom: 15px; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; }
#local-video-preview { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.video-placeholder { color: #888; font-size: 14px; position: absolute; z-index: 0; }
.mic-meter-container { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.mic-meter-bar { height: 100%; width: 0%; background: #46b450; transition: width 0.1s ease-out; }
.device-test-row { display: flex; gap: 10px; align-items: flex-end; }
.device-test-btn { white-space: nowrap; padding: 10px 15px; background: #f0f0f1; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; color: #333; font-size: 13px; height: 42px; box-sizing: border-box;}
.device-test-btn:hover { background: #e5e5e5; }

/* MEETING ROOM LAYOUT */
.flux-meeting-body { background: var(--bg-dark); color: var(--text-primary); overflow: hidden; }
.app-layout { display: flex; flex-direction: column; height: 100vh; }

/* Header */
.app-header { height: var(--header-height); background: var(--bg-header); border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; z-index: 10; color: var(--text-header); transition: background 0.3s; gap: 20px; }
.header-brand { font-weight: bold; font-size: 18px; display: flex; align-items: center; gap: 10px; min-width: 150px; }
.room-logo-icon { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; }
.header-cta-menu { flex: 1; display: flex; justify-content: center; gap: var(--cta-gap); overflow-x: auto; white-space: nowrap; -ms-overflow-style: none; scrollbar-width: none; }
.header-cta-menu::-webkit-scrollbar { display: none; }

.cta-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--cta-bg); color: var(--cta-text); padding: var(--cta-pad-y) var(--cta-pad-x); border-radius: var(--cta-radius); text-decoration: none; font-size: 13px; font-weight: 600; transition: all 0.2s; white-space: nowrap; box-sizing: border-box; border: var(--cta-border-w) solid var(--cta-border-c); }
.cta-btn:hover { background: var(--cta-hover-bg); color: var(--cta-hover-text); transform: translateY(-1px); }
.cta-btn .dashicons { font-size: 18px; width: 18px; height: 18px; line-height: 18px; display: flex; align-items: center; justify-content: center; }

.cta-mode-text .dashicons { display: none; }
.cta-mode-icon .cta-label { display: none; }
.cta-mode-icon .cta-btn { padding: var(--cta-pad-y); border-radius: 50%; aspect-ratio: 1/1; justify-content: center; } 

.header-controls { display: flex; gap: 15px; min-width: 150px; justify-content: flex-end; }

/* Body & Sidebars */
.app-body { flex: 1; display: flex; overflow: hidden; position: relative; }

/* Updated Sidebar for Row Layout */
.sidebar { 
    background: var(--bg-panel); 
    border-right: 1px solid var(--border-color); 
    transition: width 0.3s ease; 
    display: flex; 
    flex-direction: row; /* Horizontal Layout for Nav + Content */
    z-index: 5; 
}

.sidebar-left { width: var(--sidebar-width-collapsed); border-right: 1px solid var(--border-color); }
.sidebar-left.expanded { width: var(--sidebar-width-expanded); }
.sidebar-right { width: var(--sidebar-width-collapsed); border-left: 1px solid var(--border-color); border-right: none; }
.sidebar-right.expanded { width: var(--sidebar-width-expanded); }

/* Sidebar Overrides for A/B Dynamic Styling */
.flux-sidebar-a {
    background: var(--sb-a-bg, #1e1e1e) !important;
}
.flux-sidebar-a .sidebar-nav {
    border-right: 1px solid rgba(255,255,255,0.05);
}
.flux-sidebar-a .sidebar-item {
    color: var(--sb-a-text, #a0a0a0) !important;
}
.flux-sidebar-a .sidebar-item:hover, 
.flux-sidebar-a .sidebar-item.active {
    background: var(--sb-a-hover-bg, rgba(255,255,255,0.05)) !important;
    color: var(--sb-a-hover-text, #e0e0e0) !important;
}

.flux-sidebar-b {
    background: var(--sb-b-bg, #1e1e1e) !important;
}
.flux-sidebar-b .sidebar-nav {
    border-right: 1px solid rgba(255,255,255,0.05);
}
.flux-sidebar-b .sidebar-item {
    color: var(--sb-b-text, #a0a0a0) !important;
}
.flux-sidebar-b .sidebar-item:hover, 
.flux-sidebar-b .sidebar-item.active {
    background: var(--sb-b-hover-bg, rgba(255,255,255,0.05)) !important;
    color: var(--sb-b-hover-text, #e0e0e0) !important;
}

/* Sidebar Navigation Strip */
.sidebar-nav {
    flex: 0 0 var(--sidebar-width-collapsed); /* Fixed width for icon strip */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Toggle moves inside Nav */
.sidebar-toggle { height: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.sidebar-toggle:hover { background: rgba(255,255,255,0.05); }
/* Both sidebars' toggle uses a custom double-arrow PNG (src swapped between
   data-arrow-left/-right in room.js) instead of a dashicons glyph. The
   source art is solid black on transparent, so invert it to match the
   dashicons icons' light-gray-to-white hover treatment on this dark panel. */
.sidebar-toggle-icon { width: 20px; height: 20px; object-fit: contain; filter: invert(1); opacity: 0.65; transition: opacity 0.2s; -webkit-user-drag: none; pointer-events: none; }
.sidebar-toggle:hover .sidebar-toggle-icon { opacity: 1; }

.sidebar-item { height: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-secondary); transition: background 0.2s, color 0.2s; position: relative; }
.sidebar-item:hover, .sidebar-item.active { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sidebar-icon { font-size: 20px; }
.sidebar-label { display: none; } 

/* Sidebar Content Panel */
.sidebar-content-area {
    flex: 1;
    overflow-y: auto;
    display: none; /* Hidden by default if minimized */
    padding: 4px;
    box-sizing: border-box;
    min-width: 0; /* Flexbox trick for overflow text */
    background: rgba(0,0,0,0.1); /* Slight darken for content area */
}

.expanded .sidebar-content-area {
    display: block;
}

.sidebar-content-panel.full-height {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.panel-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.panel-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.sidebar-content-panel.full-height .panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.panel-body p { margin-top: 0; }

/* Main Content */
.app-main { flex: 1; position: relative; display: flex; flex-direction: column; background: var(--bg-dark); overflow: hidden; }
.main-content-inner { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; box-sizing: border-box; }
.app-footer { height: var(--footer-height); background: var(--bg-panel); border-top: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 12px; color: var(--text-secondary); }

/* VIDEO GRID */
#video-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.flux-video-tile {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    flex: 1 1 400px;
    max-width: 800px;
    min-width: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.flux-video-tile.is-sharing {
    border-color: #4ade80;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), 0 0 0 2px rgba(74, 222, 128, 0.5);
}

.flux-video-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flux-video-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(2px);
    z-index: 2;
}

/* Video Controls Overlay */
.flux-video-controls {
    position: absolute;
    bottom: 40px; /* Above name tag */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(0,0,0,0.6);
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.flux-video-tile:hover .flux-video-controls {
    opacity: 1;
}

.flux-vc-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.flux-vc-btn:hover {
    color: var(--accent-color);
}

.flux-vc-btn.off {
    color: #ef4444; /* Red for off */
}

/* Utilities */
.btn-icon { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.1); color: var(--text-header); cursor: pointer; font-size: 18px; padding: 8px; border-radius: 4px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; transition: all 0.2s; }
.btn-icon:hover { background: rgba(255,255,255,0.2); }
.btn-icon.danger { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.5); color: #f87171; }
.btn-icon.danger:hover { background: rgba(239, 68, 68, 0.4); color: white; }
.btn-icon.active { background: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.5); color: #4ade80; }
.btn-icon.active:hover { background: rgba(34, 197, 94, 0.4); color: white; }
.flux-loader { color: var(--text-secondary); margin-bottom: 10px; font-size: 14px; }
#wait-message { color: #ef4444; font-weight: bold; margin-top: 10px; }

/* MODALS */
.flux-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.flux-modal { background: #1e1e1e; border: 1px solid #333; border-radius: 8px; width: 90%; max-width: 450px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); overflow: hidden; animation: modalIn 0.2s ease-out; }
/* Override for Preview Page Modal which has white background context */
.flux-preview-body .flux-modal { background: #fff; border: 1px solid #ddd; color: #333; box-shadow: 0 15px 40px rgba(0,0,0,0.2); }
.flux-preview-body .flux-modal-header { background: #f9f9f9; color: #333; border-bottom: 1px solid #eee; }
.flux-preview-body .flux-modal-body { color: #333; }
.flux-preview-body .flux-modal-footer { background: #f9f9f9; border-top: 1px solid #eee; }

.flux-modal-header { padding: 15px 20px; background: #252525; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; font-weight: bold; color: #fff; }
.flux-modal-body { padding: 20px; color: #ccc; font-size: 14px; line-height: 1.5; }
.flux-modal-footer { padding: 15px 20px; border-top: 1px solid #333; display: flex; justify-content: flex-end; gap: 10px; background: #252525; }

.flux-btn { padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: 600; border: none; }
.flux-btn-secondary { background: #333; color: #ccc; }
.flux-btn-secondary:hover { background: #444; color: #fff; }
.flux-btn-primary { background: #2271b1; color: white; }
.flux-btn-primary:hover { background: #135e96; }
.flux-btn-danger { background: #d63638; color: white; }
.flux-btn-danger:hover { background: #b32d2e; }

.flux-share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.flux-share-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; background: #333; color: white; text-decoration: none; border-radius: 4px; font-size: 13px; }
.flux-share-btn:hover { background: #444; }
.flux-share-input { width: 100%; padding: 10px; background: #111; border: 1px solid #444; color: #fff; border-radius: 4px; margin-bottom: 10px; box-sizing: border-box; }

.settings-row { margin-bottom: 15px; }
.settings-row label { display: block; margin-bottom: 5px; color: #aaa; font-size: 12px; }
.settings-select { width: 100%; padding: 8px; background: #111; border: 1px solid #444; color: #fff; border-radius: 4px; }
.settings-input { width: 100%; padding: 8px; background: #111; border: 1px solid #444; color: #fff; border-radius: 4px; }

/* System Panels: Audience & Chat */
.flux-system-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.flux-sys-header {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}
.flux-sys-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: inherit;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.flux-sys-btn:hover { background: rgba(255,255,255,0.2); }
.flux-sys-btn.danger { color: #f87171; background: rgba(239, 68, 68, 0.1); }
.flux-sys-btn.danger:hover { background: rgba(239, 68, 68, 0.2); }

/* User List */
.flux-user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
    margin-bottom: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}
.flux-user-item:hover { background: rgba(0,0,0,0.2); }
.flux-user-avatar { width: 32px; height: 32px; border-radius: 50%; margin-right: 10px; flex-shrink: 0; }
.flux-user-info { flex: 1; min-width: 0; }
.flux-user-name { font-weight: bold; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.flux-user-status { font-size: 11px; opacity: 0.7; color: var(--text-secondary); display:flex; align-items:center; gap:4px; }
.flux-user-status.online { color: #46b450; }
.flux-user-actions { display: flex; gap: 4px; opacity: 0.6; transition: opacity 0.2s; }
.flux-user-item:hover .flux-user-actions { opacity: 1; }
.flux-role-badge { font-size: 10px; background: var(--accent-color); color: white; padding: 1px 4px; border-radius: 3px; margin-left: 5px; }
.flux-connection-info { font-size: 10px; color: var(--text-secondary); opacity: 0.8; margin-top: 2px; }

/* Chat Tabs */
.flux-chat-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 10px; }
.flux-chat-tab { flex: 1; padding: 10px; text-align: center; cursor: pointer; font-size: 13px; opacity: 0.6; border-bottom: 2px solid transparent; color: var(--text-secondary); position: relative; }
.flux-chat-tab.active { opacity: 1; border-bottom-color: var(--accent-color); font-weight: bold; color: var(--text-primary); }
.flux-chat-tab .tab-badge { position: absolute; top: 5px; right: 10px; width: 8px; height: 8px; background: #eab308; border-radius: 50%; display:none; }
.flux-chat-tab.active .tab-badge { display:none; } 

/* Chat Area */
.flux-chat-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 5px; max-height: 400px; min-height: 200px; }
.flux-chat-input-area { margin-top: 10px; display: flex; gap: 8px; }
.flux-chat-input { flex: 1; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); padding: 10px; border-radius: 4px; color: var(--text-primary); font-size: 13px; font-family: inherit; }
.flux-chat-input:focus { outline: none; border-color: var(--accent-color); }
.flux-chat-input:disabled { opacity: 0.5; cursor: not-allowed; background: rgba(255,255,255,0.05); }
.flux-send-btn { background: var(--accent-color); color: white; border: none; padding: 0 12px; border-radius: 4px; cursor: pointer; }
.flux-send-btn:hover { background: #2563eb; }
.flux-send-btn:disabled { opacity: 0.5; cursor: not-allowed; background: #555; }

/* Chat Messages */
.flux-chat-msg { font-size: 13px; line-height: 1.4; padding: 8px 12px; border-radius: 8px; max-width: 90%; word-break: break-word; position: relative; }
.flux-msg-public { background: rgba(255,255,255,0.08); align-self: flex-start; color: var(--text-primary); border-top-left-radius: 0; padding-right: 25px; }
.flux-msg-self { background: rgba(59, 130, 246, 0.3); align-self: flex-end; color: white; border-top-right-radius: 0; }
.flux-msg-private { background: rgba(234, 179, 8, 0.15); border-left: 3px solid #eab308; align-self: flex-start; }
.flux-msg-header { display: flex; justify-content: space-between; font-size: 10px; opacity: 0.6; margin-bottom: 2px; gap: 10px; }
.flux-msg-sender { font-weight: bold; }

/* Message Menu (3 dots) */
.flux-msg-menu-trigger { position: absolute; top: 5px; right: 8px; cursor: pointer; font-size: 14px; opacity: 0.6; padding: 0 4px; }
.flux-msg-menu-trigger:hover { opacity: 1; color: var(--accent-color); }
.flux-msg-dropdown { display: none; position: absolute; top: 100%; right: 0; background: #252525; border: 1px solid #444; border-radius: 4px; padding: 5px 0; z-index: 100; min-width: 120px; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.flux-msg-menu-trigger:hover .flux-msg-dropdown { display: block; }
.flux-msg-dropdown div { padding: 8px 12px; font-size: 11px; cursor: pointer; color: #ccc; white-space: nowrap; }
.flux-msg-dropdown div:hover { background: #333; color: #fff; }

/* Private Chat List */
.flux-private-list-item {
    display: flex; align-items: center; padding: 10px; cursor: pointer; border-radius: 4px; background: rgba(255,255,255,0.02); margin-bottom: 5px;
}
.flux-private-list-item:hover { background: rgba(255,255,255,0.05); }
.flux-private-list-item.unread { border-left: 3px solid #eab308; background: rgba(234, 179, 8, 0.05); }
.flux-back-btn { margin-bottom: 10px; cursor: pointer; font-size: 12px; color: var(--accent-color); display: flex; align-items: center; gap: 5px; }

/* FIXED TIMER */
#flux-timer-display {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2147483647; /* Maximum z-index */
    color: white;
    background: rgba(0,0,0,0.8);
    padding: 10px 20px;
    border-radius: 30px;
    border: 2px solid #46b450;
    font-family: 'Courier New', Courier, monospace;
    font-size: 20px;
    font-weight: bold;
    display: none; /* Flex when active */
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    transition: border-color 0.3s, background 0.3s;
}

#flux-timer-display.paused {
    border-color: #777;
    background: rgba(0,0,0,0.6);
}

#flux-timer-display.active {
    border-color: #46b450;
    background: rgba(0,0,0,0.8);
    box-shadow: 0 0 15px rgba(70, 180, 80, 0.3);
}

#flux-timer-display.warning {
    border-color: #ef4444;
    color: #ef4444;
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Let modals scroll instead of overflowing short mobile viewports */
.flux-modal { max-height: 90vh; display: flex; flex-direction: column; }
.flux-modal-body { overflow-y: auto; }

/* ======================================================================
   RESPONSIVE / MOBILE
   ====================================================================== */

/* Tablets & below: sidebars become floating overlays instead of pushing
   the video area out of view. room.js only toggles the "expanded" class,
   so this is a pure CSS behavior change. */
@media (max-width: 900px) {
    .sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        width: var(--sidebar-width-collapsed) !important;
        z-index: 20;
    }
    .sidebar-left { left: 0; }
    .sidebar-right { right: 0; }
    .sidebar-left.expanded,
    .sidebar-right.expanded {
        width: min(85vw, 320px) !important;
        box-shadow: 0 0 30px rgba(0,0,0,0.6);
    }

    /* .app-main is the only sidebar left in flex flow now, so reserve
       space for the collapsed icon rails on either side. */
    .app-main { margin: 0 var(--sidebar-width-collapsed); }

    /* Dim the video area while a sidebar drawer is open (progressive
       enhancement - harmless if :has() isn't supported). */
    .app-body:has(.sidebar.expanded) .app-main::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 4;
        pointer-events: none;
    }

    .flux-video-tile { min-width: 220px; }
}

@media (max-width: 768px) {
    .app-header { padding: 0 10px; gap: 8px; }
    .header-brand { min-width: 0; gap: 6px; font-size: 15px; }
    .header-controls { min-width: 0; gap: 8px; }
    .btn-icon { width: 32px; height: 32px; font-size: 16px; }

    .main-content-inner { padding: 10px; }

    #zoom-meeting-container, #zoomIframe,
    #daily-meeting-container, #dailyIframe {
        height: calc(100vh - var(--header-height) - var(--footer-height)) !important;
    }

    .flux-preview-card { width: 94%; }
    .flux-card-content { padding: 20px; gap: 15px; }
    .flux-room-title { font-size: 20px; }
    .flux-banner { height: 120px; }

    .flux-share-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .header-brand span { display: none; }
    .header-brand { min-width: auto; }
    .header-cta-menu { justify-content: flex-start; }
    #flux-timer-display { bottom: 10px; right: 10px; font-size: 16px; padding: 8px 15px; }

    .app-footer { padding: 0 10px; font-size: 10px; }
    .app-footer span:first-child { display: none; }

    .sidebar-left.expanded,
    .sidebar-right.expanded { width: 92vw !important; }

    .flux-video-tile { min-width: 0; width: 100%; }
    .video-preview-container { height: 160px; }

    .flux-room-header { flex-wrap: wrap; }
}

@media (max-width: 400px) {
    .header-controls { gap: 4px; }
    .btn-icon { width: 30px; height: 30px; font-size: 14px; }
    .cta-btn { padding: 6px 10px; font-size: 12px; }
}
