/* ==========================
   Основні стилі сторінки
   ========================== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  flex: 0 0 auto;
  background: #333;
  color: white;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  padding: 15px 0;       /* висота шапки */
  letter-spacing: 0.5px;
}

#map {
  flex: 1 1 auto;
  width: 100%;
  display: block;
  margin: 0;
  padding: 0;
}

footer {
  flex: 0 0 auto;
  background: #333;
  color: white;
  text-align: center;
  font-size: 14px;
  padding: 10px 0;       /* висота футера */
}

footer p {
  margin: 0;
}


/* ==========================
   Верхній блок кнопок (зліва)
   ========================== */
.top-buttons {
    position: fixed;        /* щоб залишались при прокрутці */
    top: 10px;              /* відступ від верхнього краю */
    left: 10px;             /* відступ від лівого краю */
    display: flex;          /* розташовує кнопки в ряд */
    flex-wrap: nowrap;      /* не переносяться на новий ряд */
    gap: 10px;              /* відстань між кнопками */
    z-index: 10000;         /* щоб були над картою */
}

/* Стиль кнопок */
.top-buttons button {
    padding: 10px 16px;
    font-size: 14px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.top-buttons button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.top-buttons button:active {
    background-color: #004085;
    transform: scale(0.95);
}



/* ==========================
   Popup хмарності
   ========================== */
#cloud-popup {
    position: absolute;
    top: 50px; /* трохи нижче кнопок */
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    display: none;
    z-index: 10001;
}
#cloud-popup .controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}
#cloud-popup button {
    background-color: #0078D7;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}


/* ==========================
   Elevation chart
   ========================== */
.leaflet-control-elevation {
    background-color: white;
    background-image: url('https://cdn-icons-png.flaticon.com/512/535/535130.png'); 
    background-size: 26px 26px;
    background-repeat: no-repeat;
    background-position: center;
    width: 34px;
    height: 34px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
}
.elevation-chart-container {
    width: 100%;
    max-width: 600px;    /* максимальна ширина */
    min-width: 300px;    /* мінімальна ширина */
    height: 350px;       /* початкова висота */
    min-height: 200px;   /* мінімальна висота */
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: none;
    box-sizing: border-box;
}

.elevation-chart-container.active {
    display: block;
}

/* Canvas всередині */
#elevation-chart {
    width: 100% !important;   /* займати всю ширину контейнера */
    height: 100% !important;  /* займати всю висоту контейнера */
}


/* ==========================
   Легенда та info
   ========================== */
.info.legend {
    background: grey;
    padding: 6px 8px;
    font: 14px/16px Arial, Helvetica, sans-serif;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
}
.info.legend i {
    width: 10px;
    height: 10px;
    float: left;
    margin-right: 8px;
    opacity: 0.7;
    border: 1px solid #000;
    box-sizing: border-box;
}

/* ==========================
   Tooltip погоди
   ========================== */
#weather-tooltip {
    position: absolute;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 5px;
    font-size: 14px;
    pointer-events: none; 
    display: none; 
    z-index: 1000; 
}

/* ==========================
   MODIS
   ========================== */
#modis-date-dialog button {
    margin-left: 10px;
}
#modis-date-dialog label {
    margin-right: 8px;
}

/* ==========================
   Leaflet satellite control
   ========================== */
.leaflet-control-satellite {
    background-color: white;
    background-image: url('../icons/sat.png'); 
    background-size: 24px 24px;
    background-repeat: no-repeat;
    background-position: center;
    width: 34px;
    height: 34px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
}
.leaflet-control-satellite.active {
    filter: brightness(0.8) sepia(1) hue-rotate(90deg);
}

/* ==========================
   NATO symbols
   ========================== */
.mil-symbol-btn {
    background: yellow;
    border: 1px solid #333;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 13px;
}
.mil-symbol-btn:hover {
    background: #eee;
}
.symbol-category > b {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    font-family: "Segoe UI", sans-serif;
    display: inline-block;
    margin-bottom: 4px;
}

/* ==========================
   Notification
   ========================== */
#notification {
    position: fixed;
    top: 20px;                  
    left: 50%;                  
    transform: translateX(-50%); 
    background: #323232;
    color: white;
    padding: 14px 18px 10px 18px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    max-width: 420px;
    line-height: 1.4;
    font-size: 13px;
    text-align: center;
    z-index: 2000;
    display: none;  
}
#notification.show {
    opacity: 1;
    transform: translateY(0);
}
#notification button {
    background: #ffb300;
    border: none;
    color: #222;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
    float: right;
    transition: background 0.2s ease;
}
#notification button:hover {
    background: #ffc93c;
}

/* ==========================
   Leaflet date control
   ========================== */
.leaflet-date-control {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    font-family: "Segoe UI", sans-serif;
    padding: 4px 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    pointer-events: none;
    user-select: none;
}

/* ==========================
   Responsive mobile
   ========================== */
@media (max-width: 1200px) {
    header, footer {
        padding: 10px;
        font-size: 16px;
    }
    #map {
        height: 75vh;
    }
    .top-buttons button {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 6px;
    }

    #weather-tooltip {
        font-size: 13px;
        padding: 8px;
    }
    .elevation-chart-container {
        width: 95%;
        height: 250px;
        min-height: 180px;
        padding: 4px;
    }
    #elevation-chart {
        width: 100% !important;
        height: 100% !important;
    }
}
