/* GuardianView - Mission Control Dashboard */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #12161f;
    --bg-tertiary: #1a1f2e;
    --bg-panel: #0f141f;

    --text-primary: #e4e8f0;
    --text-secondary: #8a92a8;
    --text-dim: #5a6278;

    --accent-blue: #3b8eff;
    --accent-cyan: #00d9ff;
    --accent-green: #00ff88;
    --accent-yellow: #ffd500;
    --accent-orange: #ff8c00;
    --accent-red: #ff3838;

    --border-color: #1f2637;
    --border-bright: #2d3548;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Subtle grid background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(59, 142, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 142, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Scanline effect */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.01) 50%,
        rgba(0, 0, 0, 0.02) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 2;
}

/* ===== MAIN VIDEO AREA ===== */

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
}

.video-container {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Video border pulse on critical alert */
.video-container.alert-critical {
    border-color: var(--accent-red);
    animation: borderPulseCritical 1s ease-in-out infinite;
}

.video-container.alert-high {
    border-color: var(--accent-orange);
    animation: borderPulseHigh 1.5s ease-in-out infinite;
}

@keyframes borderPulseCritical {
    0%, 100% {
        border-color: var(--accent-red);
        box-shadow: 0 0 20px rgba(255, 56, 56, 0.5), var(--shadow-lg);
    }
    50% {
        border-color: rgba(255, 56, 56, 0.6);
        box-shadow: 0 0 40px rgba(255, 56, 56, 0.7), var(--shadow-lg);
    }
}

@keyframes borderPulseHigh {
    0%, 100% {
        border-color: var(--accent-orange);
        box-shadow: 0 0 15px rgba(255, 140, 0, 0.4), var(--shadow-lg);
    }
    50% {
        border-color: rgba(255, 140, 0, 0.6);
        box-shadow: 0 0 30px rgba(255, 140, 0, 0.6), var(--shadow-lg);
    }
}

/* Flash overlay for critical alerts */
.video-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 56, 56, 0.6);
    pointer-events: none;
    opacity: 0;
    z-index: 8;
}

.video-container.flash-critical::after {
    animation: flashOverlayCritical 0.5s ease-out;
}

.video-container.flash-high::after {
    animation: flashOverlayHigh 0.5s ease-out;
}

@keyframes flashOverlayCritical {
    0% {
        opacity: 0;
    }
    30% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
    }
}

@keyframes flashOverlayHigh {
    0% {
        opacity: 0;
    }
    30% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
    }
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Camera Inactive Overlay */
.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 26, 0.92);
    backdrop-filter: blur(8px);
    z-index: 2;
}

.video-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
}

.overlay-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.overlay-content p {
    font-size: 16px;
    color: var(--text-secondary);
}

.overlay-content strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* ===== HUD OVERLAY ===== */

.hud-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.hud-corner {
    position: absolute;
    padding: 20px;
}

.hud-top-left { top: 0; left: 0; }
.hud-top-right { top: 0; right: 0; }
.hud-bottom-left { bottom: 0; left: 0; }
.hud-bottom-right { bottom: 0; right: 0; }

/* Profile Badge */
.profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(18, 22, 31, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 142, 255, 0.3);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.profile-icon {
    font-size: 20px;
}

.profile-name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(18, 22, 31, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-red);
    transition: all 0.3s ease;
}

.status-dot.connected {
    background: var(--accent-green);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.15); }
}

.status-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Safety Score Gauge */
.safety-gauge {
    min-width: 180px;
    padding: 12px 16px;
    background: rgba(18, 22, 31, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.gauge-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.gauge-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent-green);
    line-height: 1;
    margin-bottom: 8px;
    transition: color 0.5s ease;
}

.gauge-value.warning {
    color: var(--accent-yellow);
}

.gauge-value.danger {
    color: var(--accent-red);
}

