@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   Drone Video Mapper - Apple-Style Bento Box Design System & Glassmorphism
   ========================================================================== */

:root {
    /* Deep Cosmic & Surface Palette */
    --bg-dark: #09090b;
    --bg-dark-base: #07090e;
    --bg-gradient: radial-gradient(circle at top left, #1a1a2e 0%, #09090b 100%);
    
    /* Apple Bento Box Geometry Tokens */
    --radius-bento: 24px;
    --radius-bento-sub: 16px;
    --radius-card-sm: 16px;
    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;

    /* Frosted Glass Surfaces */
    --panel-bg: rgba(24, 24, 27, 0.55);
    --panel-bg-hover: rgba(39, 39, 42, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-hover: rgba(255, 255, 255, 0.18);
    --panel-border-glow: rgba(16, 185, 129, 0.3);
    
    /* Elevated Glass Surfaces */
    --bento-bg: rgba(24, 24, 27, 0.55);
    --bento-bg-hover: rgba(39, 39, 42, 0.7);
    --bento-border: rgba(255, 255, 255, 0.08);
    --bento-border-hover: rgba(255, 255, 255, 0.18);
    --bento-glow: rgba(16, 185, 129, 0.25);
    
    /* Glass Depth & Shadows */
    --shadow-glass: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    --shadow-float: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --bento-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    --bento-shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    
    /* Typography & Contrast */
    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Neon Accents */
    --accent-emerald: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.4);
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.4);
    --accent-sky: #38bdf8;
    --accent-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
    
    /* HUD Overlay */
    --hud-bg: rgba(9, 9, 11, 0.75);
    --hud-border: rgba(16, 185, 129, 0.4);

    /* Micro-Animation Spring Curve */
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Blobs for Glassmorphism pop */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-dark);
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    bottom: -10%;
    right: -5%;
    animation-delay: -5s;
}

.blob-3 {
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ==========================================================================
   Bento Box Layout & Glassmorphism Components
   ========================================================================== */

/* Bento Grid Container */
.bento-container, .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    padding: 24px;
    max-width: 1800px;
    margin: 0 auto;
    min-height: 100vh;
}

/* Universal Bento Card Base & Glass Panel */
.bento-card, .glass-panel {
    background: var(--bento-bg);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-bento);
    box-shadow: var(--bento-shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s var(--ease-spring),
                box-shadow 0.35s ease,
                border-color 0.35s ease,
                background-color 0.35s ease,
                opacity 0.35s ease;
}

/* Apple Top Light Rim Highlight Bevel */
.bento-card::before, .glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.18) 30%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0.18) 70%, 
        transparent 100%
    );
    z-index: 2;
    pointer-events: none;
}

.bento-card:hover, .glass-panel:hover {
    background: var(--bento-bg-hover);
    border-color: var(--bento-border-hover);
    box-shadow: var(--bento-shadow-hover);
    transform: translateY(-4px);
}

/* Header Card (Top Row, Span 12) */
.header-card, .app-header {
    grid-column: span 12;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    min-height: 68px;
}

.brand h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff 20%, var(--accent-emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand h1::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent-glow);
    animation: pulse-glow 3s infinite;
}

.header-status, .flight-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.divider {
    height: 32px;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--panel-border), transparent);
    margin: 0 8px;
}

/* Card Header Section & Title Controls */
.card-header, .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.card-header h2, .section-title h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

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

.card-icon {
    font-size: 18px;
}

/* Video Card (Span 8 Desktop) */
.video-card, .video-section {
    grid-column: span 8;
    min-height: 750px;
}

/* Map Card (Span 4 Desktop, Span 2 Rows) */
.map-card, .map-section {
    grid-column: span 4;
    grid-row: span 2;
    min-height: 600px;
}



.specs-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flight-selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flight-selector-group label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--bento-border);
    border-radius: var(--radius-bento-sub);
    padding: 14px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-emerald);
    letter-spacing: 0.5px;
}

.spec-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}



.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.shortcuts-tip {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--bento-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
}

