/* =========================================
   GENERAL RESET & BODY
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #0f0f14;
}

/* =========================================
   HEADER (IMPROVED LAYOUT WITH CLOCK)
   ========================================= */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 100%;
}

.header-text {
    grid-column: 2;
    text-align: center;
}

.header h1 {
    font-size: 26px;
    margin-bottom: 3px;
    font-weight: 600;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
}

/* IMPROVED HEADER CLOCK DESIGN */
.header-clock {
    grid-column: 3;
    justify-self: end;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    text-align: center;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-left: 50px;
}

.clock-time {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.clock-date {
    font-size: 11px;
    opacity: 0.95;
    margin-top: 2px;
    font-weight: 500;
}

/* =========================================
   MAP CONTAINER
   ========================================= */
#map {
    flex: 1;
    width: 100%;
    background: #1a1a1a;
    position: relative;
}

/* =========================================
   LOADING PROGRESS BAR (IMPROVED COLORS!)
   ========================================= */
.loading-progress-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    text-align: center;
    transition: opacity 0.3s ease;
}

.loading-progress-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-progress-bar {
    width: 450px;
    height: 14px;
    background: rgba(15, 15, 20, 0.95);
    border: 2px solid rgba(0, 229, 255, 0.5);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(0, 229, 255, 0.3);
}

.loading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00e5ff, #667eea, #764ba2, #00e5ff);
    background-size: 300% 100%;
    animation: progressGradient 2s ease infinite;
    transition: width 0.3s ease;
    border-radius: 25px;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* IMPROVED PROGRESS TEXT - MUCH BETTER VISIBILITY! */
/* =========================================
   PROGRESS TEXT — CRISP & HIGH CONTRAST
   ========================================= */
.loading-progress-text {
    margin-top: 16px;

    /* TEXT */
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;

    /* COLOR — warm white with slight cyan hint */
    color: #f5fbff;

    /* STRONG contrast without blur */
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.95),
        0 2px 6px rgba(0, 0, 0, 0.75);

    /* BACKPLATE for guaranteed readability */
    display: inline-block;
    padding: 6px 16px;
    border-radius: 10px;

    background: rgba(10, 15, 25, 0.75);
    backdrop-filter: blur(6px);

    border: 1px solid rgba(0, 229, 255, 0.25);
}

/* =========================================
   HUD (Heads-Up Display)
   ========================================= */

/* ===============================
   PREVENT TEXT SELECTION (UI)
   =============================== */

/* Disable selection globally for UI */
.hud, 
.hud * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

/* Explicitly for legend */
.legend,
.legend * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

.hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1100;
}

.hud-card, .legend, .player, .radar-modes {
    pointer-events: auto;
}

/* =========================================
   RADAR MODE BUTTONS (FIXED POSITION!)
   ========================================= */
.radar-modes {
    position: absolute;
    top: 150px;
    left: 30px;
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.mode-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(15, 15, 20, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: rgb(255, 0, 0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.mode-btn:hover {
    transform: scale(1.15);
    border-color: #ae00ff;
    box-shadow: 0 6px 25px rgba(0, 229, 255, 0.4);
    background: rgba(0, 229, 255, 0.15);
}

.mode-btn.active {
    border-color: #ae00ff;
    background: rgba(167, 211, 10, 0.945);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.973);
}

/* Tooltip on hover */
.mode-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 70px;
    background: rgba(0, 0, 0, 0.9);
    color: #00e5ff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.mode-btn:hover::after {
    opacity: 1;
}

/* עיצוב לכפתור שמירה כמו השאר */
.mode-btn-save{
  border: 2px solid rgba(255,255,255,0.12);
}

/* אפקט “הצלחה” קטן אחרי שמירה (אופציונלי) */
.mode-btn-save.saved{
  box-shadow: 0 0 0 4px rgba(34,197,94,0.25), 0 10px 30px rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

/* =========================================
   RIGHT SIDE CARDS (REMOVED STATUS TEXT!)
   ========================================= */
.hud-card {
    position: absolute;
    right: 20px;
    background: rgba(15, 15, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: white;
    padding: 15px 18px;
    border-radius: 16px;
    min-width: 240px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

/* Stacked Positioning - Aligned with Progress Bar! */
/* layerCard (middle card) centered at 50% to match progress bar */
#layerCard { 
    top: 50%;
    transform: translateY(-50%);
}

/* updateCard above layerCard with gap */
#updateCard { 
    top: 50%;
    transform: translateY(calc(-50% - 160px)); /* 160px = card height + gap */
}

/* opacityCard below layerCard with gap */
#opacityCard { 
    top: 50%;
    transform: translateY(calc(-50% + 160px)); /* 160px = card height + gap */
}

/* HUD Typography - BIGGER! */
.hud-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 10px;
    font-weight: 600;
}

.hud-value {
    font-size: 26px;
    font-weight: 700;
    color: #00e5ff;
    line-height: 1.2;
}

