/* ==========================================================================
   ChurchConnect Global Design System & Stylesheet
   Theme: Divine Dark (Slate Blue, Charcoal Gray, and Graceful Gold Accents)
   ========================================================================== */

/* Custom Variables */
:root {
    --bg-main: #0f0f11;
    --bg-header: rgba(20, 20, 23, 0.75);
    --bg-card: rgba(30, 30, 36, 0.6);
    --bg-card-hover: rgba(45, 45, 54, 0.7);
    --bg-sidebar: rgba(18, 18, 22, 0.85);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(253, 160, 133, 0.5);
    
    --accent-gold: #fda085;
    --accent-gold-hover: #f6d365;
    --accent-gold-glow: rgba(253, 160, 133, 0.25);
    
    --accent-teal: #fbc2eb;
    --accent-teal-glow: rgba(251, 194, 235, 0.2);
    
    --color-text-primary: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;
    
    --danger: #ef4444;
    --danger-hover: #f87171;
    --success: #22c55e;
    
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-focus: rgba(255, 255, 255, 0.08);
    --bg-interactive: rgba(30, 30, 36, 0.5);
    
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
    
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-pill: 50px;
    --radius-circle: 50%;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.55), inset 0 1.5px 0.5px rgba(255, 255, 255, 0.15);
    --shadow-gold: 0 6px 20px rgba(253, 160, 133, 0.2);
    
    --gradient-sunset: linear-gradient(135deg, #fda085 0%, #fbc2eb 100%);
    --gradient-sunset-hover: linear-gradient(135deg, #fbc2eb 0%, #fda085 100%);

    /* Component-specific Theme variables */
    --bg-workspace-bar: rgba(20, 20, 24, 0.9);
    --bg-workspace-viewport: #121215;
    --bg-whiteboard-canvas: #0a0a0c;
    --bg-whiteboard-tools: rgba(20, 20, 24, 0.9);
    --bg-notes-toolbar: rgba(20, 20, 24, 0.8);
    
    --bg-chat-bubble: rgba(255, 255, 255, 0.04);
    --bg-chat-bubble-outgoing: rgba(253, 160, 133, 0.12);
    --bg-scripture-card: rgba(20, 20, 24, 0.7);
    --bg-chat-input-wrapper: rgba(18, 18, 22, 0.95);
    
    --bg-room-controls-bar: rgba(18, 18, 22, 0.9);
    --bg-modal-card: #18181c;
    --bg-toast: rgba(18, 18, 22, 0.95);
    
    --btn-secondary-bg: rgba(255, 255, 255, 0.05);
    --btn-secondary-hover-bg: rgba(255, 255, 255, 0.1);
    --btn-secondary-hover-text: #ffffff;
    
    --btn-circle-bg: rgba(255, 255, 255, 0.05);
    --btn-circle-hover-bg: rgba(255, 255, 255, 0.12);
    --btn-circle-hover-text: #ffffff;
    --btn-circle-active-bg: rgba(255, 255, 255, 0.08);
    
    --bg-verse-hover: rgba(255, 255, 255, 0.02);
    --stage-switcher-bg: rgba(0, 0, 0, 0.15);
}

/* Light Theme Variables Overrides */
.light-theme {
    --bg-main: #f4f4f5;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(244, 244, 245, 0.95);
    --bg-sidebar: rgba(244, 244, 245, 0.9);
    
    --border-color: rgba(0, 0, 0, 0.06);
    --border-focus: rgba(253, 160, 133, 0.7);
    
    --accent-gold: #e17c61;
    --accent-gold-hover: #c9674d;
    --accent-gold-glow: rgba(225, 124, 97, 0.15);
    
    --accent-teal: #b868a6;
    --accent-teal-glow: rgba(184, 104, 166, 0.15);
    
    --color-text-primary: #18181b;
    --color-text-secondary: #52525b;
    --color-text-muted: #a1a1aa;
    
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08), inset 0 1.5px 0.5px rgba(255, 255, 255, 0.85);
    --shadow-gold: 0 6px 20px rgba(253, 160, 133, 0.12);
    
    --bg-input: rgba(0, 0, 0, 0.03);
    --bg-input-focus: rgba(0, 0, 0, 0.05);
    --bg-interactive: rgba(0, 0, 0, 0.02);

    /* Component-specific overrides for Light Theme */
    --bg-workspace-bar: rgba(244, 244, 245, 0.9);
    --bg-workspace-viewport: #e4e4e7;
    --bg-whiteboard-canvas: #ffffff;
    --bg-whiteboard-tools: rgba(255, 255, 255, 0.9);
    --bg-notes-toolbar: rgba(228, 228, 231, 0.8);
    
    --bg-chat-bubble: rgba(0, 0, 0, 0.03);
    --bg-chat-bubble-outgoing: rgba(253, 160, 133, 0.16);
    --bg-scripture-card: rgba(255, 255, 255, 0.95);
    --bg-chat-input-wrapper: rgba(244, 244, 245, 0.95);
    
    --bg-room-controls-bar: rgba(244, 244, 245, 0.9);
    --bg-modal-card: #ffffff;
    --bg-toast: rgba(255, 255, 255, 0.95);
    
    --btn-secondary-bg: rgba(0, 0, 0, 0.03);
    --btn-secondary-hover-bg: rgba(0, 0, 0, 0.06);
    --btn-secondary-hover-text: var(--color-text-primary);
    
    --btn-circle-bg: rgba(0, 0, 0, 0.03);
    --btn-circle-hover-bg: rgba(0, 0, 0, 0.06);
    --btn-circle-hover-text: var(--color-text-primary);
    --btn-circle-active-bg: rgba(0, 0, 0, 0.05);
    
    --bg-verse-hover: rgba(0, 0, 0, 0.02);
    --stage-switcher-bg: rgba(0, 0, 0, 0.04);
}

