/* ==========================================================================
   AURA Meet CSS Stylesheet
   ========================================================================== */

/* --- Design Tokens & Variables --- */
:root {
    --bg-base: #0a0814;
    --bg-surface: rgba(22, 19, 39, 0.65);
    --bg-surface-solid: #161327;
    --bg-card: rgba(30, 27, 53, 0.45);
    --bg-control: rgba(45, 41, 74, 0.6);
    --bg-control-hover: rgba(65, 59, 106, 0.8);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 242, 254, 0.4);
    
    --text-primary: #f3f1f9;
    --text-secondary: #a09cb4;
    --text-muted: #6c6882;
    
    --primary: #4facfe;
    --primary-glow: rgba(79, 172, 254, 0.35);
    --accent: #00f2fe;
    --accent-glow: rgba(0, 242, 254, 0.35);
    --danger: #ff416c;
    --danger-glow: rgba(255, 65, 108, 0.35);
    --success: #00ff87;
    
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

select, input, button {
    font-family: inherit;
    color: inherit;
}

/* --- Animated Glowing Background --- */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.45;
    pointer-events: none;
    transition: all var(--transition-slow);
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79,172,254,0.4) 0%, rgba(0,242,254,0.1) 70%);
    top: -100px;
    left: -100px;
    animation: pulseGlow 15s infinite alternate ease-in-out;
}

.bg-glow-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(147,51,234,0.3) 0%, rgba(79,172,254,0.05) 70%);
    bottom: -150px;
    right: -100px;
    animation: pulseGlow 20s infinite alternate-reverse ease-in-out;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0,255,135,0.15) 0%, rgba(79,172,254,0) 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: driftGlow 25s infinite linear;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.4; }
    100% { transform: scale(1.2) translate(50px, 30px); opacity: 0.55; }
}

@keyframes driftGlow {
    0% { transform: translate(-50%, -50%) rotate(0deg) translate(80px) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translate(80px) rotate(-360deg); }
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* --- Layout Container --- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* --- Screen Transitions --- */
.screen {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* ==========================================================================
   COMMON COMPONENTS
   ========================================================================== */

/* --- Glassmorphism Cards --- */
.lobby-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #0b071e;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.1);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-control);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--bg-control-hover);
    border-color: var(--text-secondary);
}

.btn-mini {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
}
.btn-mini:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.btn-block {
    display: flex;
    width: 100%;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-control);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}
.icon-btn:hover {
    background: var(--bg-control-hover);
    transform: scale(1.05);
}

/* --- Form Fields --- */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.input-group input[type="text"] {
    background: rgba(14, 11, 26, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

.input-group input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15);
    background: rgba(14, 11, 26, 0.85);
}

.room-input-container {
    display: flex;
    gap: 12px;
}
.room-input-container input {
    flex: 1;
}

/* --- Custom Select Dropdowns --- */
.custom-select {
    background: rgba(14, 11, 26, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='none' height='24' stroke='%23a09cb4' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    transition: all var(--transition-fast);
}

.custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.15);
}

/* ==========================================================================
   LOBBY SCREEN STYLING
   ========================================================================== */
.lobby-screen {
    align-items: center;
    justify-content: flex-start;
    padding: 24px 16px;
    width: 100%;
    overflow-y: auto;
}

.lobby-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    padding: 10px;
    border-radius: 12px;
    color: #0b071e;
    box-shadow: 0 8px 24px var(--primary-glow);
}

.lobby-header h1 {
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1px;
}

.lobby-header h1 span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.lobby-header .subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.lobby-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
}

@media (min-width: 769px) {
    .lobby-grid {
        grid-template-columns: 1.2fr 1fr;
        gap: 32px;
    }
    .lobby-screen {
        justify-content: center;
        padding: 40px 24px;
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* --- Media Setup Card --- */
.media-setup-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.video-preview-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    background: #090714;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.05);
}

.video-preview-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror camera stream */
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #161327 0%, #0d0b19 100%);
    z-index: 2;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-control-hover) 0%, var(--bg-surface-solid) 100%);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.video-placeholder p {
    color: var(--text-secondary);
    font-size: 14px;
}

.preview-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    z-index: 5;
}