.gauge-bar {
    height: 6px;
    background: rgba(90, 98, 120, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.gauge-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
}

.gauge-fill.warning {
    background: linear-gradient(90deg, var(--accent-yellow), var(--accent-orange));
}

.gauge-fill.danger {
    background: linear-gradient(90deg, var(--accent-red), var(--accent-orange));
}

/* Session Timer */
.session-timer {
    padding: 12px 16px;
    background: rgba(18, 22, 31, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.timer-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.timer-value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-cyan);
}

/* ===== ALERT BANNER ===== */

.alert-banner {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: calc(100% - 32px);
    z-index: 10;
    animation: alertSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(255, 56, 56, 0.95);
    backdrop-filter: blur(16px);
    border: 2px solid var(--accent-red);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(255, 56, 56, 0.5);
}

.alert-banner.critical .alert-content {
    background: rgba(255, 56, 56, 0.95);
    border-color: var(--accent-red);
    box-shadow: 0 8px 32px rgba(255, 56, 56, 0.5);
}

.alert-banner.high .alert-content {
    background: rgba(255, 140, 0, 0.95);
    border-color: var(--accent-orange);
    box-shadow: 0 8px 32px rgba(255, 140, 0, 0.5);
}

.alert-banner.medium .alert-content {
    background: rgba(255, 213, 0, 0.95);
    border-color: var(--accent-yellow);
    box-shadow: 0 8px 32px rgba(255, 213, 0, 0.4);
    color: #000;
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-text {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

/* ===== CONTROL BAR ===== */

.control-bar {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.control-group-left,
.control-group-right {
    display: flex;
    gap: 12px;
}

.control-group-left {
    flex: 0 0 auto;
}

.control-group-right {
    flex: 1;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.control-btn:hover:not(:disabled) {
    background: var(--bg-panel);
    border-color: var(--accent-blue);
    box-shadow: 0 0 16px rgba(59, 142, 255, 0.2);
    transform: translateY(-1px);
}

.control-btn:active:not(:disabled) {
    transform: translateY(0);
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.control-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4);
    color: #000;
    font-weight: 600;
}

.control-btn-primary {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border-color: var(--accent-green);
    color: #000;
    font-weight: 600;
}

.control-btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.control-btn-primary.active {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
    border-color: var(--accent-red);
}

.control-btn-send {
    padding: 10px 16px;
}

.btn-icon {
    font-size: 18px;
}

.btn-label {
    font-size: 13px;
}

.text-input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.text-input::placeholder {
    color: var(--text-dim);
}

.text-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(59, 142, 255, 0.2);
}

.text-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== SIDEBAR ===== */

.sidebar {
    width: 420px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
    user-select: none;
}

.section-header:hover {
    background: var(--bg-tertiary);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-toggle {
    font-size: 10px;
    color: var(--text-dim);
    transition: transform 0.3s ease;
}

.section-header.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-content {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease;
}

.section-content.collapsed {
    max-height: 0 !important;
}

/* Transcript Section */
.transcript-section {
    flex: 1;
}

.transcript-log {
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
}

.system-message,
.user-message,
.agent-message {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.system-message {
    background: rgba(59, 142, 255, 0.1);
    border-left: 3px solid var(--accent-blue);
    color: var(--text-secondary);
    font-style: italic;
    max-width: 100%;
}

.user-message {
    background: linear-gradient(135deg, rgba(59, 142, 255, 0.2), rgba(0, 217, 255, 0.1));
    border: 1px solid rgba(59, 142, 255, 0.3);
    color: var(--text-primary);
    align-self: flex-end;
    border-bottom-right-radius: var(--radius-sm);
}

.agent-message {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-bright);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: var(--radius-sm);
}

/* Incident Section */
.incident-log {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
}

.no-incidents {
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.incident-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    font-size: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: messageSlideIn 0.3s ease-out;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.incident-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.incident-item strong {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
}

.incident-item.critical {
    background: rgba(255, 56, 56, 0.08);
    border-left-color: var(--accent-red);
}

.incident-item.high {
    background: rgba(255, 140, 0, 0.08);
    border-left-color: var(--accent-orange);
}

.incident-item.medium {
    background: rgba(255, 213, 0, 0.08);
    border-left-color: var(--accent-yellow);
}

.incident-item.low {
    background: rgba(59, 142, 255, 0.08);
    border-left-color: var(--accent-blue);
}

/* Settings Section */
.settings-grid {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.setting-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-cyan);
}

.setting-select {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.setting-select:hover,
.setting-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(59, 142, 255, 0.2);
}

/* Toggle Switch */
.setting-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.setting-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-bright);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-dim);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.setting-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.setting-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    left: 22px;
    background: #fff;
}

.toggle-label {
    font-size: 13px;
    color: var(--text-primary);
}

/* Slider */
.setting-slider {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-slider::-webkit-slider-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.5);
    transform: scale(1.1);
}

.setting-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-blue);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-slider::-moz-range-thumb:hover {
    background: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.5);
    transform: scale(1.1);
}