/* Interactive Glass Buttons */
.glass-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-bento-sub);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.glass-btn:active {
    transform: translateY(1px) scale(0.98);
}

.glass-btn.primary {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--accent-emerald);
}

.glass-btn.primary:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent-emerald);
    box-shadow: 0 0 20px var(--accent-glow);
}

.glass-btn.accent {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--accent-blue);
}

.glass-btn.accent:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue-glow);
}

.glass-btn.icon-only {
    padding: 6px 10px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1;
}

.glass-btn.icon-only.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    box-shadow: 0 0 12px var(--accent-glow);
}

.glass-input {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-bento-sub);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
}

.glass-input:hover, .glass-input:focus {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

/* Beautiful Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
}

.badge-secondary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

/* Video Player Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: #000;
    border-radius: var(--radius-bento-sub);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

#drone-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Hide native video fullscreen button to force use of custom PiP logic */
video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

/* Telemetry HUD Bottom Bar */
.hud-panel {
    background: var(--hud-bg);
    border: 1px solid var(--hud-border);
    border-radius: var(--radius-bento-sub);
    padding: 12px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(16, 185, 129, 0.1);
    z-index: 10;
    transition: all 0.3s var(--ease-spring);
}

.hud-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 20px;
    border-right: 1px solid rgba(16, 185, 129, 0.3);
}

.hud-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-emerald);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.hud-status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 12px #10b981, 0 0 24px #10b981;
    animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}

.hud-grid {
    display: flex;
    flex-direction: row;
    flex: 1;
    justify-content: space-between;
    align-items: center;
}

.hud-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: 'SF Mono', Consolas, Monaco, monospace;
}

/* Smooth Drone Marker Movement */
.custom-svg-drone-marker {
    transition: transform 0.25s linear !important;
    will-change: transform;
}
.drone-marker-wrapper {
    transition: transform 0.25s linear;
    will-change: transform;
}

.hud-item.full-width {
    background: none;
    padding: 0;
    border: none;
}

.hud-item .label {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-emerald);
    opacity: 0.8;
    letter-spacing: 1px;
}

.hud-item .value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}
.hud-item.full-width .value {
    font-size: 16px;
    color: var(--accent-emerald);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Floating Video Playback Controls Bar (Milestone 6) */
.video-controls-bar,
.video-controls-overlay {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(18, 18, 22, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-bento-sub);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 15;
    transition: all 0.3s ease;
}

/* Time Display Group & Typography */
.time-display-group,
.time-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'SF Mono', Consolas, Monaco, ui-monospace, monospace;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.time-text {
    font-variant-numeric: tabular-nums;
}

.time-text.current-time,
#current-time-display {
    color: var(--accent-emerald);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.time-separator {
    color: var(--text-muted);
    margin: 0 2px;
}

.time-text.total-duration,
#duration-display {
    color: var(--text-secondary);
}

/* Scrubber Container & Interactive Range Slider */
.scrubber-container {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

#video-scrubber,
.timeline-scrubber {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(
        to right,
        var(--accent-emerald) 0%,
        var(--accent-emerald) var(--scrubber-progress, 0%),
        rgba(255, 255, 255, 0.15) var(--scrubber-progress, 0%),
        rgba(255, 255, 255, 0.15) 100%
    );
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background 0.1s linear;
}

#video-scrubber::-webkit-slider-runnable-track,
.timeline-scrubber::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: transparent;
}

#video-scrubber::-webkit-slider-thumb,
.timeline-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-emerald);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px var(--accent-emerald), 0 0 20px var(--accent-glow);
    cursor: pointer;
    margin-top: -5px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#video-scrubber::-webkit-slider-thumb:hover,
.timeline-scrubber::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 14px var(--accent-emerald), 0 0 25px var(--accent-glow);
}

#video-scrubber::-webkit-slider-thumb:active,
.timeline-scrubber::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

#video-scrubber::-moz-range-track,
.timeline-scrubber::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: transparent;
}