/* Light Theme Overrides for active/disabled circular buttons in controls bar to ensure high contrast */
.light-theme .btn-circle.btn-active {
    background: var(--btn-circle-active-bg);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--color-text-primary);
    box-shadow: 
        0 1.5px 0 rgba(0, 0, 0, 0.08), 
        0 3px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.85);
}
.light-theme .btn-circle.btn-active:hover {
    background: var(--btn-circle-hover-bg);
    color: var(--btn-circle-hover-text);
    box-shadow: 
        0 2.5px 0 rgba(0, 0, 0, 0.08), 
        0 5px 12px rgba(0, 0, 0, 0.06),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.85);
}
.light-theme .btn-circle.btn-active:active {
    background: rgba(0, 0, 0, 0.06);
    box-shadow: 
        0 0px 0 rgba(0, 0, 0, 0.08),
        inset 0 1.5px 3px rgba(0, 0, 0, 0.06);
}
.light-theme .btn-circle.btn-disabled {
    color: var(--color-text-primary) !important;
}
.light-theme .status-badge {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--color-text-secondary);
}

/* Global Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
}

body {
    background-color: var(--bg-main);
    color: var(--color-text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Global Utility Classes */
.hidden {
    display: none !important;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* App Layout Structure */
#app-root {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Header Styles */
#app-header {
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid rgba(0, 0, 0, 0.4);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.35), 
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.light-theme #app-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.04), 
        inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--accent-gold);
    text-shadow: 0 0 12px var(--accent-gold-glow);
    animation: glow-pulse 3s infinite ease-in-out;
}

.logo-text h1 {
    font-size: 1.25rem;
    color: var(--color-text-primary);
    font-weight: 700;
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.7rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Techy Segmented Theme Selector Toggle Group */
.theme-toggle-group {
    display: inline-flex;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-pill);
    padding: 4px;
    position: relative;
    gap: 4px;
    user-select: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.light-theme .theme-toggle-group {
    background-color: rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.05);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    z-index: 2;
}

.theme-toggle-btn i {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.theme-toggle-btn span {
    display: inline-block;
}

.theme-toggle-btn:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.light-theme .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.02);
}

.theme-toggle-btn.active {
    color: #18181b;
    background: var(--gradient-sunset);
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 
        0 3px 5px rgba(0, 0, 0, 0.25), 
        inset 0 1px 0.5px rgba(255, 255, 255, 0.4),
        inset 0 -1px 0.5px rgba(0, 0, 0, 0.15);
    transform: translateY(-0.5px);
}

.theme-toggle-btn.active i {
    transform: rotate(15deg);
}

/* Light theme overrides for active status badge text readability */
.light-theme .theme-toggle-btn.active {
    color: #ffffff;
    background: var(--gradient-sunset);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.12), 
        inset 0 1px 0.5px rgba(255, 255, 255, 0.35),
        inset 0 -1px 0.5px rgba(0, 0, 0, 0.1);
}

/* Settings Dropdown & Button (Tiny size) */
.settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.settings-btn:hover {
    color: var(--color-text-primary);
    border-color: var(--accent-gold);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(253, 160, 133, 0.15);
    transform: rotate(30deg);
}

.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(20, 20, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    z-index: 1000;
    box-shadow: var(--shadow-dark);
    min-width: 250px;
    animation: fadeIn var(--transition-fast) ease-out;
}

.settings-dropdown.hidden {
    display: none !important;
}

.light-theme .settings-dropdown {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-light);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-gold);
}

/* Ensure dropdown buttons keep their text and size on all viewports */
.settings-dropdown .theme-toggle-btn span {
    display: inline-block !important;
}

.settings-dropdown .theme-toggle-btn {
    padding: 6px 14px !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Status Badge */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    transition: var(--transition-normal);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.connected .status-dot {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.status-badge.disconnected .status-dot {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}
.status-badge.connecting .status-dot {
    background-color: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold);
    animation: blink 1.5s infinite;
}

/* Main Container */
#main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* View Panels */
.view-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.98);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    z-index: 5;
}

.view-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 10;
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn *, .btn-circle * {
    pointer-events: none;
}

.btn-primary {
    background: var(--gradient-sunset);
    color: #18181b;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 
        0 2px 0 #b37361, 
        0 4px 10px rgba(253, 160, 133, 0.2),
        inset 0 1.2px 0.3px rgba(255, 255, 255, 0.4);
    text-shadow: 0 0.5px 0.5px rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}
.btn-primary:hover {
    background: var(--gradient-sunset-hover);
    transform: translateY(-1px);
    box-shadow: 
        0 3px 0 #b37361, 
        0 7px 14px rgba(253, 160, 133, 0.25),
        inset 0 1.2px 0.3px rgba(255, 255, 255, 0.45);
}
.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 #b37361,
        inset 0 1.5px 3px rgba(0, 0, 0, 0.25),
        0 1px 3px rgba(253, 160, 133, 0.1);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    border: 1px solid rgba(0, 0, 0, 0.25);
    color: var(--color-text-primary);
    box-shadow: 
        0 1.5px 0 rgba(0, 0, 0, 0.35), 
        0 3px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.06);
    transition: all var(--transition-fast);
}
.btn-secondary:hover {
    background: var(--btn-secondary-hover-bg);
    color: var(--btn-secondary-hover-text);
    transform: translateY(-1px);
    box-shadow: 
        0 2.5px 0 rgba(0, 0, 0, 0.35), 
        0 5px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.1);
}
.btn-secondary:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 rgba(0, 0, 0, 0.35),
        inset 0 1.5px 3px rgba(0, 0, 0, 0.35);
}
.btn-secondary.btn-active {
    background: var(--gradient-sunset);
    color: #18181b;
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 1.5px 0 #b37361,
        0 3px 8px rgba(253, 160, 133, 0.18),
        inset 0 1.2px 0.3px rgba(255, 255, 255, 0.35);
}
.btn-secondary.btn-active:hover {
    background: var(--gradient-sunset-hover);
    transform: translateY(-1px);
    box-shadow: 
        0 2.5px 0 #b37361,
        0 5px 12px rgba(253, 160, 133, 0.22),
        inset 0 1.2px 0.3px rgba(255, 255, 255, 0.4);
}
.btn-secondary.btn-active:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 #b37361,
        inset 0 1.5px 3px rgba(0, 0, 0, 0.25);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 1.5px 0 #991b1b, 
        0 3px 8px rgba(220, 38, 38, 0.2),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.15);
    transition: all var(--transition-fast);
}
.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: 
        0 2.5px 0 #991b1b, 
        0 5px 12px rgba(220, 38, 38, 0.28),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.25);
}
.btn-danger:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 #991b1b,
        inset 0 1.5px 3px rgba(0, 0, 0, 0.3);
}

