/* Základní styly pro mapu meteostanic */
.studiografix-map-wrapper {
  width: 100%;
  height: 500px;
  position: relative;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: visible;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Popup musí být nad elementy pod mapou */
.studiografix-map-wrapper .leaflet-popup {
  z-index: 1000;
}

/* Clip dlaždic do rohů zůstává na samotném mapovém elementu, ne na wrapperu */
#studiografix-map {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: 8px;
  overflow: hidden;
}

.meteo-map-container {
  width: 100%;
  position: relative;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f8f9fa;
}

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 8px;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Styly pro popup meteostanic */
.meteo-popup {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.meteo-popup .leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 0;
  background: #ffffff;
}

.meteo-popup .leaflet-popup-content {
  margin: 0;
  padding: 0;
  min-width: 280px;
  width: auto !important;
}

.meteo-popup h4 {
  margin: 0 0 15px 0;
  padding: 15px 15px 0 15px;
  font-size: 16px;
  color: #2c3e50;
  font-weight: 600;
  border-bottom: 2px solid #3498db;
  padding-bottom: 8px;
}

.meteo-popup .current-temp {
  padding: 0 15px;
  margin: 10px 0;
  font-size: 18px;
}

.meteo-popup .current-temp strong {
  color: #e74c3c;
  font-size: 20px;
}

.meteo-popup .temp-range,
.meteo-popup .rain-today,
.meteo-popup .wind-speed,
.meteo-popup .elevation {
  padding: 0 15px;
  margin: 8px 0;
  font-size: 14px;
  color: #34495e;
}

.meteo-popup .temp-label,
.meteo-popup .temp-range-label,
.meteo-popup .rain-label,
.meteo-popup .wind-label,
.meteo-popup .elevation-label {
  font-weight: 500;
  color: #7f8c8d;
}

.meteo-popup .station-type {
  padding: 0 15px;
  margin: 5px 0 10px 0;
  color: #7f8c8d;
  font-style: italic;
}

.meteo-popup .meteo-detail-btn {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 30px);
  margin: 15px 15px 15px 15px;
  padding: 10px 15px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  border: none;
}

.meteo-popup .meteo-detail-btn:hover {
  background: linear-gradient(135deg, #2980b9, #1f5f8b);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Jednoduchý popup */
.meteo-popup-simple {
  padding: 15px;
  text-align: center;
  min-width: 180px;
}

.meteo-popup-simple h4 {
  margin: 0 0 10px 0;
  font-size: 15px;
  color: #2c3e50;
  font-weight: 600;
}

.meteo-popup-simple p {
  margin: 8px 0;
  font-size: 14px;
  color: #34495e;
}

/* Styly pro clustery meteostanic */
.meteo-cluster {
  background-clip: padding-box;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.8);
}

.meteo-cluster div {
  width: 34px;
  height: 34px;
  margin-left: 3px;
  margin-top: 3px;
  text-align: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.meteo-cluster-small {
  background-color: rgba(52, 152, 219, 0.7);
}

.meteo-cluster-small div {
  background-color: rgba(52, 152, 219, 0.9);
}

.meteo-cluster-medium {
  background-color: rgba(230, 126, 34, 0.7);
}

.meteo-cluster-medium div {
  background-color: rgba(230, 126, 34, 0.9);
}

.meteo-cluster-large {
  background-color: rgba(231, 76, 60, 0.7);
}

.meteo-cluster-large div {
  background-color: rgba(231, 76, 60, 0.9);
}

/* Animace pro clustery */
.meteo-cluster {
  transition: all 0.3s ease;
}

.meteo-cluster:hover {
  transform: scale(1.1);
}

/* Styly pro ikony meteostanic */
.meteo-station-icon {
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.meteo-station-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Tooltip pro meteostancie */
.meteo-tooltip {
  background: rgba(44, 62, 80, 0.9);
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.meteo-tooltip::before {
  border-top-color: rgba(44, 62, 80, 0.9);
}

/* Info panel pro meteostancie */
.meteo-info-panel {
  background: rgba(255, 255, 255, 0.95);
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  font-size: 12px;
  min-width: 160px;
  backdrop-filter: blur(5px);
}

.meteo-info-panel h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #2c3e50;
  font-weight: 600;
}

.meteo-legend {
  margin: 5px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #34495e;
}

.meteo-info-panel small {
  color: #7f8c8d;
  font-style: italic;
  display: block;
  margin-top: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
  .studiografix-map-wrapper {
    height: 400px;
  }
  
  #studiografix-map {
    min-height: 350px;
  }
  
  .meteo-popup h4 {
    font-size: 15px;
  }
  
  .meteo-popup .current-temp {
    font-size: 16px;
  }
  
  .meteo-popup .current-temp strong {
    font-size: 18px;
  }
  
  .meteo-info-panel {
    padding: 8px;
    min-width: 140px;
  }
}

@media (max-width: 480px) {
  .studiografix-map-wrapper {
    height: 350px;
    border-radius: 4px;
  }

  #studiografix-map {
    min-height: 300px;
    border-radius: 4px;
  }

  .meteo-popup .leaflet-popup-content-wrapper {
    border-radius: 4px;
  }

  .meteo-popup .leaflet-popup-content {
    min-width: 260px;
    max-width: calc(100vw - 60px);
  }

  .meteo-popup .meteo-detail-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* Přizpůsobení pro Leaflet */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.leaflet-popup-tip {
  background: white;
}

/* Základní styly pro mapu */
.studiografix-map-container {
  width: 100%;
  position: relative;
  border: 1px solid #ddd;
  border-radius: 8px;
}

/* Pokročilé styly pro větší mapy */
.studiografix-map-wrapper.large {
  height: 600px;
}

.studiografix-map-wrapper.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
}

/* Loading spinner */
.map-loading::after {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================================================================
   METEO DIVICON MARKERY (sgx-mm = studiografix map meteo)
   ================================================================ */
.sgx-mm-wrap {
  background: none !important;
  border: none !important;
}

.sgx-mm {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  padding: 5px 7px 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  position: relative;
  transform: translateX(-50%) translateY(-100%) translateY(-10px);
  cursor: pointer;
  white-space: nowrap;
  min-width: 44px;
  transition: box-shadow .15s;
}
.sgx-mm:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.38);
  z-index: 9999;
}

