/* =========================================
   AgeVision AI — Premium Dark Theme
   ========================================= */

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 30, 0.85);
    --bg-card-hover: rgba(25, 25, 40, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;

    --accent-purple: #a78bfa;
    --accent-purple-dim: rgba(167, 139, 250, 0.15);
    --accent-cyan: #06b6d4;
    --accent-cyan-dim: rgba(6, 182, 212, 0.15);
    --accent-green: #34d399;
    --accent-green-dim: rgba(52, 211, 153, 0.15);
    --accent-pink: #f472b6;
    --accent-pink-dim: rgba(244, 114, 182, 0.15);
    --accent-amber: #fbbf24;
    --accent-amber-dim: rgba(251, 191, 36, 0.15);
    --accent-red: #f87171;

    --gradient-main: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
    --gradient-warm: linear-gradient(135deg, #f472b6 0%, #fbbf24 100%);
    --gradient-cool: linear-gradient(135deg, #06b6d4 0%, #34d399 100%);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(167, 139, 250, 0.3);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(167, 139, 250, 0.15);

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Ambient background effect */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(167, 139, 250, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(244, 114, 182, 0.03) 0%, transparent 50%);
    z-index: -1;
    animation: ambientDrift 20s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(-2%, -1%) rotate(3deg); }
}

.hidden {
    display: none !important;
}

/* =========================================
   LOADING OVERLAY
   ========================================= */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

.loading-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.brain-pulse {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-main);
    opacity: 0.15;
    animation: brainPulse 2s ease-in-out infinite;
}

@keyframes brainPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.1; }
    50% { transform: scale(1.3); opacity: 0.2; }
}

.loading-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.loading-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-main);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.loading-models {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

.model-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: color var(--transition-base);
}

.model-item.loaded {
    color: var(--accent-green);
}

.model-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.model-item.loaded .model-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}

.model-item.loading-active {
    color: var(--accent-purple);
}

.model-item.loading-active .model-dot {
    background: var(--accent-purple);
    animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* =========================================
   HEADER
   ========================================= */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-purple-dim);
    color: var(--accent-purple);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.logo-accent {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    border-radius: 100px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--transition-base);
}

.status-badge.active .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-badge.active {
    color: var(--accent-green);
    border-color: rgba(52, 211, 153, 0.2);
    background: var(--accent-green-dim);
}

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

.fps-display {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    font-family: var(--font-mono);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
}

.fps-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.fps-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.btn-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-glow);
}

/* =========================================
   MAIN LAYOUT
   ========================================= */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 70px);
}

/* =========================================
   VIDEO SECTION
   ========================================= */
.video-section {
    display: flex;
    flex-direction: column;
}

.video-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    aspect-ratio: 16 / 10;
    width: 100%;
}

#videoFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scaleX(-1);
}

#overlayCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1);
}

.video-controls {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.625rem;
    z-index: 10;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.camera-select-wrapper {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.camera-select {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.8125rem;
    backdrop-filter: blur(10px);
    cursor: pointer;
    outline: none;
    max-width: 200px;
}

.camera-select:focus {
    border-color: var(--accent-purple);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(167, 139, 250, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
}

.btn-accent {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.btn-accent:hover {
    background: rgba(6, 182, 212, 0.25);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    transform: translateY(-1px);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-text:hover {
    color: var(--accent-purple);
    background: var(--accent-purple-dim);
}

/* =========================================
   DASHBOARD
   ========================================= */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.dashboard::-webkit-scrollbar {
    width: 4px;
}

.dashboard::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    backdrop-filter: blur(20px);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-title svg {
    color: var(--accent-purple);
}

.badge {
    padding: 0.25rem 0.625rem;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: var(--font-mono);
    background: var(--accent-purple-dim);
    color: var(--accent-purple);
}

/* --- Detections List --- */
.detections-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.detection-card {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    animation: slideIn 0.3s var(--transition-smooth);
}

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

.detection-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--gradient-main);
    color: white;
    font-weight: 700;
}

.detection-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.detection-age {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.detection-gender {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-cyan);
}

.detection-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.detection-expression {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 100px;
    background: var(--accent-amber-dim);
    color: var(--accent-amber);
    font-size: 0.6875rem;
    font-weight: 500;
    margin-top: 0.25rem;
    width: fit-content;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.875rem 0.5rem;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* --- History List --- */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    font-size: 0.8125rem;
    animation: slideIn 0.3s ease;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glow);
}

.history-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.history-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.history-details span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.history-details span:last-child {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

/* =========================================
   SETTINGS PANEL
   ========================================= */
.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 340px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 200;
    animation: slideInRight 0.3s var(--transition-smooth);
    overflow-y: auto;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.settings-content {
    padding: 1.5rem;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.settings-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
}

.setting-range {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-glass);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-purple);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}

.setting-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-purple);
    cursor: pointer;
    border: none;
}

.setting-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-cyan);
    margin-top: 0.375rem;
}

.setting-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.8125rem;
    cursor: pointer;
    outline: none;
}

.setting-select:focus {
    border-color: var(--accent-purple);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    transition: var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition-base);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent-purple-dim);
    border-color: var(--accent-purple);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--accent-purple);
}

/* =========================================
   MODAL
   ========================================= */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    max-width: 640px;
    width: 100%;
    animation: modalIn 0.3s var(--transition-smooth);
    box-shadow: var(--shadow-lg);
}

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

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

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
}

#captureCanvas {
    width: 100%;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    margin-bottom: 1rem;
}

.modal-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.875rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    line-height: 1.8;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* =========================================
   TOAST NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.4s var(--transition-smooth);
    min-width: 280px;
}

.toast.success {
    border-color: rgba(52, 211, 153, 0.3);
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.3);
}

.toast.info {
    border-color: rgba(6, 182, 212, 0.3);
}

.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(60px); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .video-container {
        aspect-ratio: 16 / 9;
    }

    .dashboard {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header-center {
        display: none;
    }

    .logo-text {
        font-size: 1rem;
    }

    .main-layout {
        padding: 1rem;
        gap: 1rem;
    }

    .video-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .settings-panel {
        width: 100%;
    }
}