.hud-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hud-label {
    font-size: 15px;
    opacity: 0.85;
    font-weight: 500;
}

.hud-sub {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 6px;
}

.hud-mini {
    font-size: 16px;
    font-weight: 700;
    color: #00e5ff;
    min-width: 50px;
    text-align: left;
}

/* =========================================
   SEGMENT BUTTONS
   ========================================= */
.seg {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.seg-btn {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.seg-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.seg-btn.active {
    background: rgba(0, 229, 255, 0.25);
    border-color: #00e5ff;
    color: #00e5ff;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

/* =========================================
   IMPROVED LEGEND (BOTTOM LEFT)
   ========================================= */
.legend {
    position: absolute;
    left: 20px;
    bottom: 100px;
    background: rgba(15, 15, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
    min-width: 280px;
}

.legend-title {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.legend-gradient {
    display: flex;
    gap: 2px;
    border-radius: 8px;
    overflow: visible;
    height: 32px;
}

.legend-color {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    position: relative;
    cursor: help;
}

/* Tooltip */
/* ===============================
   REMOVE LEGEND TOOLTIPS (B3.3)
   =============================== */

.legend-color::after,
.legend-color::before {
  content: none !important;
  display: none !important;
}

.legend-color {
  cursor: pointer;
}

.legend-color.active {
  outline: 2px solid #00e5ff;
  box-shadow: 0 0 12px rgba(0,229,255,0.6);
  transform: scale(1.05);
}

.legend-color:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Disclaimer text */
.legend-note {
    margin-top: 8px;
    font-size: 11px;
    opacity: 0.65;
    text-align: center;
}

/* =========================================
   PLAYER (BOTTOM CENTER) - DYNAMIC SLIDER!
   ========================================= */
.player {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 105px;
    background: rgba(15, 15, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: min(900px, 90vw);
    height: 80px;
}

.pbtn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pbtn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: #00e5ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.pbtn:active {
    transform: translateY(0) scale(0.95);
}

.pbtn-play {
    background: rgba(0, 229, 255, 0.15);
    border-color: #00e5ff;
}

.pbtn-play:hover {
    background: rgba(0, 229, 255, 0.3);
}

/* =========================================
   GRADIENT SLIDERS (BEAUTIFUL!)
   ========================================= */
.gradient-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: linear-gradient(to right, #667eea, #764ba2, #00e5ff);
    border-radius: 10px;
    outline: none;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.gradient-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #00e5ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 3px solid white;
    transition: all 0.2s ease;
}

.gradient-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.6);
}

.gradient-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #00e5ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
    border: 3px solid white;
    transition: all 0.2s ease;
}

.gradient-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Frame slider - DYNAMIC WIDTH based on layer! */
.frame-slider {
    min-width: 450px;
    transition: min-width 0.3s ease;
}

/* When in satellite mode (8 frames), make slider shorter */
.frame-slider.satellite-mode {
    min-width: 250px;
}

/* =========================================
   FIX slider direction in RTL pages
   ========================================= */
#frameSlider {
    direction: ltr;
}

/* =========================================
   FRAME INFO (DATE + TIME ON SAME LINE, PRETTY COLORS!)
   ========================================= */
.frameInfo {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 180px;
    font-size: 14px;
    gap: 4px;
}

#frameText {
    font-weight: 700;
    color: #00e5ff;
    font-size: 16px;
    margin-bottom: 2px;
}

/* Date and Time on SAME LINE with SAME SIZE! */
.frameDateTime {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

#frameDate {
    color: #ffaa00; /* Pretty orange color for date */
}

.separator {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

#frameTime {
    color: #00e5ff; /* Cyan color for time */
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: #121217;
    color: rgba(255, 255, 255, 0.6);
    padding: 14px;
    text-align: center;
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer a {
    color: #00e5ff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer a:hover {
    opacity: 0.8;
}

/* =========================================
   LEAFLET OVERRIDES
   ========================================= */
.leaflet-control-zoom {
    display: none;
}

/* =========================================
   RESPONSIVE ADJUSTMENTS
   ========================================= */
@media (max-width: 1024px) {
    .hud-card {
        min-width: 200px;
        padding: 12px 15px;
    }
    
    .player {
        min-width: 85vw;
        gap: 12px;
        padding: 10px 18px;
    }
    
    .frame-slider {
        min-width: 300px;
    }
    
    .frame-slider.satellite-mode {
        min-width: 180px;
    }
    
    .radar-modes {
        top: 15px;
        left: 15px;
    }
    
    .mode-btn {
        width: 48px;
        height: 48px;
    }
}

.demo-banner {
  position: absolute;
  top: 10px;
  right: 20px;
  background: rgba(255, 200, 0, 0.9);
  color: #000;
  padding: 6px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  z-index: 2000;
}

.demo-banner.hidden {
  display: none;
}