.btn-circle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-circle);
    padding: 0;
    background: var(--btn-circle-bg);
    border: 1px solid rgba(0, 0, 0, 0.25);
    color: var(--color-text-primary);
    box-shadow: 
        0 1.5px 0 rgba(0, 0, 0, 0.35), 
        0 3px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.06);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-circle:hover {
    background: var(--btn-circle-hover-bg);
    color: var(--btn-circle-hover-text);
    transform: translateY(-1px);
    box-shadow: 
        0 2.5px 0 rgba(0, 0, 0, 0.35), 
        0 5px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.1);
}
.btn-circle:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 rgba(0, 0, 0, 0.35),
        inset 0 1.5px 3px rgba(0, 0, 0, 0.35);
}
.btn-circle.btn-active {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.3);
    color: #ffffff;
    box-shadow: 
        0 1.5px 0 rgba(0, 0, 0, 0.35), 
        0 3px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.1);
}
.btn-circle.btn-active:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 
        0 2.5px 0 rgba(0, 0, 0, 0.35), 
        0 5px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.15);
}
.btn-circle.btn-active:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 rgba(0, 0, 0, 0.35),
        inset 0 1.5px 3px rgba(0, 0, 0, 0.35);
}
.btn-circle.btn-disabled {
    background: var(--gradient-sunset);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
    box-shadow: 
        0 1.5px 0 #b37361,
        0 3px 8px rgba(253, 160, 133, 0.2),
        inset 0 1.2px 0.3px rgba(255, 255, 255, 0.35);
}
.btn-circle.btn-disabled:hover {
    background: var(--gradient-sunset-hover);
    transform: translateY(-1px);
    box-shadow: 
        0 2.5px 0 #b37361,
        0 5px 12px rgba(253, 160, 133, 0.22),
        inset 0 1.2px 0.3px rgba(255, 255, 255, 0.4);
}
.btn-circle.btn-disabled:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 #b37361,
        inset 0 1.5px 3px rgba(0, 0, 0, 0.25);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
}

/* Card UI Component */
.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 8px 26px rgba(0, 0, 0, 0.45), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.12),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.light-theme .card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 6px 18px rgba(0, 0, 0, 0.06), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.8),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.03);
}

.card:hover {
    border-color: rgba(253, 160, 133, 0.15);
    background-color: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.52), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.2),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.15),
        0 0 10px rgba(253, 160, 133, 0.08);
}

.light-theme .card:hover {
    border-color: rgba(253, 160, 133, 0.3);
    box-shadow: 
        0 10px 22px rgba(0, 0, 0, 0.09), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.9),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.03);
}

.card-header {
    padding: 24px;
    border-bottom: 1.2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.03);
}

.light-theme .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.3);
}
.card-header h2 {
    font-size: 1.5rem;
    color: var(--color-text-primary);
}
.card-body {
    padding: 24px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}
input[type="text"], select, textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    box-shadow: 
        inset 0 1.5px 3px rgba(0, 0, 0, 0.3), 
        0 1px 0 rgba(255, 255, 255, 0.03);
}

.light-theme input[type="text"], .light-theme select, .light-theme textarea {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05), 
        0 1px 0 rgba(255, 255, 255, 0.8);
}

select option {
    background-color: var(--bg-modal-card);
    color: var(--color-text-primary);
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.3), 
        0 0 10px rgba(253, 160, 133, 0.2);
    background-color: var(--bg-input-focus);
}

.light-theme input[type="text"]:focus, .light-theme select:focus, .light-theme textarea:focus {
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05), 
        0 0 6px rgba(253, 160, 133, 0.3);
}

.input-with-button {
    display: flex;
    gap: 8px;
}
.input-with-button input {
    flex: 1;
}

/* ==========================================================================
   Lobby View Styles
   ========================================================================== */
#lobby-view {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lobby-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    max-width: 1100px;
    width: 100%;
}

.lobby-setup-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.lobby-preview-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.video-preview-wrapper {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: var(--radius-md);
    background-color: #05070c;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.video-preview-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-preview-wrapper video.mirrored {
    transform: scaleX(-1);
}

.video-overlay-status {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: rgba(5, 7, 12, 0.95);
    color: var(--color-text-secondary);
    transition: opacity var(--transition-normal);
}

.video-overlay-status i {
    width: 32px;
    height: 32px;
}

.media-device-controls {
    display: flex;
    gap: 16px;
}

.lobby-diagnostics {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.75rem;
    align-self: stretch;
}

.diagnostic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-secondary);
}

.diagnostic-item .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-text-muted);
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.diagnostic-item.success {
    color: var(--color-text-primary);
}

.diagnostic-item.success .indicator {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.diagnostic-item.error {
    color: var(--danger-hover);
}

.diagnostic-item.error .indicator {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.diagnostic-item.warning {
    color: var(--accent-gold);
}

.diagnostic-item.warning .indicator {
    background-color: var(--accent-gold);
    box-shadow: 0 0 8px var(--accent-gold);
}

/* ==========================================================================
   Fellowship Room View Layout
   ========================================================================== */
#room-view {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.room-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 340px;
    height: calc(100vh - 128px); /* Less header & footer controls */
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Sidebar General Styles */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1.5px solid rgba(0, 0, 0, 0.4);
    box-shadow: 
        4px 0 24px rgba(0, 0, 0, 0.25),
        inset -1px 0 0 rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.light-theme .sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        3px 0 12px rgba(0, 0, 0, 0.02),
        inset -1px 0 0 rgba(255, 255, 255, 0.4);
}

#chat-sidebar {
    border-right: none;
    border-left: 1.5px solid rgba(0, 0, 0, 0.4);
    box-shadow: 
        -4px 0 24px rgba(0, 0, 0, 0.25),
        inset 1px 0 0 rgba(255, 255, 255, 0.03);
}