#video-scrubber::-moz-range-thumb,
.timeline-scrubber::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-emerald);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px var(--accent-emerald), 0 0 20px var(--accent-glow);
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#video-scrubber::-moz-range-thumb:hover,
.timeline-scrubber::-moz-range-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 14px var(--accent-emerald), 0 0 25px var(--accent-glow);
}

/* Speed Selector & Buttons */
.speed-selector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    background: rgba(24, 24, 27, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-bento-sub);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.speed-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s var(--ease-spring);
}

.speed-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.speed-btn.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3), inset 0 0 6px rgba(16, 185, 129, 0.2);
}

/* Fullscreen Overrides */
.video-card.is-fullscreen .video-controls-bar,
.video-section.is-fullscreen .video-controls-bar {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    margin-top: 0;
    background: rgba(18, 18, 22, 0.85);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

/* Map Section & Wrapper */
.map-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: var(--radius-bento-sub);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.map-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.map-view.active {
    display: block !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.map-view.hidden {
    display: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
}

#map, #map-3d {
    width: 100%;
    height: 100%;
    background: #09090b;
}

/* 3D Map Toggle Button Styling with Glowing Emerald Accent */
#map-3d-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#map-3d-toggle-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #ffffff;
    border: 1px solid var(--accent-emerald);
    box-shadow: 0 0 12px var(--accent-glow), inset 0 0 8px rgba(16, 185, 129, 0.2);
}

#map-3d-toggle-btn .btn-text {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Glassmorphic Basemap Selector */
.glass-basemap-control {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: rgba(24, 24, 27, 0.65);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-bento-sub);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.basemap-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.basemap-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.basemap-btn.active {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

/* Floating Elevation Chart Overlay */
.floating-elevation-chart {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    height: 140px;
    background: rgba(9, 9, 11, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-bento-sub);
    padding: 12px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.floating-elevation-chart:hover {
    background: rgba(9, 9, 11, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Map Polyline & Drone Marker */
.leaflet-glow-path {
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.8));
    transition: filter 0.3s ease;
}

.leaflet-glow-path:hover {
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 1));
}

.custom-svg-drone-marker {
    background: transparent !important;
    border: none !important;
    cursor: grab;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}
.custom-svg-drone-marker:active { cursor: grabbing; }

.drone-marker-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pulse-ring {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent-emerald);
    box-shadow: 0 0 16px var(--accent-glow), inset 0 0 16px var(--accent-glow);
    animation: drone-pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes drone-pulse {
    0% { transform: scale(0.8); opacity: 1; border-width: 2px; }
    100% { transform: scale(2); opacity: 0; border-width: 0px; }
}

.drone-elevation-label {
    background: rgba(9, 9, 11, 0.9);
    border: 1px solid var(--accent-emerald);
    color: #fff;
    font-family: 'SF Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 8px rgba(16, 185, 129, 0.2);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}
.drone-elevation-label::before { display: none; }

/* ==========================================================================
   HTML5 Fullscreen API Integration & Panel Fading Rules
   ========================================================================== */

.bento-card, .app-header, .glass-panel {
    transition: opacity 0.35s var(--ease-spring), transform 0.35s var(--ease-spring), box-shadow 0.35s ease, border-color 0.35s ease;
}

/* When a card is in Fullscreen mode, fade sibling panels */
#app-container.has-fullscreen-card .header-card,
#app-container.has-fullscreen-card .app-header {
    opacity: 0;
    pointer-events: none;
}

#app-container.has-fullscreen-card .bento-card:not(.is-fullscreen),
#app-container.has-fullscreen-card .glass-panel:not(.is-fullscreen) {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* Fullscreen Card Top-Layer Expansion */
.bento-card:fullscreen,
.bento-card.is-fullscreen,
.video-section:fullscreen,
.video-section.is-fullscreen,
.map-section:fullscreen,
.map-section.is-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 20px !important;
    border-radius: 0 !important;
    border: none !important;
    background: #05070c !important;
    box-shadow: none !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
}

