/* ==========================================================================
   AdaptNxt Playground - Premium Dark Glassmorphism Stylesheet
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    /* AdaptNXT Brand Tokens */
    --color-navy-950: #0F172A;
    --color-navy-900: #0F172A;
    --color-navy-800: #1E293B;
    --color-brand-blue: #7209B7;
    --color-brand-accent: #3A0CA3;
    --color-brand-light: #F3E8FF;
    --color-siri-orange: #FF6B35;
    --color-brand-selected: #F59C25;

    --bg-base: var(--color-navy-950);
    --bg-card: var(--color-navy-900);
    --bg-card-hover: var(--color-navy-800);
    --border-color: #1E293B;
    --border-color-active: var(--color-brand-blue);
    
    --primary: var(--color-siri-orange);
    --primary-glow: rgba(255, 107, 53, 0.15);
    
    --secondary: var(--color-brand-blue);
    --secondary-glow: rgba(114, 9, 183, 0.15);
    
    --success: hsl(145, 80%, 50%);
    --success-glow: hsla(145, 80%, 50%, 0.15);
    --warning: hsl(42, 100%, 53%);
    --error: hsl(355, 85%, 55%);
    
    --text-main: hsl(210, 25%, 96%);
    --text-muted: hsl(215, 15%, 65%);
    --text-dark: hsl(220, 20%, 15%);
    
    /* Layout Variables */
    --card-radius: 12px;
    --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Poppins', sans-serif;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.025em;
    font-weight: 700;
}

/* Ambient Background Glows */
.mesh-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    opacity: 0.1;
    background: linear-gradient(135deg, #0F172A 0%, #0F172A 50%, #1E293B 100%);
}

.glow-orb {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -2;
    opacity: 0.15;
    pointer-events: none;
}

.orb-1 {
    top: -20vw;
    right: -10vw;
    left: auto;
    background: #7209B7;
    opacity: 0.08;
    filter: blur(80px);
    border-radius: 9999px;
}

.orb-2 {
    bottom: -20vw;
    left: -10vw;
    right: auto;
    background: #3A0CA3;
    opacity: 0.05;
    filter: blur(80px);
    border-radius: 9999px;
}

/* Container & Layout */
.dashboard-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    padding-top: 80px; /* Offset for fixed header */
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100vh;
}

/* Header Design */
.adapt-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 50;
    padding: 1rem 0;
    transition: all 0.3s ease;
    background: transparent;
}
.adapt-header.scrolled {
    background: rgba(15, 23, 42, 0.95); /* Deep Navy dark theme */
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid #1E293B;
    padding: 0.75rem 0;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3.5rem;
}
.brand-logo {
    display: flex;
    align-items: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    text-decoration: none;
}
.logo-highlight {
    color: #FF6B35; /* SIRI Orange */
}
.logo-subtext {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.25rem;
}
.nav-menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.nav-item {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}
.nav-item:hover {
    color: #ffffff;
}
.nav-item.active {
    color: #FF6B35;
}
@media (max-width: 768px) {
    .nav-menu {
      display: none;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 32px;
    display: block;
    object-fit: contain;
    transition: var(--transition-smooth);
}

.logo-img:hover {
    filter: drop-shadow(0 0 8px var(--primary-glow));
    transform: scale(1.02);
}

.logo-accent {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.brand .divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
}

.app-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-title h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.badge {
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Live Heartbeat Indicator */
.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: hsla(220, 20%, 15%, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 100px;
}

.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    position: relative;
}

.status-pulse.online {
    background: var(--success);
}

.status-pulse.online::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid var(--success);
    animation: status-ping 1.5s infinite ease-out;
}

.status-pulse.offline {
    background: var(--error);
}

.status-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.system-status-indicator.online .status-text {
    color: var(--text-main);
}

/* Grid Workspace */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    flex-grow: 1;
}

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

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .adapt-header {
        position: relative !important;
        background: rgba(15, 23, 42, 0.95) !important;
        backdrop-filter: blur(8px) !important;
        border-bottom: 1px solid #1E293B !important;
        padding: 0.75rem 0 !important;
    }
    
    .adapt-header.scrolled {
        position: relative !important;
        padding: 0.75rem 0 !important;
    }
    
    .dashboard-container {
        padding-top: 16px !important;
    }

    .adapt-header .header-container {
        flex-direction: column;
        height: auto;
        padding: 0 1rem;
        gap: 0.75rem;
    }
    
    .brand-logo {
        justify-content: center;
        width: 100%;
    }
    
    .brand {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .brand .divider {
        display: none;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .header-actions button,
    .header-actions .system-status-indicator,
    .header-actions .btn-cta-gradient {
        width: 100%;
        justify-content: center;
    }
}

/* Premium Card Architecture */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: hsla(224, 20%, 30%, 0.6);
}

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

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.1px;
}

