/* ═══════════════════════════════════════════
   SintonusMedia Pro - Modern UI Theme v3.0
   ═══════════════════════════════════════════ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --dark-lighter: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(15, 23, 42, 0.8);
    --glass-light: rgba(30, 41, 59, 0.9);
    --border: rgba(148, 163, 184, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════
   Start Screen
   ═══════════════════════════════════════════ */

.start-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.start-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.start-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

.logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container img {
    height: 48px;
    margin-bottom: 8px;
}

.logo-container h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-container p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--dark-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Checkbox Styles */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--dark-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-item:hover {
    background: var(--dark-lighter);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkbox-item .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-item input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-item input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-item span:last-child {
    font-size: 13px;
    color: var(--text);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: var(--dark-lighter);
    color: var(--text);
}

.btn-icon:hover {
    background: var(--dark-light);
    transform: scale(1.1);
}

.btn-icon.active {
    background: var(--primary);
}

.btn-icon.danger {
    background: var(--danger);
}

/* ═══════════════════════════════════════════
   Call Screen
   ═══════════════════════════════════════════ */

.call-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 100;
}

.call-screen.active {
    display: flex;
    flex-direction: column;
}

/* Video Container */
.video-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    overflow: hidden;
}

/* Remote Video Wrapper */
.remote-video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Remote Placeholder (waiting for participant) */
.remote-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #64748b;
    text-align: center;
}

.remote-placeholder i {
    font-size: 80px;
    opacity: 0.3;
}

.remote-placeholder p {
    font-size: 18px;
    opacity: 0.7;
}

.remote-placeholder.hidden {
    display: none;
}

/* Remote Video - Full Screen */
.remote-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

/* Placeholder when no remote video */
.remote-video-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}

.remote-video-placeholder i {
    font-size: 80px;
    opacity: 0.3;
}

.remote-video-placeholder span {
    font-size: 18px;
    opacity: 0.5;
}

.remote-video-placeholder.hidden {
    display: none;
}

/* Local Video - Picture in Picture */
.local-video-wrapper {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 240px;
    height: 180px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    z-index: 10;
    background: var(--dark-light);
}

.local-video-wrapper:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.3);
}

.local-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.local-video-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

/* Call Header */
.call-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    opacity: 1;
    transition: all 0.3s ease;
}

.call-header.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}

.call-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.room-badge i {
    color: var(--primary-light);
}

.call-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: white;
}

.call-timer i {
    color: var(--secondary);
}

.call-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recording-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
}

.recording-indicator.active {
    display: flex;
}

.rec-dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Call Controls */
.call-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 20;
    opacity: 1;
    transition: all 0.3s ease;
}

.call-controls.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.control-btn {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--primary);
}

.control-btn.muted {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.control-btn.hangup {
    background: #ef4444;
    width: 64px;
    height: 64px;
}

.control-btn.hangup:hover {
    background: #dc2626;
}

.control-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    background: var(--danger);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.control-btn .badge.active {
    display: flex;
}

.control-btn.hidden {
    display: none;
}

/* Responsive Video */
@media (max-width: 768px) {
    .local-video-wrapper {
        width: 120px;
        height: 160px;
        bottom: 90px;
        right: 12px;
        border-radius: 12px;
    }
    
    .call-header {
        padding: 12px 16px;
    }
    
    .room-badge, .call-timer {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .call-controls {
        padding: 16px;
        gap: 8px;
    }
    
    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .control-btn.hangup {
        width: 56px;
        height: 56px;
    }
    
    .remote-video-placeholder i {
        font-size: 48px;
    }
    
    .remote-video-placeholder span {
        font-size: 14px;
    }
}

.recording-indicator .dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

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

/* Call Controls */
.call-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    justify-content: center;
    gap: 16px;
    z-index: 20;
    opacity: 1;
    transition: var(--transition);
}

.call-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.control-btn {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--glass-light);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-btn:hover {
    background: var(--dark-lighter);
    transform: scale(1.1);
}

.control-btn.active {
    background: var(--primary);
}

.control-btn.muted {
    background: var(--danger);
}

.control-btn.hangup {
    background: var(--danger);
    width: 64px;
    height: 64px;
    font-size: 24px;
}

.control-btn.hangup:hover {
    background: #dc2626;
}

.control-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--danger);
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.control-btn .badge.active {
    display: flex;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ═══════════════════════════════════════════
   Chat Panel
   ═══════════════════════════════════════════ */

.chat-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.chat-panel.open {
    right: 0;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header h3 i {
    color: var(--primary-light);
}

.chat-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--dark-lighter);
    color: var(--text);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.chat-close:hover {
    background: var(--danger);
}

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

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.received {
    align-self: flex-start;
    background: var(--dark-lighter);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.chat-message .time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--dark-lighter);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-muted);
    align-self: flex-start;
}

