body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    /* No scrollbars */
    background-color: #1a1a1a;
    /* Dark bg to hide gaps */
}

/* --- CAPTURE & SNAPSHOT MODE FIXES --- */
.leaflet-snapshot-mode .leaflet-zoom-animated,
.leaflet-snapshot-mode .leaflet-marker-icon,
.leaflet-snapshot-mode .leaflet-marker-shadow,
.leaflet-snapshot-mode .leaflet-tile-container,
.leaflet-snapshot-mode .leaflet-pane,
.leaflet-snapshot-mode .leaflet-container {
    transition: none !important;
    animation: none !important;
}

.leaflet-snapshot-mode .leaflet-shadow-pane {
    display: none !important;
}

.leaflet-snapshot-mode * {
    transition-delay: 0s !important;
    transition-duration: 0s !important;
}

/* --- SNAPSHOT OVERLAY STYLES --- */
.snapshot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    /* Topmost */
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.snapshot-overlay.hidden {
    display: none !important;
}

.snapshot-overlay.square-mode {
    width: 100vh;
    height: 100vh;
    left: 50%;
    transform: translateX(-50%);
}

.snapshot-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 10px solid #1e8449;
    /* Forest Green */
    border-top: 20px solid #f1c40f;
    /* Mustard Top Accent (thickened) */
    box-sizing: border-box;
    z-index: 10;
}

.snapshot-top-bar {
    margin-top: 20px;
    /* Offset border */
    background: rgba(30, 132, 73, 1);
    /* Forest Green Opaque */
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
    border-bottom: 3px solid #f1c40f;
    /* Mustard Bottom-line for header */
}

.snapshot-top-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCI+PGNpcmNsZSBjeD0iMiIgY3k9IjIiIHI9IjEiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4wNSkiLz48L3N2Zz4=');
    opacity: 0.5;
}

.snapshot-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.snapshot-date {
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 12px;
    border-radius: 4px;
}

.snapshot-bottom-bar {
    background: #1a1a1a;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    border-top: 3px solid #f1c40f;
}

.snapshot-overlay.square-mode .snapshot-top-bar,
.snapshot-overlay.square-mode .snapshot-bottom-bar {
    padding: 10px 20px;
}

.snapshot-overlay.square-mode .snapshot-title {
    font-size: 1rem;
}

/* Adjustment Mode Controls */
.adjustment-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-confirm-capture,
.btn-cancel-capture {
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.btn-confirm-capture {
    background: #27ae60;
    color: white;
}

.btn-confirm-capture:hover {
    background: #2ecc71;
    transform: translateY(-2px);
}

.btn-cancel-capture {
    background: #e74c3c;
    color: white;
}

.btn-cancel-capture:hover {
    background: #ff5e57;
    transform: translateY(-2px);
}

/* Interactive Frame adjustment */
.snapshot-overlay.adjustment-active {
    pointer-events: none;
    /* Allow map interaction through overlay */
    background: rgba(0, 0, 0, 0.3);
    /* Dim outside but keep light */
}

.snapshot-overlay.adjustment-active .snapshot-top-bar,
.snapshot-overlay.adjustment-active .snapshot-bottom-bar,
.snapshot-overlay.adjustment-active .snapshot-border {
    pointer-events: none;
}

/* Support for hidden elements during snapshot adjustment */
.snapshot-hide-force {
    display: none !important;
}

.snapshot-branding {
    display: flex;
    align-items: center;
}

.snapshot-branding span {
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
}

.snapshot-url {
    font-family: 'Consolas', monospace;
    color: #f1c40f;
    /* Mustard URL */
    font-weight: bold;
}

/* Small Toast Override */
.swal2-popup.small-toast {
    font-size: 0.8rem !important;
    padding: 0.5em !important;
    width: auto !important;
    max-width: 300px !important;
}

.swal2-popup.small-toast .swal2-title {
    font-size: 1em !important;
    margin: 0 !important;
}

.swal2-popup.small-toast .swal2-html-container {
    font-size: 0.9em !important;
    margin: 0.2em 0 0 0 !important;
}

/* Watermark Logo */
.watermark-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    /* Below HUD but above map tiles if needed, though map is z-index 0 */
    pointer-events: none;
    /* Allow clicking through */
}

.watermark-logo {
    width: 200px;
    opacity: 0.5;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: opacity 0.3s ease;
}