/* ===== SCROLLBARS ===== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-bright);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* ===== RESPONSIVE ===== */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
    .sidebar {
        width: 360px;
    }

    .safety-gauge {
        min-width: 150px;
    }

    .hud-corner {
        padding: 12px;
    }

    .profile-badge,
    .connection-status,
    .safety-gauge,
    .session-timer {
        padding: 6px 12px;
    }

    .profile-name,
    .status-text {
        font-size: 10px;
    }

    .gauge-value {
        font-size: 24px;
    }

    .timer-value {
        font-size: 14px;
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .main-area {
        padding: 12px;
        gap: 12px;
    }

    .video-container {
        min-height: 50vh;
        height: auto;
        aspect-ratio: 4/3;
    }

    .sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        max-height: none;
        flex: 0 0 auto;
    }

    .section-content {
        max-height: 300px;
    }

    .transcript-log {
        max-height: 250px;
    }

    .incident-log {
        max-height: 200px;
    }

    /* Control Bar - Stack on mobile */
    .control-bar {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .control-group-left,
    .control-group-right {
        width: 100%;
        flex-direction: column;
    }

    .control-group-left {
        order: 2;
    }

    .control-group-right {
        order: 1;
    }

    .control-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    .text-input {
        width: 100%;
    }

    /* HUD Adjustments for mobile */
    .hud-corner {
        padding: 8px;
    }

    .profile-badge {
        padding: 6px 10px;
    }

    .profile-icon {
        font-size: 16px;
    }

    .profile-name {
        font-size: 9px;
    }

    .connection-status {
        padding: 6px 10px;
    }

    .status-text {
        font-size: 9px;
    }

    .status-dot {
        width: 8px;
        height: 8px;
    }

    /* Hide bottom HUD elements on mobile to reduce clutter */
    .hud-bottom-left,
    .hud-bottom-right {
        display: none;
    }

    /* Alert banner adjustments */
    .alert-banner {
        top: 8px;
        width: calc(100% - 16px);
        max-width: 100%;
    }

    .alert-content {
        padding: 10px 14px;
    }

    .alert-icon {
        font-size: 20px;
    }

    .alert-text {
        font-size: 13px;
    }

    /* Settings adjustments */
    .settings-grid {
        padding: 12px;
    }

    .control-btn-primary {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .main-area {
        padding: 8px;
        gap: 8px;
    }

    .video-container {
        border-radius: var(--radius-md);
        min-height: 40vh;
    }

    .control-bar {
        padding: 8px;
        gap: 8px;
        border-radius: var(--radius-md);
    }

    .control-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .btn-icon {
        font-size: 16px;
    }

    .btn-label {
        font-size: 12px;
    }

    /* Stack HUD elements more compactly */
    .hud-top-left,
    .hud-top-right {
        position: relative;
        display: inline-block;
    }

    .hud-overlay {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
        position: absolute;
        inset: auto;
        top: 0;
        left: 0;
        right: 0;
    }

    .profile-badge,
    .connection-status {
        padding: 4px 8px;
        font-size: 10px;
    }

    .profile-icon {
        font-size: 14px;
    }

    .profile-name,
    .status-text {
        font-size: 8px;
    }

    /* Alert adjustments for small screens */
    .alert-banner {
        top: 4px;
        width: calc(100% - 8px);
    }

    .alert-content {
        padding: 8px 12px;
        gap: 8px;
    }

    .alert-icon {
        font-size: 18px;
    }

    .alert-text {
        font-size: 12px;
    }

    /* Sidebar sections */
    .section-header {
        padding: 10px 12px;
    }

    .section-title {
        font-size: 10px;
    }

    .settings-grid {
        padding: 8px;
        gap: 12px;
    }

    .setting-label {
        font-size: 11px;
    }

    .setting-select {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Message sizing */
    .system-message,
    .user-message,
    .agent-message {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 90%;
    }

    .incident-item {
        font-size: 11px;
        padding: 8px 10px;
    }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .video-container {
        min-height: 60vh;
    }

    .sidebar {
        max-height: 50vh;
        overflow-y: auto;
    }

    .hud-bottom-left,
    .hud-bottom-right {
        display: block;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .control-btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .text-input {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .setting-select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .control-btn:hover {
        transform: none;
    }

    .control-btn:active {
        transform: scale(0.97);
    }

    /* Better touch targets for toggle switches */
    .toggle-slider {
        width: 50px;
        height: 28px;
    }

    .toggle-slider::before {
        width: 22px;
        height: 22px;
    }

    .setting-toggle input[type="checkbox"]:checked + .toggle-slider::before {
        left: 24px;
    }
}