/* Icon Styles */
.icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.icon-pulse {
    animation: pulse-active 2s infinite ease-in-out;
}

.icon-green {
    color: var(--success);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}

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

.btn-primary {
    background-color: #FF6B35;
    color: #ffffff;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.btn-primary .icon {
    color: inherit;
}

.btn-primary:not(:disabled):hover {
    background-color: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

.btn-cta-gradient {
    background: linear-gradient(135deg, #7209B7 0%, #3A0CA3 100%);
    color: #ffffff;
    font-weight: 700;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cta-gradient:hover {
    filter: brightness(1.1);
    transform: scale(1.03);
}

.btn-outline {
    background: hsla(220, 20%, 15%, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-outline .icon {
    color: inherit;
}

.btn-outline:not(:disabled):hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Monitor Feed Panel */
.monitor-card {
    height: 100%;
    min-height: 480px;
}

.monitor-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    background: #030712;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    aspect-ratio: 16/9;
}

#webcam-video {
    display: none; /* Captured via Canvas API and not rendered raw to protect formatting overlays */
}

#telemetry-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Placeholder Camera Inactive Screen */
.placeholder-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 32px;
    z-index: 10;
    background: radial-gradient(circle at center, hsla(224, 25%, 8%, 0.8) 0%, hsl(224, 25%, 4%) 100%);
    transition: var(--transition-smooth);
}

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

.placeholder-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-icon.mini {
    width: 32px;
    height: 32px;
}

.placeholder-overlay h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.placeholder-overlay p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 420px;
}

/* Radar Scan Animation Effect */
.radar-scan {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 255, 229, 0) 40%, rgba(0, 255, 229, 0.08) 95%, rgba(0, 255, 229, 0.4) 100%);
    top: -100%;
    left: 0;
    pointer-events: none;
    animation: radar-beam 4s infinite linear;
}

/* Camera HUD Elements */
.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 16px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hud-overlay.active {
    opacity: 1;
}

.hud-item {
    padding: 4px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.badge-hud {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-badge {
    border-color: rgba(255, 0, 0, 0.4);
}

.blink-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: red;
    animation: blink 1s infinite steps(2, start);
}

.info-hud {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Quick Metrics Row */
.monitor-footer-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: hsla(220, 20%, 5%, 0.4);
    border-top: 1px solid var(--border-color);
}

.metric-pill {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

.metric-pill:last-child {
    border-right: none;
}

.metric-pill .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.metric-pill .value {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

/* Controls & Settings Side Column */
.control-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Styling */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

/* Dropdowns */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 9px;
    color: var(--text-muted);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-control {
    width: 100%;
    background: hsla(220, 20%, 4%, 0.6);
    border: 1px solid rgba(114, 9, 183, 0.4); /* light grayish-purple tint */
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border: 1px solid var(--color-brand-blue);
    box-shadow: 0 0 0 3px rgba(114, 9, 183, 0.15);
}

/* Sliders */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 229, 0.2);
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 100px;
    background: var(--border-color);
    outline: none;
    transition: var(--transition-smooth);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--primary);
    transition: transform 0.1s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
}

/* Toggle Switches */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

.toggle-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.toggle-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    width: 32px;
    height: 18px;
    background: var(--border-color);
    border-radius: 100px;
    position: relative;
    transition: var(--transition-smooth);
}

.checkmark::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 3px;
    left: 3px;
    transition: var(--transition-smooth);
}

.toggle-container input:checked ~ .checkmark {
    background: var(--primary);
}