.typing-indicator.active {
    display: flex;
}

.typing-indicator .dots {
    display: flex;
    gap: 4px;
}

.typing-indicator .dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator .dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.chat-input-wrapper {
    padding: 20px;
    border-top: 1px solid var(--border);
}

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

.chat-input {
    flex: 1;
    padding: 14px 16px;
    background: var(--dark-light);
    border: 1px solid var(--border);
    border-radius: 24px;
    color: var(--text);
    font-size: 14px;
    transition: var(--transition);
}

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

.chat-send {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.chat-send:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════
   Stats Panel
   ═══════════════════════════════════════════ */

.stats-panel {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
}

.stats-panel.open {
    left: 0;
}

.stats-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-content {
    padding: 20px;
}

.stats-section {
    margin-bottom: 24px;
}

.stats-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    background: var(--dark-light);
    padding: 14px;
    border-radius: var(--radius-sm);
}

.stat-item .label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.stat-item .value.good { color: var(--secondary); }
.stat-item .value.warning { color: var(--warning); }
.stat-item .value.bad { color: var(--danger); }

/* ═══════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 16px 20px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--secondary); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

.toast i {
    font-size: 20px;
}

.toast.success i { color: var(--secondary); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.empty-state i {
    font-size: 64px;
    color: var(--dark-lighter);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    .start-card {
        padding: 24px;
        margin: 10px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .local-video-wrapper {
        width: 120px;
        height: 90px;
        bottom: 90px;
        right: 10px;
    }
    
    .chat-panel,
    .stats-panel {
        width: 100%;
    }
    
    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .control-btn.hangup {
        width: 56px;
        height: 56px;
    }
}

/* ═══════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════ */

.hidden { display: none !important; }
.visible { display: block !important; }

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

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-lighter);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* ═══════════════════════════════════════════
   Cookie Banner & Modal (GDPR)
   ═══════════════════════════════════════════ */

.cookie-banner {
    position: fixed;
    bottom: -300px;
    left: 0;
    right: 0;
    background: var(--glass);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 20px;
    z-index: 10000;
    transition: bottom 0.5s ease;
}