.light-theme #chat-sidebar {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        -3px 0 12px rgba(0, 0, 0, 0.02),
        inset 1px 0 0 rgba(255, 255, 255, 0.4);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1.5px solid rgba(0, 0, 0, 0.4);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.light-theme .sidebar-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.sidebar-header h3 {
    font-size: 1rem;
    color: var(--color-text-primary);
}

/* Tab Switchers */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.15);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-text-primary);
}

.tab-btn.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    background: rgba(255,255,255,0.02);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.tab-pane {
    display: none;
    height: 100%;
    padding: 16px;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

/* Members UI */
.member-list-wrapper {
    flex: 1;
    overflow-y: auto;
}

.members-container {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.member-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    background: linear-gradient(135deg, #2b3a55 0%, #1e283b 100%);
    border: 1px solid var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.member-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.member-role {
    font-size: 0.7rem;
    color: var(--accent-gold);
}

.member-status-indicators {
    display: flex;
    gap: 6px;
    color: var(--color-text-muted);
}
.member-status-indicators i {
    width: 14px;
    height: 14px;
}

.member-status-indicators .muted {
    color: var(--danger-hover);
}

/* Prayer Wall UI */
.prayer-wall-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 16px;
}

.prayer-form {
    display: flex;
    gap: 8px;
}

.prayer-form input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.prayer-container {
    flex: 1;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.prayer-item {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-gold);
    border-radius: 4px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fade-in-up 0.3s ease-out;
}

.prayer-text {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-text-primary);
}

.prayer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.prayer-author {
    font-weight: 500;
    color: var(--accent-gold);
}

.btn-pray-heart {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-pray-heart:hover, .btn-pray-heart.prayed {
    color: #f43f5e;
}

.btn-pray-heart svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ==========================================================================
   Sanctuary Stage (Central Section)
   ========================================================================== */
#sanctuary-stage {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    position: relative;
    overflow: hidden;
}

/* Stage View Switcher */
.stage-view-switcher {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--stage-switcher-bg);
}

.stage-tab {
    padding: 14px 24px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
}

.stage-tab:hover:not(:disabled) {
    color: var(--color-text-primary);
}

.stage-tab.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    background-color: rgba(255, 255, 255, 0.01);
}

.stage-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.badge {
    padding: 2px 6px;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-secondary);
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

#active-share-badge.active {
    background-color: var(--accent-teal);
    color: #0b0f19;
}

/* Stage Panels */
.stage-panel {
    flex: 1;
    display: none;
    position: relative;
    overflow: hidden;
}

.stage-panel.active {
    display: flex;
    flex-direction: column;
}

/* Video Grid layout */
#video-grid-container {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background-color: #060913;
}

.grid-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.video-card {
    background-color: #0e0e11;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.4), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.12),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.18);
    transition: all var(--transition-normal);
    aspect-ratio: 16 / 9;
    box-sizing: border-box;
}

.light-theme .video-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 6px 15px rgba(0, 0, 0, 0.06), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.8),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.03);
}

/* Speaker Highlight Outline - premium glowing sunset accent */
.video-card.speaking {
    border: 2px solid var(--accent-gold) !important;
    box-shadow: 
        0 0 24px rgba(253, 160, 133, 0.5), 
        inset 0 1.5px 0.5px rgba(255, 255, 255, 0.3) !important;
}

.video-wrapper {
    width: 100%;
    height: 100%;
    background-color: #070709;
    position: relative;
    overflow: hidden;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #070709;
}

.video-wrapper video.mirrored {
    transform: scaleX(-1);
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0b0b0f;
    transition: opacity var(--transition-normal);
    z-index: 5;
}

.avatar-initials {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-circle);
    background: var(--gradient-sunset);
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Floating label in the bottom-left corner */
.video-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    padding: 6px 12px;
    background: rgba(15, 15, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none; /* Let user clicks interact with video context if needed */
    transition: background var(--transition-fast);
}

.video-label .user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
    color: #ffffff;
}

.video-label .indicators {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-label .indicators svg {
    width: 14px;
    height: 14px;
    color: #ef4444; /* Standard red mute icon */
}

.speaking-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.video-card.speaking .speaking-indicator {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px var(--accent-gold);
    animation: speak-pulse 1.5s infinite alternate;
}

/* Minimize / Maximize Video Toggle Styles */
.btn-minimize-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 15;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-circle);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}
.btn-minimize-toggle:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
.btn-minimize-toggle svg {
    width: 12px;
    height: 12px;
}
.video-card.minimized {
    aspect-ratio: auto !important;
    height: 44px !important;
    min-height: 44px !important;
    width: 240px !important;
    flex: 0 0 240px !important;
}
.video-card.minimized .video-wrapper {
    display: none !important;
}
.video-card.minimized .video-label {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: var(--radius-md) !important;
    background: rgba(9, 13, 22, 0.9) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 44px 0 16px !important;
    box-sizing: border-box !important;
    border: none !important;
}
.video-card.minimized .btn-minimize-toggle {
    top: 50% !important;
    right: 12px !important;
    transform: translateY(-50%) !important;
}
.video-card.minimized .icon-minimize-svg {
    display: none !important;
}
.video-card:not(.minimized) .icon-maximize-svg {
    display: none !important;
}

/* Minimize / Maximize Video Grid Toggle Styles */
#btn-minimize-grid {
    border: none;
    padding: 6px 12px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary);
    cursor: pointer;
    display: none; /* Controlled dynamically in JS */
    align-items: center;
    gap: 6px;
    transition: background var(--transition-fast), color var(--transition-fast);
}
#btn-minimize-grid:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-gold);
}
#btn-minimize-grid svg {
    width: 14px;
    height: 14px;
}