.toggle-container input:checked ~ .checkmark::after {
    left: 17px;
    background: var(--text-dark);
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.toggle-container input:checked ~ .toggle-label {
    color: var(--text-main);
}

/* Active Detections Logging Window */
.detections-card {
    flex-grow: 1;
}

.active-count-badge {
    background: var(--success-glow);
    border: 1px solid var(--success);
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 100px;
}

.log-wrapper {
    height: 200px;
    overflow-y: auto;
    padding: 16px 20px;
    background: hsla(220, 20%, 4%, 0.7);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Empty log state styling */
.log-empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    text-align: center;
    color: var(--text-muted);
    gap: 8px;
}

.log-empty-state p {
    font-size: 12px;
    max-width: 300px;
}

.log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.hidden {
    display: none !important;
}

.log-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 6px;
    background: hsla(220, 20%, 8%, 0.5);
    border-left: 3px solid var(--primary);
    animation: slide-in 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Color badges corresponding to general coco dataset classes to make UI visually outstanding */
.log-item.cat-human { border-left-color: var(--primary); }
.log-item.cat-vehicle { border-left-color: var(--secondary); }
.log-item.cat-animal { border-left-color: var(--warning); }
.log-item.cat-object { border-left-color: hsl(190, 70%, 50%); }

.log-identity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-class-tag {
    font-weight: 700;
    text-transform: uppercase;
}

.log-conf-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.log-coords {
    color: var(--text-muted);
    font-size: 11px;
}

/* Footer layout */
.dashboard-footer {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: var(--bg-card);
}

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

.text-center {
    text-align: center;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes status-ping {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes radar-beam {
    0% { top: -100%; }
    50% { top: 100%; }
    100% { top: 100%; }
}

@keyframes pulse-active {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

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

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

/* ==========================================================================
   Guided Tour Styles
   ========================================================================== */
.tour-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tour-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

/* Highlight target element with a glowing neon border */
.tour-highlight {
    position: relative;
    z-index: 10002 !important;
    box-shadow: 0 0 12px var(--primary-glow) !important;
    outline: 3px solid var(--primary) !important;
    outline-offset: 4px !important;
    border-radius: 8px !important;
    pointer-events: none !important; /* Block clicks on highlighted element during tour */
}

/* Remove stacking context and overflow clips of parent cards during tour steps */
.tour-card-flat {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overflow: visible !important;
    position: static !important;
    z-index: auto !important;
}

/* Glowing Pulse Ring for targeted items */
@keyframes tour-pulse {
    0% { outline-color: var(--primary); box-shadow: 0 0 0 0px var(--primary-glow); }
    50% { outline-color: var(--secondary); box-shadow: 0 0 15px hsla(271, 91%, 65%, 0.4); }
    100% { outline-color: var(--primary); box-shadow: 0 0 0 0px var(--primary-glow); }
}

.tour-highlight-pulse {
    animation: tour-pulse 2s infinite !important;
}

/* Popover card styling - light slate grey glassmorphism for spectacular contrast */
.tour-popover {
    position: absolute;
    z-index: 10005;
    width: 320px;
    background: hsla(224, 16%, 26%, 0.98);
    border: 1px solid hsla(224, 20%, 48%, 0.5);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 255, 229, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.tour-popover.active {
    opacity: 1;
    transform: translateY(0);
}

.tour-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tour-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tour-step-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-glow);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 229, 0.2);
}

.tour-body {
    font-size: 13px;
    color: hsl(210, 25%, 90%);
    line-height: 1.5;
}

.tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.tour-btn-skip {
    background: transparent;
    border: none;
    color: hsl(215, 15%, 80%);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tour-btn-skip:hover {
    color: var(--error);
}

.tour-btn-next {
    background: var(--primary);
    color: var(--text-dark);
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 0 10px var(--primary-glow);
}

.tour-btn-next:hover {
    box-shadow: 0 0 15px var(--primary);
}

/* ==========================================================================
   Mobile Optimization & Camera Flip Styles
   ========================================================================== */

/* Sleek Floating Camera Switch Button */
.btn-camera-switch {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 107, 53, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-camera-switch:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.25), 0 0 15px var(--primary-glow);
}

.btn-camera-switch:active {
    transform: scale(0.95);
}

.btn-camera-switch .icon-switch {
    width: 22px;
    height: 22px;
    stroke-width: 2.2px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-camera-switch:hover .icon-switch {
    transform: rotate(180deg);
}

/* Mobile Media Queries */
@media (max-width: 768px) {
    /* Hide the desktop camera picker to keep UI clean and uncluttered */
    #group-select-camera {
        display: none !important;
    }
    
    /* Make the camera view long (portrait layout) by default */
    .monitor-wrapper {
        aspect-ratio: 9/16 !important;
        min-height: 520px;
        max-height: 75vh;
        border-radius: var(--card-radius);
    }
    
    /* Crop the camera preview nicely to fit the tall container, maintaining coord alignment */
    #telemetry-canvas {
        object-fit: cover !important;
    }
    
    /* Position flip button slightly higher on mobile to avoid overlapping metric pills */
    .btn-camera-switch {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    
    .btn-camera-switch .icon-switch {
        width: 20px;
        height: 20px;
    }
}