.cookie-banner.show {
    bottom: 0;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-text {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 300px;
}

.cookie-text i {
    font-size: 32px;
    color: var(--warning);
    flex-shrink: 0;
}

.cookie-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.cookie-text p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.cookie-text a {
    color: var(--primary-light);
    text-decoration: none;
}

.cookie-text a:hover {
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.cookie-btn-primary {
    background: var(--primary);
    color: white;
}

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

.cookie-btn-secondary {
    background: var(--dark-lighter);
    color: var(--text);
}

.cookie-btn-secondary:hover {
    background: var(--dark-light);
}

/* Cookie Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.cookie-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-content {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: var(--transition);
}

.cookie-modal.show .cookie-modal-content {
    transform: scale(1);
}

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

.cookie-modal-header h3 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.cookie-modal-header h3 i {
    color: var(--primary-light);
}

.cookie-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--dark-lighter);
    color: var(--text);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-close:hover {
    background: var(--danger);
}

.cookie-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 400px;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--dark-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.cookie-option:last-child {
    margin-bottom: 0;
}

.cookie-option-info strong {
    display: block;
    margin-bottom: 4px;
}

.cookie-option-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.cookie-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark-lighter);
    border-radius: 26px;
    transition: var(--transition);
}

.cookie-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.cookie-toggle input:checked + .cookie-slider {
    background: var(--primary);
}

.cookie-toggle input:checked + .cookie-slider::before {
    transform: translateX(24px);
}

.cookie-toggle.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle.disabled .cookie-slider {
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   Start Footer & Legal
   ═══════════════════════════════════════════ */

.start-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.start-footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.start-footer a {
    color: var(--primary-light);
    text-decoration: none;
}

.start-footer a:hover {
    text-decoration: underline;
}

.main-footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1;
}

.main-footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.main-logo {
    max-height: 80px;
    width: auto;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-text {
        flex-direction: column;
        align-items: center;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .main-footer {
        position: relative;
        margin-top: 20px;
    }
}

/* Footer Links */
.footer-links {
    margin-top: 24px;
    text-align: center;
}

.footer-links p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--primary-light);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links .copyright {
    font-size: 11px;
    color: var(--dark-lighter);
}

/* Role Indicator */
.role-indicator {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-align: center;
}

.role-indicator.admin {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #1a1a1a;
}

.role-indicator.client {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ═══════════════════════════════════════════
   Virtual Background Panel
   ═══════════════════════════════════════════ */

.background-panel {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.background-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.background-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.background-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.background-header h3 i {
    color: #8b5cf6;
}

.panel-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.panel-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Tabs */
.bg-tabs {
    display: flex;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.bg-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.bg-tab:hover {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.05);
}

.bg-tab.active {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 2px solid #6366f1;
}

.bg-tab i {
    font-size: 14px;
}

/* Tab Content */
.bg-tab-content {
    display: none;
    padding: 16px;
}

.bg-tab-content.active {
    display: block;
}

/* Options Grid */
.background-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.bg-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 10px;
}

.bg-option:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.bg-option.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.bg-option i {
    font-size: 20px;
}

.bg-color-preview {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* AI Loading */
.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: #94a3b8;
    font-size: 13px;
}

.ai-loading i {
    font-size: 18px;
    color: #6366f1;
}

/* Green Screen Settings */
.greenscreen-settings {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gs-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gs-row label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.gs-colors, .gs-backgrounds {
    display: flex;
    gap: 8px;
    align-items: center;
}

.gs-color, .gs-bg {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.gs-color:hover, .gs-bg:hover {
    transform: scale(1.1);
}

.gs-color.active, .gs-bg.active {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.gs-colors input[type="color"],
.gs-backgrounds input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.gs-row input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(148, 163, 184, 0.2);
    appearance: none;
    cursor: pointer;
}

.gs-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
}

.gs-apply-btn, .gs-stop-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.gs-apply-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.gs-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.gs-stop-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.gs-stop-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Note */
.background-note {
    padding: 12px 16px;
    font-size: 11px;
    color: #64748b;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    margin-top: 12px;
}

.background-note i {
    margin-top: 2px;
    color: #6366f1;
}

/* Video Effects Transition */
.local-video-wrapper video {
    transition: filter 0.3s ease, transform 0.3s ease;
}

@media (max-width: 768px) {
    .background-panel {
        width: 95%;
        bottom: 80px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .bg-tab {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .bg-tab span {
        display: none;
    }
    
    .background-options {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .bg-option {
        padding: 10px 6px;
        font-size: 9px;
    }
    
    .bg-option i {
        font-size: 18px;
    }
}

/* AI Unavailable Message */
.ai-unavailable {
    text-align: center;
    padding: 24px 16px;
    color: #94a3b8;
}

.ai-unavailable i {
    font-size: 32px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.ai-unavailable h4 {
    font-size: 14px;
    color: #f8fafc;
    margin-bottom: 8px;
}

.ai-unavailable p {
    font-size: 12px;
    margin-bottom: 12px;
}

.ai-unavailable ul {
    text-align: left;
    font-size: 12px;
    padding-left: 20px;
}

.ai-unavailable li {
    margin-bottom: 6px;
}

/* ==========================================
   JP Mercury Media v4.0 - New Features CSS
   ========================================== */

/* Connection Quality Indicator */
.connection-quality {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    font-size: 12px;
}

.quality-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.quality-dot.good { background: #22c55e; }
.quality-dot.medium { background: #f59e0b; }
.quality-dot.poor { background: #ef4444; }

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

/* Encryption Badge */
.encryption-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    font-size: 11px;
    color: #22c55e;
}

.encryption-badge i {
    font-size: 10px;
}

/* Header Buttons */
.header-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Audio Level Indicator */
.audio-level {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 20px;
}

.audio-bar {
    width: 4px;
    background: #22c55e;
    border-radius: 2px;
    transition: height 0.1s;
}

.audio-bar:nth-child(1) { height: 4px; }
.audio-bar:nth-child(2) { height: 8px; }
.audio-bar:nth-child(3) { height: 12px; }
.audio-bar:nth-child(4) { height: 8px; }
.audio-bar:nth-child(5) { height: 4px; }

.audio-level.speaking .audio-bar:nth-child(1) { height: 8px; }
.audio-level.speaking .audio-bar:nth-child(2) { height: 14px; }
.audio-level.speaking .audio-bar:nth-child(3) { height: 20px; }
.audio-level.speaking .audio-bar:nth-child(4) { height: 14px; }
.audio-level.speaking .audio-bar:nth-child(5) { height: 8px; }

/* Speaking Indicator */
.speaking-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(34, 197, 94, 0.8);
    border-radius: 4px;
    font-size: 12px;
    animation: speakPulse 0.5s infinite alternate;
}

@keyframes speakPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Reactions */
.reactions-bar {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
}

.reactions-bar.visible {
    display: flex;
}

.reaction-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.reaction-btn.raise-hand.active {
    background: #f59e0b;
    animation: handRaise 0.5s infinite alternate;
}

@keyframes handRaise {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

/* Reactions Overlay */
.reactions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.floating-reaction {
    position: absolute;
    font-size: 48px;
    animation: floatUp 2s ease-out forwards;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-300px) scale(1.5);
    }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #1e293b;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
}

/* Keyboard Shortcuts Modal */
.shortcuts-modal {
    max-width: 400px;
}

/* Live Stream Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.stream-modal {
    max-width: 480px;
}

.stream-info {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 20px;
}

.stream-platforms {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.platform-btn {
    padding: 12px 8px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    color: #f8fafc;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    transition: all 0.2s;
}

.platform-btn i {
    font-size: 24px;
}

.platform-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.platform-btn.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.form-hint {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
}

.stream-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    margin-top: 16px;
}

.stream-status .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #64748b;
}

.stream-status.live .status-dot {
    background: #ef4444;
    animation: pulse 1s ease infinite;
}

.stream-status .status-text {
    font-size: 13px;
    color: #94a3b8;
}

.stream-status.live .status-text {
    color: #ef4444;
    font-weight: 600;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

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

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.shortcut-item:last-child {
    border-bottom: none;
}

.shortcut-item kbd {
    min-width: 40px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    text-align: center;
    color: #a5b4fc;
}

/* Waiting Room */
.waiting-room-modal {
    text-align: center;
    max-width: 400px;
}

.waiting-room-header {
    margin-bottom: 24px;
}

.waiting-logo {
    width: 60px;
    margin-bottom: 12px;
}

.waiting-room-header h2 {
    margin: 0;
    font-size: 24px;
}

.waiting-preview {
    position: relative;
    width: 280px;
    height: 210px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
}

.waiting-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.waiting-controls {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

.waiting-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.waiting-btn:hover {
    background: rgba(255,255,255,0.3);
}

.waiting-btn.muted {
    background: #ef4444;
}

.waiting-info {
    padding: 20px;
}

.waiting-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.waiting-room-name {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 8px;
}

/* Participant Request Modal */
.participant-request-modal {
    text-align: center;
    max-width: 350px;
}

.participant-info {
    padding: 20px 0;
}

.participant-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    margin: 0 auto 12px;
}

.participant-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-success {
    background: #22c55e;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 60px;
    right: 80px;
    background: #1e293b;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 200;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.emoji-item {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.emoji-item:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.2);
}

/* Chat Enhancements */
.emoji-btn, .attach-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-btn:hover, .attach-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* File Message */
.chat-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    margin-top: 8px;
}

.chat-file i {
    font-size: 24px;
    color: #6366f1;
}

.chat-file-info {
    flex: 1;
}

.chat-file-name {
    font-size: 13px;
    font-weight: 500;
}

.chat-file-size {
    font-size: 11px;
    color: #94a3b8;
}

.chat-file-download {
    width: 32px;
    height: 32px;
    border: none;
    background: #6366f1;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

/* Image Preview in Chat */
.chat-image {
    max-width: 200px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
}

/* Fullscreen Styles */
.call-screen.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.call-screen.fullscreen .call-header {
    opacity: 0;
    transition: opacity 0.3s;
}

.call-screen.fullscreen:hover .call-header {
    opacity: 1;
}

.call-screen.fullscreen .call-controls {
    opacity: 0;
    transition: opacity 0.3s;
}

.call-screen.fullscreen:hover .call-controls {
    opacity: 1;
}

/* Raised Hand Indicator on Video */
.hand-raised-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 32px;
    animation: handWave 0.5s infinite alternate;
}

@keyframes handWave {
    from { transform: rotate(-10deg); }
    to { transform: rotate(10deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .reactions-bar {
        bottom: 90px;
        padding: 8px 12px;
    }
    
    .reaction-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .encryption-badge span {
        display: none;
    }
    
    .quality-text {
        display: none;
    }
    
    .header-btn {
        width: 32px;
        height: 32px;
    }
}

/* Notification Sound Badge */
.notification-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #1e293b;
}

/* Push to Talk Indicator */
.ptt-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    background: rgba(99, 102, 241, 0.9);
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    display: none;
    z-index: 1500;
}

.ptt-indicator.visible {
    display: block;
    animation: pttPulse 0.5s infinite alternate;
}

@keyframes pttPulse {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.05); }
}

/* ==========================================
   JP Mercury Media v4.0 - Additional Features
   ========================================== */

/* Live Captions */
.captions-container {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 80%;
    min-width: 300px;
    z-index: 100;
    pointer-events: auto;
}

.captions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.captions-lang-select {
    background: rgba(30, 41, 59, 0.95);
    color: #f8fafc;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    flex: 1;
}

.captions-lang-select:hover {
    border-color: #6366f1;
}

.captions-lang-select option {
    background: #1e293b;
    color: #f8fafc;
}

.captions-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.captions-close:hover {
    background: #ef4444;
    color: white;
}

.captions-text {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.5;
    text-align: center;
    max-height: 120px;
    overflow-y: auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.captions-text:empty {
    display: none;
}

.captions-text .interim {
    color: #94a3b8;
    font-style: italic;
}

.captions-text .final {
    color: #fff;
}

/* Custom Background Upload */
.custom-bg-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.custom-bg-section h4 {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-bg-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.custom-bg-name {
    font-size: 12px;
    color: #64748b;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-bg-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.custom-bg-preset {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.custom-bg-preset:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.custom-bg-preset.active {
    border-color: #6366f1;
}

.custom-bg-preset.remove {
    position: relative;
}

.custom-bg-preset .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: none;
}

.custom-bg-preset:hover .remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Branding Customization */
.branded-logo {
    max-height: 50px;
    width: auto;
}

.branded-header {
    background: var(--brand-color, #6366f1);
}

.branded-controls .control-btn:hover {
    background: var(--brand-color, #6366f1);
}

/* Analytics Indicator */
.analytics-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(15, 23, 42, 0.9);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    color: #94a3b8;
    display: none;
    z-index: 50;
}

.analytics-badge.visible {
    display: block;
}

.analytics-badge i {
    margin-right: 6px;
    color: #22c55e;
}

/* Mobile Captions */
@media (max-width: 768px) {
    .captions-container {
        max-width: 95%;
        bottom: 100px;
    }
    
    .captions-text {
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* ==========================================
   POLLS & Q&A
   ========================================== */

.polls-panel {
    position: fixed !important;
    top: 0 !important;
    right: -400px !important;
    left: auto !important;
    bottom: auto !important;
    width: 350px !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.98) !important;
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255,255,255,0.1);
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: right 0.3s ease !important;
}

.polls-panel.open {
    right: 0 !important;
}

.polls-panel .panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.polls-panel .panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8fafc;
    margin: 0;
}

.polls-panel .panel-close {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #f8fafc;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.polls-panel .panel-close:hover {
    background: #ef4444;
    color: white;
}

.polls-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0 12px;
}

.poll-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.poll-tab:hover {
    color: #f8fafc;
}

.poll-tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}

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

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

.polls-list, .qa-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0;
}

.polls-empty, .qa-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.polls-empty i, .qa-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Poll Card */
.poll-card {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.poll-card.ended {
    opacity: 0.7;
}

.poll-question {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: #f8fafc;
}

.poll-option {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    transition: all 0.2s;
}

.poll-option:hover:not(.voted):not(.ended) {
    background: rgba(99, 102, 241, 0.2);
}

.poll-option.selected {
    background: rgba(99, 102, 241, 0.3);
    border: 1px solid #6366f1;
}

.poll-option-text {
    flex: 1;
    font-size: 13px;
}

.poll-option-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.poll-option-percent {
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    min-width: 40px;
    text-align: right;
}

.poll-option-votes {
    font-size: 11px;
    color: #64748b;
    margin-left: 8px;
}

.poll-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 11px;
    color: #64748b;
}

.poll-end-btn {
    padding: 4px 10px;
    font-size: 11px;
    background: #ef4444;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

/* Poll Form */
.poll-form {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 16px;
}

.poll-form h4 {
    font-size: 14px;
    margin-bottom: 12px;
    color: #f8fafc;
}

.poll-form input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #f8fafc;
    font-size: 13px;
    margin-bottom: 8px;
}

.poll-form input:focus {
    outline: none;
    border-color: #6366f1;
}

.poll-options {
    margin-bottom: 8px;
}

.poll-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.create-poll {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(15, 23, 42, 0.9);
    flex-shrink: 0;
}

.create-poll .btn {
    width: 100%;
}

/* Q&A */
.qa-item {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.qa-item.answered {
    border-left: 3px solid #22c55e;
}

.qa-question-text {
    font-size: 13px;
    color: #f8fafc;
    margin-bottom: 8px;
}

.qa-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
}

.qa-upvote {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 4px;
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
}

.qa-upvote:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.qa-upvote.upvoted {
    background: rgba(99, 102, 241, 0.3);
    color: #6366f1;
}

.qa-answer {
    margin-top: 10px;
    padding: 10px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 6px;
    font-size: 12px;
    color: #22c55e;
}

.qa-answer-btn {
    padding: 4px 8px;
    font-size: 11px;
    background: #6366f1;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

.qa-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.qa-form input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #f8fafc;
    font-size: 13px;
}

.qa-form input:focus {
    outline: none;
    border-color: #6366f1;
}

/* ==========================================
   PWA ENHANCEMENTS
   ========================================== */

/* Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e293b, #334155);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    display: none;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 400px;
}

.pwa-install-prompt.visible {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.pwa-install-icon {
    width: 48px;
    height: 48px;
    background: #6366f1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pwa-install-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #f8fafc;
}

.pwa-install-content p {
    font-size: 12px;
    color: #94a3b8;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
}

.pwa-install-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-install-btn.primary {
    background: #6366f1;
    color: white;
}

.pwa-install-btn.primary:hover {
    background: #818cf8;
}

.pwa-install-btn.secondary {
    background: rgba(255,255,255,0.1);
    color: #94a3b8;
}

.pwa-install-btn.secondary:hover {
    background: rgba(255,255,255,0.2);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f59e0b;
    color: #000;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    display: none;
}

.offline-indicator.visible {
    display: block;
}

.offline-indicator i {
    margin-right: 8px;
}

/* Update Available */
.update-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #22c55e;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
    z-index: 1000;
}

.update-banner.visible {
    display: flex;
}

.update-banner:hover {
    background: #16a34a;
}

/* Mobile responsive for panels */
@media (max-width: 768px) {
    .polls-panel {
        width: 100%;
        max-width: 100%;
        right: 0;
        border-radius: 16px 16px 0 0;
    }
    
    .pwa-install-prompt {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
}

/* ==========================================
   MULTI-PARTY VIDEO GRID
   ========================================== */

.videos-grid {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.video-container.multi-party .videos-grid {
    display: grid;
}

.video-container.multi-party .remote-video-wrapper {
    display: none;
}

.video-container.multi-party .local-video-wrapper {
    display: none;
}

/* Grid layouts based on participant count */
.videos-grid.participants-2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
}

/* 3 participants: 2 on top, 1 centered below */
.videos-grid.participants-3 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.videos-grid.participants-3 .grid-video:nth-child(1) {
    grid-column: 1 / 3;
}

.videos-grid.participants-3 .grid-video:nth-child(2) {
    grid-column: 3 / 5;
}

.videos-grid.participants-3 .grid-video:nth-child(3) {
    grid-column: 2 / 4;
}

/* 4 participants: 2x2 grid */
.videos-grid.participants-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* Individual video in grid */
.grid-video {
    position: relative;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    min-height: 0;
}

.grid-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0f172a;
}

.grid-video .video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.grid-video .participant-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.grid-video .video-muted-indicator {
    display: flex;
    gap: 6px;
}

.grid-video .video-muted-indicator i {
    font-size: 12px;
    color: #ef4444;
}

.grid-video.is-speaking {
    box-shadow: 0 0 0 3px #22c55e;
}

.grid-video .no-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    color: #64748b;
}