.watermark-logo:hover {
    opacity: 0.9;
}

#fireMap {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    /* z-index removed to share stacking context with overlay */
}

/* Floating Control Panel */
.controls-overlay {
    position: absolute;
    top: 20px;
    left: 0;
    z-index: 1000;
    background: rgba(241, 248, 233, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 15px 20px;
    border-radius: 0 12px 12px 0;
    box-shadow: 4px 0 30px rgba(30, 92, 48, 0.2);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 250px;
    border-left: 5px solid #1e5c30;
    color: #2c3e50;
    font-family: 'Inter', sans-serif;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    /* Open by default */
    pointer-events: none;
    /* Let clicks pass through empty areas */
}

.controls-overlay>* {
    pointer-events: auto;
    /* Re-enable clicks on children */
}

.controls-overlay.collapsed {
    transform: translateX(-100%);
    /* Hide off-screen */
}

.toggle-handle {
    position: absolute;
    right: -42px;
    /* Poke out to the right */
    top: 20px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #1e5c30 0%, #27ae60 100%);
    color: white;
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 4px 0 15px rgba(30, 92, 48, 0.3);
    border-right: 2px solid #f1c40f;
    border-top: 2px solid #f1c40f;
    border-bottom: 2px solid #f1c40f;
}

.controls-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.controls-title h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

.controls-title p {
    margin: 0;
    font-size: 0.75rem;
    color: #7f8c8d;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn {
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-home {
    background-color: #34495e;
    color: white;
}

.btn-home:hover {
    background-color: #2c3e50;
}

.btn-refresh {
    background-color: #e74c3c;
    color: white;
    flex-grow: 1;
    justify-content: center;
}

.btn-refresh:hover {
    background-color: #f1c40f;
    color: #1e293b;
}

.btn-config {
    background-color: #f1f2f6;
    color: #7f8c8d;
}

.btn-config:hover {
    background-color: #dfe4ea;
    color: #2f3542;
}

.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #27ae60;
    color: white;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Control Buttons in Overlay */
.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: #2c3e50;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    margin-bottom: 10px;
    position: relative;
    z-index: 1002;
    /* Above overlay */
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(30, 92, 48, 0.2);
    background: #f1f8e9;
    color: #1e5c30;
}

/* Leaflet Customization */
.leaflet-control-layers {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
    z-index: 2000 !important;
    /* Ensure visibility */
}

.leaflet-top,
.leaflet-bottom {
    z-index: 1500 !important;
    /* Ensure controls are above map/overlay if issues arise */
}

.btn-filter {
    background: #fff;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: #f8f9fa;
}

.btn-filter.active {
    background: #1e5c30;
    color: white;
    border-color: #1e5c30;
    box-shadow: 0 4px 10px rgba(30, 92, 48, 0.3);
}

/* Timeline Slider Styles */
.timeline-control {
    position: absolute;
    bottom: 30px;
    /* Floating again */
    left: 50%;
    width: 80%;
    max-width: 800px;
    background: rgba(241, 248, 233, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid #1e5c30;
    padding: 15px 25px;
    /* Revert padding */
    border-radius: 50px;
    /* Revert to Pill */
    box-shadow: 0 10px 30px rgba(30, 92, 48, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* State: Hidden (pushed down and transparent) */
    transform: translate(-50%, 150%);
    opacity: 0;
    pointer-events: none;
}

.timeline-control.active {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: all;
}

/* New Trigger Button (Visible when timeline is hidden) */
.timeline-trigger {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 999;
    cursor: pointer;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.timeline-trigger:hover {
    transform: translateX(-50%) translateY(-2px);
    background: #1e5c30;
    color: white;
    box-shadow: 0 6px 20px rgba(30, 92, 48, 0.3);
}

.timeline-trigger.hidden {
    transform: translate(-50%, 100%);
    opacity: 0;
    pointer-events: none;
}

/* Satellite Date Badge */
.sat-date-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s;
}

.sat-date-badge.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.sat-date-badge i {
    color: #3498db;
}

/* Distance Measurement Badge */
.distance-badge {
    position: absolute;
    top: 80px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #1e5c30 0%, #27ae60 100%);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(30, 92, 48, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    transition: all 0.3s;
    border: 1px solid #f1c40f;
}

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

.distance-badge i {
    color: white;
}

.clear-measure-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-measure-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Active measurement button state */
.control-btn.measuring {
    background: #2ecc71 !important;
    color: white !important;
    transform: scale(1.05);
}

/* Minimize Button on the Timeline itself */
.btn-minimize {
    background: none;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.btn-minimize:hover {
    color: #e74c3c;
}

.play-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.4);
    flex-shrink: 0;
}

.play-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.range-container {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.time-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Custom Range Input */
input[type=range] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #e74c3c;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #ddd;
    border-radius: 2px;
}

.current-date-display {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2c3e50;
    min-width: 140px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* --- PREMIUM ZONES STYLE --- */
.zone-path {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

/* 3D Elevation Effect for Selected Zone */
.zone-path-3d {
    filter: drop-shadow(8px 12px 15px rgba(0, 0, 0, 0.6));
    stroke-width: 5px !important;
    stroke: #ffffff !important;
    fill-opacity: 0.4 !important;
    stroke-dasharray: 0;
    pointer-events: auto;
    z-index: 2000;
}

/* Pseudo-3D Inner Glow for the selected zone */
@keyframes zone-glow {
    from {
        filter: drop-shadow(8px 12px 15px rgba(0, 0, 0, 0.6)) brightness(1);
    }

    to {
        filter: drop-shadow(8px 12px 20px rgba(0, 0, 0, 0.8)) brightness(1.2);
    }
}

.zone-path-3d {
    animation: zone-glow 2s infinite alternate;
}

/* --- PREMIUM TOOLTIP STYLE (Glassmorphism) --- */
.leaflet-tooltip.zone-tooltip {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-left: 3px solid #f1c40f !important;
    color: #fff !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-tooltip-top.zone-tooltip::before {
    border-top-color: rgba(15, 23, 42, 0.9) !important;
}

.leaflet-tooltip-bottom.zone-tooltip::before {
    border-bottom-color: rgba(15, 23, 42, 0.9) !important;
}

/* Neon Glow Configuration for SVG Paths */
/* --- NEON & SCANNING EFFECT --- */
.zone-path {
    /* Neon Glow - Solid Line Style */
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6)) drop-shadow(0 0 4px rgba(251, 191, 36, 0.4));
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

@keyframes dash-scan {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Active Alert Overrides */
.zone-alert-poly {
    stroke: #ff3333 !important;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.8)) drop-shadow(0 0 15px rgba(255, 0, 0, 0.6)) !important;
    animation: pulse-red 2s infinite, dash-scan 30s linear infinite !important;
    /* Faster scan on alert */
    stroke-width: 3px !important;
    fill: #ff0000 !important;
    fill-opacity: 0.1 !important;
}

/* --- PREMIUM BADGE LABELS (REDESIGNED V2) --- */
.zone-pin-marker {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    z-index: 1000 !important;
}

.pin-content {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* PREMIUM TAG STYLE (Robust & Legible) */
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;

    /* Shape */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 6px !important;
    /* Slight rounded rectangle, tag-like */

    /* Layout */
    padding: 4px 8px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;

    /* Logic */
    transform: translate(-50%, -50%) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    /* Click through to polygon */
    transition: all 0.3s ease !important;
}

.pin-content:hover {
    /* No hover effect on text itself, resizing logic handled by marker if needed */
    transform: translate(-50%, -50%) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pin-icon {
    display: none !important;
    /* Hide dot, use border accent instead for cleaner look */
}

.pin-label {
    color: rgba(255, 255, 255, 0.95) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-shadow: none !important;
    /* Background provides contrast now */
    margin: 0 !important;
    line-height: 1 !important;
}

/* Highlight on hover of the polygon (handled via JS adding class to marker?) 
   Currently no direct link, but we can make it brighten if active */
.zone-alert-pin .pin-label {
    color: #ffcccc !important;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8) !important;
    opacity: 1 !important;
}

/* ACTIVE ALERT STATE */
.zone-alert-pin .pin-content {
    background: rgba(220, 38, 38, 0.9) !important;
    border-left-color: #fff !important;
    border: 1px solid rgba(255, 200, 200, 0.4) !important;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6) !important;
    animation: pulse-badge-v2 2s infinite !important;
}

@keyframes pulse-badge-v2 {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }

    70% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.zone-alert-pin .pin-label {
    font-weight: 700 !important;
}

/* Loading Overlay for GIBS Tiles */
.gibs-loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 30px 50px;
    border-radius: 16px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    text-align: center;
}

.gibs-loading-overlay.active {
    display: block;
}

.gibs-loading-overlay .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.gibs-loading-overlay .loading-text {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* --- ACTIVE FIRE ALERT STATES --- */

.zone-alert-pin .pin-content {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%) !important;
    border-color: rgba(255, 100, 100, 0.7) !important;
    box-shadow:
        0 4px 24px rgba(220, 38, 38, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 0 35px rgba(220, 38, 38, 0.5) !important;
    animation: pulse-badge 2s ease-in-out infinite !important;
}

.zone-alert-pin .pin-icon {
    background: radial-gradient(circle, #ffffff 0%, #fef2f2 100%) !important;
    box-shadow:
        0 0 15px rgba(255, 255, 255, 1),
        0 0 8px rgba(220, 38, 38, 0.9) inset !important;
    animation: ping-alert 1.5s cubic-bezier(0, 0, 0.2, 1) infinite !important;
}

.zone-alert-pin .pin-label {
    color: #ffffff !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8) !important;
}

/* Badge Pulse Animation */
@keyframes pulse-badge {
    0% {
        box-shadow:
            0 4px 24px rgba(220, 38, 38, 0.7),
            0 0 0 1px rgba(255, 255, 255, 0.12) inset,
            0 0 35px rgba(220, 38, 38, 0.5);
    }

    50% {
        box-shadow:
            0 6px 32px rgba(220, 38, 38, 0.9),
            0 0 0 1px rgba(255, 255, 255, 0.18) inset,
            0 0 45px rgba(220, 38, 38, 0.7);
    }

    100% {
        box-shadow:
            0 4px 24px rgba(220, 38, 38, 0.7),
            0 0 0 1px rgba(255, 255, 255, 0.12) inset,
            0 0 35px rgba(220, 38, 38, 0.5);
    }
}

@keyframes ping-alert {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Polygon Pulse (Keep existing but refined) */
.zone-alert-poly {
    stroke: #e74c3c !important;
    stroke-width: 3px !important;
    fill: #e74c3c !important;
    fill-opacity: 0.15 !important;
    animation: pulse-poly 2s infinite;
}

@keyframes pulse-poly {
    0% {
        stroke-opacity: 0.7;
    }

    50% {
        stroke-opacity: 1;
        stroke-width: 4px;
    }

    100% {
        stroke-opacity: 0.7;
    }
}

/* --- ZONE DETAILS PANEL (OFFCANVAS) --- */
.zone-details-panel {
    position: fixed;
    top: 0;
    right: -420px;
    /* Hidden */
    width: 400px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 20000;
    /* Above everything */
    transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    color: #fff;
}

.zone-details-panel.active {
    right: 0;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05), transparent);
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #fbbf24;
    /* Amber accent */
    letter-spacing: 0.5px;
}

.close-panel-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.close-panel-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

.panel-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.alert {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
}

.stat-card.alert .stat-value {
    color: #feecdc;
}

.chart-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- ZONE ANALYSIS SLIDE-IN PANEL --- */
.zone-panel {
    position: fixed;
    top: 0;
    right: -400px;
    /* Hidden off-screen */
    width: 380px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.zone-panel.active {
    right: 0;
}

.close-panel-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #95a5a6;
    cursor: pointer;
    transition: color 0.2s;
}

.close-panel-btn:hover {
    color: #e74c3c;
}

.zone-panel-header {
    background: #f8f9fa;
    padding: 25px 25px 15px 25px;
    border-bottom: 1px solid #eee;
}

.zone-panel-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.4rem;
    color: #2c3e50;
    font-weight: 700;
}

.zone-panel-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
}

.panel-section {
    margin-bottom: 25px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.panel-section:last-child {
    border-bottom: none;
}

.panel-section h6 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #7f8c8d;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Weather Grid */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.weather-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
}

.w-label {
    display: block;
    font-size: 0.7rem;
    color: #95a5a6;
    margin-bottom: 4px;
}

.w-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* History Stats */
.history-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.history-stat span {
    color: #7f8c8d;
}

/* Coords Box */
.coords-box {
    background: #f1f2f6;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    color: #2c3e50;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: #3498db;
}

.btn-copy:hover {
    color: #2980b9;
}

/* Responsive Mobile */
@media (max-width: 500px) {
    .zone-panel {
        width: 100%;
        right: -100%;
    }
}

/* --- HUD PREMIUM PANEL STYLES (FOREST THEME) --- */
.hud-panel {
    background: rgba(241, 248, 233, 0.96);
    /* Light Forest Glass */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 3px solid #1e5c30;
    box-shadow: -10px 0 40px rgba(30, 92, 48, 0.15);
    color: #2c3e50;
    font-family: 'Inter', sans-serif;
}

.hud-header {
    background: linear-gradient(135deg, #1e5c30 0%, #27ae60 100%);
    border-bottom: 3px solid #f1c40f;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.neon-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    margin: 0;
}

.hud-status-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    font-weight: 600;
}

.hud-body {
    padding: 20px;
}

.hud-section {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(30, 92, 48, 0.1);
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.hud-section.no-border {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.hud-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #1e5c30;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

/* --- CIRCULAR GAUGES --- */
.hud-gauges-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.hud-gauge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 33%;
}

.hud-gauge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* Conic Gradient for Progress Ring */
    background: conic-gradient(#1e5c30 calc(var(--percentage) * 1%),
            rgba(39, 174, 96, 0.2) 0);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

/* Orange Gauge overrides standard */
#gaugeTemp.hud-gauge {
    background: conic-gradient(#f1c40f calc(var(--percentage) * 1%),
            rgba(241, 196, 15, 0.2) 0);
}

.gauge-center {
    width: 50px;
    height: 50px;
    background: #f1f8e9;
    /* Match Panel BG */
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-value {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    color: #1e5c30;
}

.gauge-unit {
    font-size: 0.6rem;
    color: #27ae60;
    font-weight: 700;
}

.gauge-label {
    font-size: 0.7rem;
    color: #555;
    text-transform: uppercase;
    font-weight: 600;
}

/* --- HUD STATS & BARS --- */
.hud-stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.hud-stat-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 10px;
    flex: 1;
    text-align: center;
    border: 1px solid rgba(30, 92, 48, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.hud-stat-box.alert-box {
    border-color: rgba(231, 76, 60, 0.4);
    background: rgba(231, 76, 60, 0.05);
}

.hud-stat-label {
    display: block;
    font-size: 0.65rem;
    color: #666;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

.hud-stat-value {
    font-size: 1.1rem;
    color: #1e5c30;
    font-weight: 800;
}

.hud-stat-box.alert-box .hud-stat-value {
    color: #c0392b;
}

.hud-bars-visual {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 60px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 10px 10px 20px 10px;
    /* Space for labels */
    position: relative;
    border: 1px solid rgba(30, 92, 48, 0.1);
}

.hud-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 20%;
    justify-content: flex-end;
    position: relative;
}

.hud-bar {
    width: 100%;
    background: #dcedc8;
    border-radius: 3px 3px 0 0;
    transition: height 1s ease;
    min-height: 2px;
}

.hud-bar.active {
    background: #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

.hud-bar.alert {
    background: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
}

.hud-bar-label {
    position: absolute;
    bottom: -18px;
    font-size: 0.6rem;
    color: #555;
    font-weight: 700;
}

/* --- FOOTER GRID --- */
.hud-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.data-cell {
    background: rgba(255, 255, 255, 0.8);
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #1e5c30;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.data-label {
    display: block;
    font-size: 0.6rem;
    color: #666;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.data-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: #2c3e50;
}

.hud-coords-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: #1e5c30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(30, 92, 48, 0.2);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.btn-copy-hud {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.btn-copy-hud:hover {
    color: #1e5c30;
}

.btn-hud-action {
    background: linear-gradient(135deg, #1e5c30 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(30, 92, 48, 0.3);
    transition: all 0.3s;
}

.btn-hud-action:hover {
    background: linear-gradient(135deg, #144021 0%, #1e5c30 100%);
    box-shadow: 0 6px 20px rgba(30, 92, 48, 0.4);
    transform: translateY(-2px);
}

/* --- MINIMALIST SUBSCRIPTION MODAL --- */
.swal-minimalist-popup {
    border-radius: 12px !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

.swal-minimalist-banner {
    width: 100%;
    height: 120px;
    background-image: url('../img/social_share_monitoreo.png');
    background-size: cover;
    background-position: center;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid #1e5c30;
}

.swal-minimalist-content {
    padding: 30px 40px !important;
    text-align: left !important;
}

.swal-minimalist-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 8px !important;
}

.swal-minimalist-subtitle {
    font-size: 0.95rem !important;
    color: #64748b !important;
    margin-bottom: 25px !important;
}

.swal-minimalist-label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.swal-minimalist-input {
    width: 100% !important;
    border: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    border-radius: 0 !important;
    padding: 10px 0 !important;
    font-size: 1rem !important;
    transition: border-color 0.3s !important;
    margin-bottom: 25px !important;
    background: transparent !important;
}

.swal-minimalist-input:focus {
    outline: none !important;
    border-bottom-color: #1e5c30 !important;
    box-shadow: none !important;
}

.swal-minimalist-zones {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 8px;
    padding: 5px;
}

.zone-item-minimal {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.zone-item-minimal:hover {
    background: #ecfdf5;
}

.zone-item-minimal input {
    margin-right: 12px;
    accent-color: #1e5c30;
}

.zone-item-minimal label {
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
    margin: 0;
}

.swal-minimalist-confirm {
    background: #1e5c30 !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    box-shadow: 0 4px 6px -1px rgba(30, 92, 48, 0.2) !important;
}

.swal-minimalist-cancel {
    background: transparent !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    padding: 12px 20px !important;
}

.swal-minimalist-cancel:hover {
    color: #64748b !important;
    text-decoration: underline !important;
}

/* --- TOURISM PREMIUM MARKERS --- */
.tourism-marker-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.tourism-marker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tourism-marker-icon {
    width: 24px;
    height: 24px;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.5);
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tourism-marker-pulse {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.4);
    z-index: 1;
    animation: tourism-pulse 2s infinite;
}

@keyframes tourism-pulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    70% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(3.0); opacity: 0; }
}

.tourism-marker-container:hover .tourism-marker-icon {
    transform: scale(1.2) translateY(-2px);
    background: #2563eb;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.6);
}

.active-marker .tourism-marker-icon {
    background: #f1c40f !important;
    color: #1a5c2e !important;
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.8);
    border-color: #fff !important;
}

.active-marker .tourism-marker-pulse {
    background: rgba(241, 196, 15, 0.5) !important;
    animation-duration: 1.2s;
}

/* --- WIND PROJECTION STYLES --- */
.control-btn.active#windBtn {
    background: linear-gradient(135deg, #ff7e00 0%, #e67e22 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4) !important;
    border: 1.5px solid #ffffff !important;
}

.wind-cone-aviation {
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
    stroke-dasharray: 4, 4 !important;
    fill: #ff7e00 !important;
    fill-opacity: 0.5 !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: wind-flow 3s infinite ease-in-out;
    pointer-events: auto !important;
}

@keyframes wind-flow {
    0% { fill-opacity: 0.4; }
    50% { fill-opacity: 0.7; }
    100% { fill-opacity: 0.4; }
}


/* --- SMOKE PARTICLE FLOW --- */
.smoke-particle-stream {
    stroke-dasharray: 6, 20 !important;
    stroke-linecap: round !important;
    animation: smoke-flow linear infinite;
    filter: drop-shadow(0 0 2px white);
}

@keyframes smoke-flow {
    from { stroke-dashoffset: 200; }
    to { stroke-dashoffset: 0; }
}

.wind-tooltip {
    background: rgba(230, 126, 34, 0.95) !important;
    border: 2px solid #ffffff !important;
    color: white !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    font-size: 0.9rem !important;
}

/* --- AI TACTICAL ANALYST --- */
.ia-modal-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%) !important;
    color: #e0e7ff !important;
    border: 1px solid #6366f1 !important;
    border-radius: 16px !important;
    overflow: hidden;
}

.ia-analysis-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #818cf8;
    text-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
}

.ia-scanner-line {
    height: 2px;
    background: #6366f1;
    box-shadow: 0 0 15px #6366f1;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    animation: ia-scan 2s infinite ease-in-out;
    z-index: 10;
}

@keyframes ia-scan {
    0% { top: 0; opacity: 0; }
    50% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.ia-pulse {
    animation: ia-pulse-glow 2s infinite;
}

@keyframes ia-pulse-glow {
    0% { box-shadow: 0 0 0px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.7); }
    100% { box-shadow: 0 0 0px rgba(99, 102, 241, 0.4); }
}