/* Sanctuary Stage docked grid layout (when viewing workspace with videos at the top) */
#sanctuary-stage.grid-docked {
    display: flex !important;
    flex-direction: column !important;
}

#sanctuary-stage.grid-docked #video-grid-container {
    height: var(--docked-grid-height, 160px) !important;
    flex: 0 0 var(--docked-grid-height, 160px) !important;
    padding: 8px 16px !important;
    border-bottom: 1.5px solid var(--border-color) !important;
    background-color: #04060c !important;
    transition: background-color var(--transition-normal) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}

#sanctuary-stage.grid-docked #video-grid-container::-webkit-scrollbar {
    height: 4px;
}
#sanctuary-stage.grid-docked #video-grid-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

#sanctuary-stage.grid-docked #video-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    width: auto !important;
    height: 100% !important;
    max-height: 100% !important;
}

#sanctuary-stage.grid-docked #video-grid .video-card {
    height: 100% !important;
    width: auto !important;
    aspect-ratio: 16 / 9 !important;
    flex: 0 0 auto !important;
    max-height: 100% !important;
    max-width: 250px !important;
}

/* Override minimized individual cards inside docked container to stay clean */
#sanctuary-stage.grid-docked #video-grid .video-card.minimized {
    width: 140px !important;
    flex: 0 0 140px !important;
}

/* When the docked video grid itself is minimized (collapsed) */
#sanctuary-stage.grid-docked-minimized #video-grid-container {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 16px !important;
    border-bottom: none !important;
    overflow: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

/* Draggable resizer bar between docked video grid and workspace */
.workspace-resizer {
    display: none;
    height: 6px;
    background-color: var(--border-color);
    cursor: row-resize;
    width: 100%;
    z-index: 10;
    transition: background-color var(--transition-fast);
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.workspace-resizer::after {
    content: '';
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: 0;
    right: 0;
    cursor: row-resize;
}
#sanctuary-stage.grid-docked:not(.grid-docked-minimized) .workspace-resizer {
    display: block;
}
.workspace-resizer:hover, .workspace-resizer.dragging {
    background-color: var(--accent-gold);
}

#sanctuary-stage.grid-docked #shared-workspace-container {
    flex: 1 !important;
    display: flex !important;
    height: calc(100% - var(--docked-grid-height, 160px)) !important;
}

#sanctuary-stage.grid-docked-minimized #shared-workspace-container {
    height: 100% !important;
}

/* Mobile responsive split for docked layout: tiles videos and makes workspace smaller */
@media (max-width: 768px) {
    #sanctuary-stage.grid-docked #video-grid-container {
        height: var(--docked-grid-height, 55%) !important;
        flex: 0 0 var(--docked-grid-height, 55%) !important;
        padding: 8px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    #sanctuary-stage.grid-docked #video-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-content: flex-start !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }

    #sanctuary-stage.grid-docked #video-grid .video-card {
        flex: 1 1 calc(50% - 8px) !important;
        width: calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
        height: auto !important;
        aspect-ratio: 16 / 9 !important;
        max-height: none !important;
    }

    #sanctuary-stage.grid-docked #shared-workspace-container {
        height: calc(100% - var(--docked-grid-height, 55%)) !important;
        flex: 0 0 calc(100% - var(--docked-grid-height, 55%)) !important;
    }
}

/* ==========================================================================
   Zoom-like Adaptive Layout Rules
   ========================================================================== */

/* 1 Participant */
.grid-layout.grid-1 .video-card {
    width: 100%;
    max-width: 900px;
    height: auto;
    max-height: calc(100vh - 180px);
}

/* 2 Participants - side by side */
.grid-layout.grid-2 .video-card {
    width: calc(50% - 8px);
    max-width: 580px;
}

/* 3 Participants */
.grid-layout.grid-3 .video-card {
    width: calc(33.33% - 8px);
    max-width: 420px;
}

/* 4 Participants - 2x2 grid */
.grid-layout.grid-4 .video-card {
    width: calc(50% - 8px);
    max-width: 480px;
}

/* 5 or 6 Participants */
.grid-layout.grid-5-6 .video-card {
    width: calc(33.33% - 8px);
    max-width: 380px;
}

/* 7+ Participants */
.grid-layout.grid-7-plus .video-card {
    width: calc(25% - 10px);
    max-width: 300px;
}

/* Media Query Adaptations for Mobile/Small Screens */
@media (max-width: 768px) {
    .grid-layout.grid-2 .video-card,
    .grid-layout.grid-3 .video-card,
    .grid-layout.grid-4 .video-card,
    .grid-layout.grid-5-6 .video-card,
    .grid-layout.grid-7-plus .video-card {
        width: calc(50% - 8px);
        max-width: 340px;
    }
}

@media (max-width: 480px) {
    .grid-layout.grid-1 .video-card,
    .grid-layout.grid-2 .video-card,
    .grid-layout.grid-3 .video-card,
    .grid-layout.grid-4 .video-card,
    .grid-layout.grid-5-6 .video-card,
    .grid-layout.grid-7-plus .video-card {
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================================
   Shared Workspace & Co-Control UI
   ========================================================================== */
#shared-workspace-container {
    flex-direction: column;
}

.workspace-bar {
    background-color: var(--bg-workspace-bar);
    border-bottom: 2px solid rgba(0, 0, 0, 0.4);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.2), 
        inset 0 -1px 0 rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.light-theme .workspace-bar {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.03), 
        inset 0 -1px 0 rgba(255, 255, 255, 0.4);
}

.workspace-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.workspace-selector-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workspace-selector-group select {
    padding: 6px 12px;
    font-size: 0.8rem;
    width: auto;
}

.co-control-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.co-control-indicator svg {
    width: 14px;
    height: 14px;
    color: var(--accent-gold);
}

.co-control-indicator.active {
    background-color: var(--accent-teal-glow);
    border-color: rgba(20, 184, 166, 0.3);
    color: var(--accent-teal);
}

.co-control-indicator.active svg {
    color: var(--accent-teal);
    animation: pulse 2s infinite;
}

.workspace-viewport-wrapper {
    flex: 1;
    position: relative;
    background-color: var(--bg-workspace-viewport);
    overflow: hidden;
}