.grid-video .no-video-placeholder i {
    font-size: 48px;
    margin-bottom: 8px;
}

.grid-video .no-video-placeholder span {
    font-size: 14px;
}

/* Participant count badge */
.participant-count {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(15, 23, 42, 0.8);
    padding: 8px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #f8fafc;
    z-index: 10;
}

.participant-count i {
    color: #6366f1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .videos-grid {
        gap: 4px;
        padding: 4px;
    }
    
    /* 3 participants on mobile: stack vertically */
    .videos-grid.participants-3 {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr);
    }
    
    .videos-grid.participants-3 .grid-video:nth-child(1),
    .videos-grid.participants-3 .grid-video:nth-child(2),
    .videos-grid.participants-3 .grid-video:nth-child(3) {
        grid-column: 1;
    }
    
    /* 4 participants on mobile: 2x2 */
    .videos-grid.participants-4 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
    
    .grid-video {
        border-radius: 8px;
    }
    
    /* Mobile controls - smaller and scrollable */
    .call-controls {
        padding: 8px 4px !important;
        gap: 4px !important;
        max-width: 100vw;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
    }
    
    .call-controls .control-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        flex-shrink: 0;
    }
    
    .call-controls .control-btn i {
        font-size: 16px !important;
    }
    
    /* Hide less important buttons on mobile */
    .call-controls #btnStats,
    .call-controls #btnMirror,
    .call-controls #btnLiveStream,
    .call-controls #btnPolls {
        display: none !important;
    }
    
    /* Header adjustments */
    .call-header {
        padding: 8px 12px !important;
    }
    
    .header-left,
    .header-right {
        gap: 6px !important;
    }
    
    .encryption-badge span,
    .role-badge {
        display: none !important;
    }
}