.is-fullscreen .card-header,
.is-fullscreen .section-title {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.video-card.is-fullscreen .video-container,
.video-section.is-fullscreen .video-container,
.map-card.is-fullscreen .map-wrapper,
.map-section.is-fullscreen .map-wrapper {
    flex: 1;
    height: 100%;
    min-height: 0;
}

.map-card.is-fullscreen .floating-elevation-chart,
.map-section.is-fullscreen .floating-elevation-chart {
    bottom: 20px !important;
    left: 20px !important;
    right: 20px !important;
    height: 150px !important;
}

.video-card.is-fullscreen .hud-overlay,
.video-section.is-fullscreen .hud-overlay {
    top: 20px;
    left: 20px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Desktop Large (>= 1200px): Standard 12-column grid layout */
@media (min-width: 1200px) {
    .video-card, .video-section { grid-column: span 6; }
    .map-card, .map-section { grid-column: span 6; }
    .specs-card { grid-column: span 6; }
    .controls-card { grid-column: span 6; }
}

/* Tablet Viewport (768px to 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .bento-container, .dashboard-grid {
        padding: 16px;
        gap: 16px;
    }

    .video-card, .video-section,
    .map-card, .map-section {
        grid-column: span 12;
        min-height: 400px;
    }

    .specs-card,
    .controls-card {
        grid-column: span 6;
    }
}

/* Mobile Viewport (< 768px) */
@media (max-width: 767px) {
    .bento-container, .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }

    .header-card, .app-header,
    .video-card, .video-section,
    .map-card, .map-section,
    .specs-card,
    .controls-card {
        grid-column: span 1;
        border-radius: var(--radius-card-sm);
    }

    .header-card, .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        height: auto;
    }

    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hud-overlay {
        position: relative;
        top: 0; left: 0;
        width: 100%;
        margin-top: 12px;
    }

    .glass-basemap-control {
        top: 8px; right: 8px;
        padding: 4px;
    }

    .basemap-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}

/* ==========================================================================
   Reports Print Styles
   ========================================================================== */
@media print {
    body { 
        background: white; 
        color: black; 
        margin: 0; 
        padding: 20px;
    }
    
    .ambient-bg, .app-header, .video-card { display: none !important; }
    
    #app-container { display: none !important; }
    
    #report-template { 
        display: block !important; 
    }
    
    /* Map Card becomes the map snapshot inside report-template */
    .map-card {
        display: block !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 20px 0 30px 0 !important;
        height: 380px !important;
        min-height: 380px !important;
        position: relative !important;
    }
    
    .map-card .card-header,
    .map-card .glass-basemap-control,
    .map-card .floating-elevation-chart {
        display: none !important;
    }
    
    .map-wrapper {
        border: 2px solid #e2e8f0 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
    }
    
    .report-points { margin-top: 20px !important; }
    
    #report-map-container { display: none !important; }
}

#report-template {
    background: white;
    color: black;
    padding: 30px;
    max-width: 1000px;
    margin: 0 auto;
}
.report-header { border-bottom: 2px solid #27ae60; padding-bottom: 15px; margin-bottom: 20px; text-align: center; }
.report-header h2 { margin: 0; color: #121212; font-size: 24px; }
.report-header p { font-size: 14px; color: #555; }
.report-map-snapshot {
    width: 100%;
    background: #eee;
    margin-bottom: 30px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.report-map-snapshot img, .report-map-snapshot canvas {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}
.report-points { margin-top: 30px; }
.report-points h3 { 
    margin-bottom: 16px; 
    color: #0f172a; 
    font-family: 'Inter', sans-serif; 
    font-size: 18px; 
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #1e293b;
}
.report-table tr { page-break-inside: avoid; }
.report-table th, .report-table td {
    border: 1px solid #cbd5e1;
    padding: 12px 16px;
    text-align: left;
}
.report-table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}
.report-table tbody tr:nth-child(even) { background-color: #f1f5f9; }
.report-table tbody tr:nth-child(odd) { background-color: #ffffff; }