#screenshare-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: #020408;
}

#interactive-workspace-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

#interactive-workspace-canvas.screenshare-active #whiteboard-canvas {
    background-color: transparent;
}

/* Cursors Overlay Layer */
#cursors-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
}

.remote-cursor {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
    z-index: 9999;
    pointer-events: none;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    transition: transform 0.08s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.remote-cursor-label {
    position: absolute;
    left: 18px;
    top: -2px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Workspace Applications */
.workspace-app {
    display: none;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.workspace-app.active {
    display: flex;
}

/* Empty Workspace State */
.empty-workspace-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 280px;
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.light-theme .empty-workspace-state {
    background: rgba(0, 0, 0, 0.02);
    border: 1.5px dashed rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Workspace Bible App */
.bible-app-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    height: 100%;
}

.bible-search-bar {
    display: flex;
    gap: 8px;
    max-width: 650px;
    align-items: center;
}

.bible-reader-body {
    flex: 1;
    background-color: var(--bg-interactive);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    overflow-y: auto;
    line-height: 1.8;
}

.bible-reader-body .verse {
    margin-bottom: 14px;
    font-size: 1.05rem;
    color: var(--color-text-primary);
    cursor: pointer;
    border-radius: 4px;
    padding: 4px 8px;
    transition: var(--transition-fast);
}

.bible-reader-body .verse:hover {
    background-color: var(--bg-verse-hover);
}

.bible-reader-body .verse.highlighted {
    background-color: rgba(212, 175, 55, 0.18);
    border-left: 3px solid var(--accent-gold);
}

.verse-num {
    font-size: 0.75rem;
    color: var(--accent-gold);
    font-weight: 700;
    margin-right: 6px;
    vertical-align: super;
}

.bible-instructions {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.bible-instructions svg {
    width: 14px;
    height: 14px;
}

/* Whiteboard App */
#app-whiteboard {
    padding: 0;
    position: relative;
}

.whiteboard-tools {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 100;
    background: var(--bg-whiteboard-tools);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-btn svg { width: 16px; height: 16px; }

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
}

.tool-btn.active {
    background: var(--accent-gold);
    color: #0b0f19;
}

input[type="color"]#whiteboard-color {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

#whiteboard-canvas {
    width: 100%;
    height: 100%;
    background-color: var(--bg-whiteboard-canvas);
    display: block;
    cursor: crosshair;
}

/* Notes App */
.notes-editor-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.notes-toolbar {
    background-color: var(--bg-notes-toolbar);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.editor-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-right: auto;
}

#notes-textarea {
    flex: 1;
    background-color: var(--bg-input);
    border: none;
    border-radius: 0;
    padding: 20px;
    resize: none;
    line-height: 1.6;
    font-size: 1rem;
}
#notes-textarea:focus {
    box-shadow: none;
    background-color: var(--bg-input-focus);
}

/* Media App */
.media-app-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    height: 100%;
}

.media-url-loader {
    display: flex;
    gap: 8px;
    max-width: 600px;
}

.media-player-wrapper {
    flex: 1;
    background-color: #000;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-player-wrapper video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
}

.media-hymns-presets {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   Chat Area (Right Panel)
   ========================================================================== */
#chat-sidebar {
    height: 100%;
}

.chat-messages-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-info-alert {
    background-color: rgba(253, 160, 133, 0.08);
    border: 1px solid rgba(253, 160, 133, 0.15);
    border-radius: var(--radius-md);
    padding: 12px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.chat-bubble {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px 18px 18px 6px;
    align-self: flex-start;
    background-color: var(--bg-chat-bubble);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    line-height: 1.4;
    animation: fade-in-up 0.25s ease-out;
}

.chat-bubble.outgoing {
    align-self: flex-end;
    border-radius: 18px 18px 6px 18px;
    background-color: var(--bg-chat-bubble-outgoing);
    border-color: rgba(253, 160, 133, 0.2);
}

.chat-bubble.system {
    align-self: center;
    text-align: center;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-style: italic;
    max-width: 100%;
}

.chat-msg-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.chat-msg-sender {
    color: var(--accent-gold);
}
.chat-bubble.outgoing .chat-msg-sender {
    color: var(--color-text-primary);
}

.chat-msg-time {
    color: var(--color-text-muted);
}

/* Scripture card inside chat */
.scripture-card {
    background-color: var(--bg-scripture-card);
    border: 1px dashed var(--accent-gold);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
}

.scripture-card-verse {
    font-style: italic;
    color: var(--color-text-primary);
    margin-bottom: 4px;
}

.scripture-card-ref {
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 0.75rem;
    text-align: right;
    display: block;
}

/* Reaction bar and Chat Input */
.chat-reactions-tray {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0,0,0,0.1);
}

.reaction-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.reaction-btn:hover {
    transform: scale(1.2);
    background-color: rgba(255,255,255,0.05);
}

.chat-input-wrapper {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-chat-input-wrapper);
}

.chat-input-wrapper form {
    display: flex;
    gap: 8px;
}

.chat-input-wrapper input {
    flex: 1;
    font-size: 0.85rem;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background-color: var(--bg-input);
    border: 1px solid rgba(0, 0, 0, 0.3);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
    box-shadow: 
        inset 0 1.5px 3px rgba(0, 0, 0, 0.3), 
        0 1px 0 rgba(255, 255, 255, 0.03);
}

.light-theme .chat-input-wrapper input {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05), 
        0 1px 0 rgba(255, 255, 255, 0.8);
}

.chat-input-wrapper input:focus {
    background-color: var(--bg-input-focus);
    border-color: var(--border-focus);
    outline: none;
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.3), 
        0 0 10px rgba(253, 160, 133, 0.2);
}

.light-theme .chat-input-wrapper input:focus {
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.05), 
        0 0 6px rgba(253, 160, 133, 0.3);
}

.chat-input-wrapper button {
    flex-shrink: 0;
    background: #18181b !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    box-shadow: 
        0 1.5px 0 rgba(0, 0, 0, 0.45), 
        0 3px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
}