.preview-controls .icon-btn {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(30, 27, 53, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
    width: 48px;
    height: 48px;
}

.preview-controls .icon-btn:hover {
    background: rgba(45, 41, 74, 0.9);
}

/* Mic visualizer canvas */
#mic-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
    z-index: 3;
    opacity: 0.8;
}

/* Device select dropdown styling specific to lobby settings */
.device-selectors {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   CALL SCREEN STYLING
   ========================================================================== */
.call-screen {
    position: relative;
    background: radial-gradient(circle at center, #110e24 0%, #06050b 100%);
}

.call-header {
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(10, 8, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-small svg {
    color: var(--primary);
}

.room-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.room-badge strong {
    color: var(--text-primary);
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--success);
    animation: heartbeatPulse 2s infinite alternate;
}

@keyframes heartbeatPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 1; }
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.user-avatar-tiny {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #0b071e;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* --- Layout of Grid & Sidebar --- */
.call-layout {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.video-grid-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
}

/* /* --- Dynamic Video Grid --- */
.video-grid {
    display: grid;
    gap: 12px;
    width: 100%;
    height: 100%;
    max-height: 100%;
    transition: all var(--transition-normal);
}
 
/* Custom Grid Layouts optimized for vertical screens */
.grid-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}
.grid-2 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, 1fr);
}
.grid-3 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
}
.grid-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}
.grid-5, .grid-6 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

/* Desktop horizontal grid layouts */
@media (min-width: 769px) {
    .grid-1 {
        max-width: 900px;
        aspect-ratio: 16/9;
        margin: 0 auto;
    }
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 1fr;
        max-width: 1200px;
        align-content: center;
        margin: 0 auto;
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
    .grid-3 .video-card:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
    .grid-5, .grid-6 {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* --- Video Card Styling --- */
.video-card {
    background: #0d0b19;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #0b0914;
}

.video-card.local video {
    transform: scaleX(-1); /* Mirror local user screen only */
}

.video-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
}

.participant-name {
    background: rgba(10, 8, 20, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.audio-mic-status {
    background: rgba(10, 8, 20, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Mute state, avatar overlays --- */
.video-off-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #1a162b 0%, #0d0b19 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.video-card.cam-off .video-off-avatar {
    opacity: 1;
}

.avatar-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-control-hover) 0%, var(--bg-surface-solid) 100%);
    border: 3px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    text-transform: uppercase;
}

/* Active speaker voice ring visualizer */
.audio-level-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    border-radius: var(--radius-md);
    pointer-events: none;
    z-index: 4;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.video-card.active-speaker .audio-level-border {
    border-color: var(--success);
    box-shadow: inset 0 0 12px rgba(0, 255, 135, 0.4), 0 0 15px rgba(0, 255, 135, 0.2);
}

/* ==========================================================================
   SIDEBAR PANEL (CHAT / PARTICIPANTS)
   ========================================================================== */
.sidebar-panel {
    width: 100%;
    background: rgba(14, 11, 26, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    height: 100%;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    position: absolute;
    right: 0;
    top: 0;
    z-index: 20; /* Overlay videos and bottom controls */
    box-shadow: -10px 0 25px rgba(0, 0, 0, 0.4);
}
 
.sidebar-panel.open {
    transform: translateX(0);
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px 0;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn-close {
    background: none;
    border: none;
    padding: 14px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-btn-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* --- Chat Panel Content --- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-input-bar {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: rgba(10, 8, 20, 0.4);
}

.chat-input-bar input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}

.chat-input-bar input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
}

.send-message-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #0b071e;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.send-message-btn:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* --- Message Bubbles --- */
.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    gap: 4px;
}

.message-bubble.incoming {
    align-self: flex-start;
}

.message-bubble.outgoing {
    align-self: flex-end;
}

.msg-sender {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 6px;
}

.message-bubble.outgoing .msg-sender {
    align-self: flex-end;
    margin-right: 6px;
    margin-left: 0;
}

.msg-body {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    font-size: 14px;
    word-break: break-word;
}

.message-bubble.outgoing .msg-body {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.05) 100%);
    border-color: rgba(79, 172, 254, 0.2);
    border-radius: 16px 16px 4px 16px;
    color: var(--text-primary);
}