.sgx-mm__tip {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #3b82f6;
}

.sgx-mm__ico {
  width: 20px; height: 20px;
  color: #3b82f6;
  display: block;
}
.sgx-mm__ico svg { width: 20px; height: 20px; }

.sgx-mm__temp {
  font-size: 10px;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  margin-top: 2px;
}

/* ================================================================
   OZE MARKERY
   ================================================================ */
.oze-divicon {
  background: none !important;
  border: none !important;
}

.oze-mrkr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 2px solid var(--oze-clr, #f59e0b);
  border-radius: 8px;
  padding: 5px 7px 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  position: relative;
  transform: translateX(-50%) translateY(-100%) translateY(-10px);
  cursor: pointer;
  white-space: nowrap;
  min-width: 50px;
  transition: box-shadow .15s;
}
.oze-mrkr:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.38);
  z-index: 9999;
}

/* tip/šipka dolů */
.oze-mrkr__tip {
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--oze-clr, #f59e0b);
}

.oze-mrkr__ico {
  width: 22px; height: 22px;
  color: var(--oze-clr, #f59e0b);
  display: block;
}
.oze-mrkr__ico svg { width: 22px; height: 22px; }

.oze-mrkr__kwh {
  font-size: 10px;
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  margin-top: 2px;
}

/* Barvy per typ */
.oze-mrkr--fve         { --oze-clr: #f59e0b; }
.oze-mrkr--fve .oze-mrkr__ico { color: #d97706; }

.oze-mrkr--vetrna      { --oze-clr: #0ea5e9; }
.oze-mrkr--vetrna .oze-mrkr__ico { color: #0284c7; }

.oze-mrkr--vodni       { --oze-clr: #3b82f6; }
.oze-mrkr--vodni .oze-mrkr__ico { color: #1d4ed8; }

.oze-mrkr--geotermalni { --oze-clr: #ef4444; }
.oze-mrkr--geotermalni .oze-mrkr__ico { color: #dc2626; }

/* OZE popup */
.oze-popup-wrapper .leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}
.oze-popup h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.oze-popup__typ {
  margin: 0 0 8px;
  color: #666;
}
.oze-popup__eday {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  padding: 5px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 13px;
}
.oze-popup__link {
  display: inline-block;
  background: #f59e0b;
  color: #fff !important;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}
.oze-popup__link:hover { background: #d97706; }