.light-theme .chat-input-wrapper button {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    color: var(--color-text-primary) !important;
    box-shadow: 
        0 1.5px 0 rgba(0, 0, 0, 0.18), 
        0 3px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.7);
}

.chat-input-wrapper button:hover {
    background: #27272a !important;
    transform: translateY(-1px);
    box-shadow: 
        0 2.5px 0 rgba(0, 0, 0, 0.45), 
        0 5px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.15);
}

.light-theme .chat-input-wrapper button:hover {
    background: #f4f4f5 !important;
    box-shadow: 
        0 2.5px 0 rgba(0, 0, 0, 0.18), 
        0 5px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0.3px rgba(255, 255, 255, 0.8);
}

.chat-input-wrapper button:active {
    transform: translateY(1px);
    box-shadow: 
        0 0px 0 rgba(0, 0, 0, 0.45),
        inset 0 1.5px 3px rgba(0, 0, 0, 0.35);
}

.light-theme .chat-input-wrapper button:active {
    box-shadow: 
        0 0px 0 rgba(0, 0, 0, 0.18),
        inset 0 1.5px 3px rgba(0, 0, 0, 0.1);
}

/* Floating emojis animation layer */
#reactions-floating-layer {
    position: absolute;
    bottom: 80px;
    right: 20px;
    width: 200px;
    height: 60%;
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
}

.floating-emoji {
    position: absolute;
    bottom: 0;
    font-size: 1.8rem;
    animation: float-up 3.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    opacity: 0;
}

/* ==========================================================================
   Room Bottom Controls Bar
   ========================================================================== */
#room-controls-bar {
    background-color: var(--bg-room-controls-bar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 2px solid rgba(0, 0, 0, 0.4);
    box-shadow: 
        0 -4px 20px rgba(0, 0, 0, 0.35), 
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
    z-index: 90;
}

.light-theme #room-controls-bar {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 -3px 12px rgba(0, 0, 0, 0.04), 
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.controls-left, .controls-center, .controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   Modal Popups & Toast
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background-color: var(--bg-modal-card);
    border: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.05);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 440px;
    overflow: hidden;
    animation: scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    padding: 20px 24px;
    background-color: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    font-size: 1.15rem;
    color: var(--accent-gold);
}

.modal-body {
    padding: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-primary);
}

.modal-footer {
    padding: 16px 24px;
    background-color: rgba(0,0,0,0.15);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notification Container */
#toast-container {
    position: fixed;
    bottom: 96px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-toast);
    border-left: 4px solid var(--accent-gold);
    color: var(--color-text-primary);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 380px;
    pointer-events: auto;
    animation: slide-in-left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.toast-teal {
    border-left-color: var(--accent-teal);
}

.toast.toast-danger {
    border-left-color: var(--danger);
}

/* ==========================================================================
   Animations Keyframes
   ========================================================================== */
@keyframes glow-pulse {
    0%, 100% {
        text-shadow: 0 0 10px var(--accent-gold-glow);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
        transform: scale(1.05);
    }
}

@keyframes speak-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 4px var(--accent-gold);
    }
    100% {
        transform: scale(1.1);
        box-shadow: 0 0 12px var(--accent-gold);
    }
}

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

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.6) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-400px) scale(1.1) rotate(25deg);
    }
}

/* Sidebar Header close button styling */
.btn-close-sidebar {
    width: 30px !important;
    height: 30px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--color-text-secondary) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    padding: 0 !important;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-close-sidebar:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--color-text-primary) !important;
}
.light-theme .btn-close-sidebar:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Sidebar transition and closed states for desktop */
.room-layout.hub-closed {
    grid-template-columns: 0px minmax(0, 1fr) 340px;
}
.room-layout.chat-closed {
    grid-template-columns: 280px minmax(0, 1fr) 0px;
}
.room-layout.hub-closed.chat-closed {
    grid-template-columns: 0px minmax(0, 1fr) 0px;
}

#fellowship-hub, #chat-sidebar {
    transition: transform var(--transition-normal), width var(--transition-normal), opacity var(--transition-normal), visibility var(--transition-normal);
}

.room-layout.hub-closed #fellowship-hub {
    width: 0 !important;
    opacity: 0;
    visibility: hidden;
    border-right: none;
}

.room-layout.chat-closed #chat-sidebar {
    width: 0 !important;
    opacity: 0;
    visibility: hidden;
    border-left: none;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
    .room-layout {
        grid-template-columns: 220px minmax(0, 1fr) 280px;
    }
    .room-layout.hub-closed {
        grid-template-columns: 0px minmax(0, 1fr) 280px;
    }
    .room-layout.chat-closed {
        grid-template-columns: 220px minmax(0, 1fr) 0px;
    }
    .room-layout.hub-closed.chat-closed {
        grid-template-columns: 0px minmax(0, 1fr) 0px;
    }

    /* Footer controls bar is compact on screens <= 1024px to prevent overflow */
    #room-controls-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    #room-controls-bar .btn {
        padding: 0 !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    #room-controls-bar span {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }
    #lobby-view {
        padding: 16px;
        overflow-y: auto;
    }
    .lobby-grid {
        gap: 16px;
    }
    .lobby-setup-card .card-header,
    .lobby-setup-card .card-body,
    .lobby-preview-card .card-header,
    .lobby-preview-card .card-body {
        padding: 16px;
    }
    
    .room-layout {
        grid-template-columns: 1fr !important;
        position: relative;
    }
    
    #fellowship-hub, #chat-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        height: 100%;
        z-index: 150;
        background-color: var(--bg-sidebar);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
        transition: transform var(--transition-normal), box-shadow var(--transition-normal);
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    #fellowship-hub {
        left: 0;
        transform: translateX(-100%);
        border-right: 1px solid var(--border-color);
    }
    
    #chat-sidebar {
        right: 0;
        transform: translateX(100%);
        border-left: 1px solid var(--border-color);
    }
    
    .room-layout.hub-open #fellowship-hub {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    }
    
    .room-layout.chat-open #chat-sidebar {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    }

    /* Header adaptations */
    #app-header {
        padding: 10px 16px;
    }
    .logo-text h1 {
        font-size: 1.1rem;
    }
    .logo-text span {
        display: none;
    }
    .theme-toggle-btn span {
        display: none;
    }
    .theme-toggle-btn {
        padding: 6px 8px;
    }
    #status-text {
        display: none;
    }
    .status-badge {
        padding: 6px;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Footer controls bar styling moved to 1024px media query to prevent overflow on medium screens */
    
    /* Bible search bar */
    .bible-search-bar {
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
    }
    .bible-search-bar select,
    .bible-search-bar input {
        flex: 1 1 calc(50% - 4px);
        min-width: 120px;
    }
    .bible-search-bar button {
        flex: 1 1 auto;
    }
    .bible-search-bar .checkbox-label {
        margin-left: 0 !important;
        margin-top: 4px;
        width: 100%;
    }
    
    /* Workspace top bar */
    .workspace-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px;
    }
    .workspace-bar-left {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }
    .workspace-selector-group {
        justify-content: space-between;
        width: 100%;
    }
    .co-control-indicator {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Header logo and buttons */
    .header-logo .logo-icon {
        font-size: 1.2rem;
    }
    .logo-text h1 {
        font-size: 0.95rem;
    }
    .theme-toggle-btn {
        padding: 4px 6px;
    }
    
    /* Footer controls bar */
    #room-controls-bar {
        padding: 6px 8px;
        gap: 4px;
    }
    #room-controls-bar .btn {
        width: 34px !important;
        height: 34px !important;
    }
}