/* ===========================================
   LIVE STREAMING
   =========================================== */

.control-btn.streaming {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
}

.control-btn.streaming i {
    color: #ef4444;
}

.control-btn .live-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 8px;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
    animation: streamPulse 1s ease infinite;
}

@keyframes streamPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

/* Stream Modal Responsive */
@media (max-width: 480px) {
    .stream-platforms {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===========================================
   SFU MODE INDICATOR
   =========================================== */

.sfu-indicator {
    position: fixed;
    top: 70px;
    right: 16px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    animation: sfuPulse 2s ease infinite;
}

.sfu-indicator i {
    font-size: 14px;
}

@keyframes sfuPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.6); }
}

.control-btn.sfu-active {
    background: rgba(99, 102, 241, 0.2) !important;
    border-color: #6366f1 !important;
}

.control-btn.sfu-active i {
    color: #6366f1;
}

/* ===========================================
   LARGE MEETINGS UI - Speaker & Gallery Views
   =========================================== */

/* View Mode Toggle */
.view-mode-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px;
    border-radius: 8px;
    z-index: 100;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.view-btn.active {
    background: #6366f1;
    color: white;
}

/* ===========================================
   SPEAKER VIEW
   =========================================== */

.speaker-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Main Speaker Area */
.main-speaker {
    flex: 1;
    position: relative;
    background: #0f172a;
    border-radius: 12px;
    margin: 8px;
    margin-bottom: 0;
    overflow: hidden;
    min-height: 0;
}