.msg-time {
    font-size: 10px;
    color: var(--text-muted);
    align-self: flex-end;
    margin-top: 2px;
}

.system-message {
    align-self: center;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 12px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

/* --- Participant List styling --- */
.participant-list {
    list-style: none;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.avatar-tiny {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-control);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.participant-item-name {
    font-size: 14px;
    flex: 1;
}

.participant-item-role {
    font-size: 11px;
    background: rgba(79, 172, 254, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 500;
}

/* ==========================================================================
   BOTTOM CONTROLS BAR STYLING
   ========================================================================= */
.call-controls-bar {
    height: 70px;
    background: rgba(10, 8, 20, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 10;
}
 
.controls-left, .controls-right {
    flex: 1;
    display: flex;
    align-items: center;
}
 
.controls-right {
    justify-content: flex-end;
}
 
.controls-center {
    display: flex;
    align-items: center;
    gap: 10px;
}
 
/* Control buttons inside conference */
.control-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-control);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    position: relative;
}
 
.control-btn:hover {
    background: var(--bg-control-hover);
    transform: scale(1.05);
}
 
.control-btn.toggle-active {
    background: var(--primary);
    color: #0b071e;
    border-color: transparent;
}
.control-btn.toggle-active:hover {
    background: var(--accent);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}
 
.control-btn.btn-danger {
    background: var(--danger);
    color: #ffffff;
    border-color: transparent;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--danger-glow);
}
.control-btn.btn-danger:hover {
    background: #ff6584;
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 6px 20px var(--danger-glow);
}

.control-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-base);
}

/* ==========================================================================
   MODAL WINDOW DIALOGS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 5, 11, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-backdrop:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-backdrop:not(.hidden) .modal-content {
    transform: scale(1);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}
.close-modal-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

/* ==========================================================================
   END SCREEN STYLING
   ========================================================================== */
.end-screen {
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.end-card {
    max-width: 460px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.end-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 255, 135, 0.1);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 135, 0.1);
}

.end-card h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
}

.end-card p {
    color: var(--text-secondary);
    font-size: 15px;
}

.end-actions {
    width: 100%;
    margin-top: 10px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS SYSTEM
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: rgba(22, 19, 39, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    max-width: 360px;
    animation: toastSlideIn var(--transition-normal) forwards;
    transition: all var(--transition-normal);
}

@keyframes toastSlideIn {
    0% { transform: translateX(100%) translateY(-10px); opacity: 0; }
    100% { transform: translateX(0) translateY(0); opacity: 1; }
}

.toast.removing {
    transform: translateX(120%);
    opacity: 0;
}

.toast.toast-info {
    border-left: 4px solid var(--primary);
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-warning {
    border-left: 4px solid var(--danger);
}

/* ==========================================================================
   ANIMATION HELPERS
   ========================================================================== */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   MOBILE ONLY RESTRICTOR OVERLAY
   ========================================================================== */
.mobile-only-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #0e0a1f 0%, #05040a 100%);
    z-index: 10000; /* High z-index to block everything */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.restrictor-card {
    background: rgba(22, 19, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.restrictor-card h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.restrictor-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.qr-container {
    background: #ffffff;
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    margin: 10px 0;
}

.qr-container img {
    width: 160px;
    height: 160px;
    display: block;
}

.qr-help {
    color: #0b071e !important;
    font-weight: 600;
    font-size: 12px !important;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    transition: color var(--transition-fast);
    margin-top: 10px;
}

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

/* ==========================================================================
   DESKTOP MEDIA OVERRIDES (UNIVERSAL LAYOUT)
   ========================================================================== */
@media (min-width: 769px) {
    .sidebar-panel {
        width: 340px;
        background: rgba(14, 11, 26, 0.75);
        backdrop-filter: blur(15px);
        border-left: 1px solid var(--border-color);
        z-index: 8;
        box-shadow: -10px 0 25px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar-panel.open {
        position: relative; /* Push video grid on desktop */
    }
    
    .call-controls-bar {
        height: 80px;
        padding: 0 32px;
    }
    
    .controls-center {
        gap: 16px;
    }
    
    .control-btn {
        width: 48px;
        height: 48px;
    }
    
    .control-btn.btn-danger {
        width: 54px;
        height: 54px;
        border-radius: 16px;
    }
}