/* Dynamic Autoplay Mute Override Button */
.btn-unmute-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    background: var(--accent-gold);
    color: #0b0f19;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-unmute-overlay:hover {
    background: var(--accent-gold-hover);
    transform: translate(-50%, -52%) scale(1.03);
}

/* Global "Click to enable audio" banner shown on first remote stream */
.grace-unmute-banner {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: 0.85rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
}
.grace-unmute-banner span {
    font-weight: 500;
}

/* ==========================================================================
   Network Selector & Popover Styles
   ========================================================================== */
.network-status-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.network-status-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-gold-glow);
}

.network-status-btn svg {
    width: 14px;
    height: 14px;
    color: var(--success);
    vertical-align: middle;
}

.network-status-btn.poor svg {
    color: var(--danger);
}

.network-status-btn.moderate svg {
    color: var(--accent-gold);
}

.network-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    padding: 16px;
    z-index: 150;
    backdrop-filter: blur(12px);
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.network-popover.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-8px);
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.popover-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

#popover-network-speed {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.network-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.stat-box {
    background: var(--bg-interactive);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.62rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.segmented-control {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px;
}

.control-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius-md) - 2px);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 5px 0;
    cursor: pointer;
    transition: var(--transition-fast);
}

.control-btn:hover {
    color: var(--color-text-primary);
}

.control-btn.active {
    background: var(--accent-gold);
    color: #000 !important;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--accent-gold-glow);
}

.resolution-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.res-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    padding: 6px 12px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
}

.res-btn:hover {
    background: var(--bg-card-hover);
    color: var(--color-text-primary);
    border-color: var(--border-focus);
}

.res-btn.active {
    background: rgba(253, 160, 133, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    font-weight: 600;
}

/* Host Badge Styles */
.host-badge {
    background-color: rgba(253, 160, 133, 0.12);
    border: 1px solid rgba(253, 160, 133, 0.3);
    color: var(--accent-gold);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.light-theme .host-badge {
    background-color: rgba(225, 124, 97, 0.1);
    border-color: rgba(225, 124, 97, 0.25);
    color: var(--accent-gold);
}

/* Lobby Segmented Tab Switcher Styles */
.lobby-tabs {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: var(--radius-pill);
    box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.3), inset 0 -0.5px 0 rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.light-theme .lobby-tabs {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.06), inset 0 0.5px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.lobby-tab-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
}

.lobby-tab-btn i {
    width: 16px;
    height: 16px;
}

.lobby-tab-btn:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.light-theme .lobby-tab-btn:hover {
    background: rgba(0, 0, 0, 0.02);
}

.lobby-tab-btn.active {
    background: var(--gradient-sunset);
    color: #18181b;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 
        0 2.5px 4px rgba(0, 0, 0, 0.2), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.35),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.1);
}

.light-theme .lobby-tab-btn.active {
    color: #ffffff;
    box-shadow: 
        0 2px 3px rgba(0, 0, 0, 0.1), 
        inset 0 1px 0.3px rgba(255, 255, 255, 0.3),
        inset 0 -0.5px 0.3px rgba(0, 0, 0, 0.08);
}

/* Host Moderation Controls Dropdown styles */
.host-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1000;
    background: rgba(20, 20, 25, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-dark);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 155px;
    text-align: left;
    box-sizing: border-box;
}

.host-dropdown-menu.hidden {
    display: none !important;
}

.light-theme .host-dropdown-menu {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-light);
}

.host-dropdown-menu .dropdown-item {
    background: none;
    border: none;
    padding: 8px 12px;
    color: var(--color-text-primary);
    text-align: left;
    font-size: 0.78rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    transition: background var(--transition-fast), color var(--transition-fast);
    box-sizing: border-box;
    font-family: inherit;
}

.host-dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.light-theme .host-dropdown-menu .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.host-dropdown-menu .dropdown-item i {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.host-dropdown-menu .dropdown-item.host-kick-btn {
    color: #ef4444;
    font-weight: 600;
}

.host-dropdown-menu .dropdown-item.host-kick-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
}

/* More Vertical trigger buttons */
.btn-host-controls, .btn-card-host-controls {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-host-controls:hover {
    color: var(--accent-gold);
}

.btn-card-host-controls {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-circle);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    padding: 0;
}

.btn-card-host-controls:hover {
    background: rgba(212, 175, 55, 0.25);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.light-theme .btn-card-host-controls {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--color-text-secondary);
}

.light-theme .btn-card-host-controls:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