.main-speaker video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.speaker-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #64748b;
}

.avatar-circle {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #94a3b8;
}

.speaker-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    gap: 12px;
}

.speaker-name {
    font-size: 18px;
    font-weight: 600;
    color: #f8fafc;
}

.speaker-overlay .speaking-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #22c55e;
    font-size: 14px;
}

.speaker-overlay .speaking-indicator.active {
    animation: speakingPulse 1s ease infinite;
}

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

.pin-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(99, 102, 241, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===========================================
   THUMBNAILS STRIP
   =========================================== */

.thumbnails-container {
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
}

.thumbnails-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    padding: 4px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.thumbnails-strip::-webkit-scrollbar {
    display: none;
}

.thumb-scroll-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.thumb-scroll-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Thumbnail Item */
.thumbnail-item {
    position: relative;
    width: 120px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1e293b;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.thumbnail-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: #6366f1;
}

.thumbnail-item.speaking {
    border-color: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.thumbnail-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item .thumb-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    font-size: 24px;
    color: #94a3b8;
}

.thumbnail-item .thumb-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    font-size: 10px;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumbnail-item .thumb-muted {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: white;
}

.thumbnail-item .thumb-pin {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    background: rgba(99, 102, 241, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.thumbnail-item:hover .thumb-pin {
    opacity: 1;
}

/* More Participants Badge */
.more-participants {
    width: 60px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 2px dashed #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}

.more-participants:hover {
    background: rgba(99, 102, 241, 0.3);
}

/* ===========================================
   GALLERY VIEW (Paginated)
   =========================================== */

.gallery-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 8px;
}

.gallery-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    min-height: 0;
}

.gallery-item {
    position: relative;
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .gallery-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

.gallery-item .gallery-avatar i {
    font-size: 36px;
    color: #94a3b8;
}

.gallery-item .gallery-avatar span {
    font-size: 12px;
    color: #94a3b8;
}

.gallery-item .gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gallery-item .gallery-name {
    font-size: 12px;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item .gallery-icons {
    display: flex;
    gap: 6px;
}

.gallery-item .gallery-icons i {
    font-size: 10px;
    color: #94a3b8;
}

.gallery-item .gallery-icons i.muted {
    color: #ef4444;
}

.gallery-item.speaking {
    box-shadow: 0 0 0 3px #22c55e;
}

/* Gallery Pagination */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    margin-top: 8px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    color: #94a3b8;
    font-size: 14px;
}

/* ===========================================
   PARTICIPANTS PANEL (Sidebar)
   =========================================== */

.participants-panel {
    position: fixed;
    top: 0;
    right: -350px;
    width: 320px;
    height: 100vh;
    background: #1e293b;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
}

.participants-panel.open {
    right: 0;
}

.participants-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.participants-panel .panel-header h3 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.participants-search {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.participants-search input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 14px;
}

.participants-search input::placeholder {
    color: #64748b;
}

.participants-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Participant Item */
.participant-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.participant-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.participant-item.speaking {
    background: rgba(34, 197, 94, 0.1);
}

.participant-item .p-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.participant-item .p-avatar.has-video {
    padding: 2px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.participant-item .p-avatar video {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.participant-item .p-info {
    flex: 1;
    min-width: 0;
}

.participant-item .p-name {
    font-size: 14px;
    font-weight: 500;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-item .p-role {
    font-size: 11px;
    color: #6366f1;
}

.participant-item .p-status {
    display: flex;
    gap: 8px;
}

.participant-item .p-status i {
    font-size: 12px;
    color: #64748b;
}

.participant-item .p-status i.active {
    color: #22c55e;
}

.participant-item .p-status i.muted {
    color: #ef4444;
}

.participant-item .p-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.participant-item:hover .p-actions {
    opacity: 1;
}

.participant-item .p-action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
}

.participant-item .p-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

/* ===========================================
   LOCAL VIDEO IMPROVEMENTS
   =========================================== */

.local-video-wrapper {
    position: absolute !important;
    bottom: 100px !important;
    right: 16px !important;
    width: 180px !important;
    height: 135px !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 50;
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s;
}

.local-video-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.local-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.local-controls {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.local-video-wrapper:hover .local-controls {
    opacity: 1;
}

.local-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
}

.local-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.local-btn.muted {
    background: rgba(239, 68, 68, 0.8);
}

/* ===========================================
   PARTICIPANT COUNT BADGE
   =========================================== */

.participant-count {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 500;
    z-index: 100;
    cursor: pointer;
    transition: background 0.2s;
}

.participant-count:hover {
    background: rgba(0, 0, 0, 0.85);
}

.participant-count i {
    color: #6366f1;
}

/* ===========================================
   RESPONSIVE - Large Meetings
   =========================================== */

@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
    
    .thumbnail-item {
        width: 100px;
        height: 56px;
    }
}

@media (max-width: 768px) {
    .view-mode-toggle {
        top: 8px;
        left: 8px;
    }
    
    .view-btn {
        width: 32px;
        height: 32px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
    
    .thumbnail-item {
        width: 80px;
        height: 45px;
    }
    
    .thumbnails-container {
        padding: 6px;
    }
    
    .local-video-wrapper {
        width: 120px !important;
        height: 90px !important;
        bottom: 90px !important;
        right: 8px !important;
    }
    
    .participants-panel {
        width: 100%;
        right: -100%;
    }
    
    .main-speaker {
        margin: 4px;
    }
    
    .speaker-name {
        font-size: 14px;
    }
    
    .avatar-circle {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
    
    .thumbnail-item {
        width: 70px;
        height: 40px;
    }
    
    .participant-count {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Hide legacy elements in large meeting mode */
.video-container.large-meeting .remote-video-wrapper {
    display: none !important;
}

.video-container.large-meeting .videos-grid {
    display: none !important;
}

/* ===========================================
   RECORDING DOWNLOAD PROMPT
   =========================================== */

.recording-download-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.recording-download-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.recording-download-card i {
    font-size: 48px;
    color: #22c55e;
    margin-bottom: 16px;
}

.recording-download-card h4 {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #f8fafc;
}

.recording-download-card p {
    color: #94a3b8;
    margin: 0 0 24px 0;
}

.download-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-download {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-dismiss {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

/* Recording quality indicator */
.recording-quality-badge {
    position: absolute;
    top: 50px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #94a3b8;
    display: none;
}

.recording-quality-badge.active {
    display: block;
}
