/* ==============================================================================
   Retkiluistelujäät - Moderni PWA & Mobiilikäyttöliittymä (pwa_style.css)
   ============================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #0284c7;
  --primary-glow: #38bdf8;
  --primary-hover: #0369a1;
  --accent-gold: #f59e0b;
  --accent-emerald: #10b981;
  --accent-danger: #ef4444;
  --accent-cyan: #06b6d4;

  --header-height: 60px;
  --bottom-nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 15px rgba(56, 189, 248, 0.25);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
}

/* App Container */
#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ==============================================================================
   1. TOP APP BAR
   ============================================================================== */
.app-header {
  height: var(--header-height);
  padding: 0 16px;
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: var(--shadow-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(0.96);
  border-color: var(--primary-glow);
}

.btn-pill {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-pill-classic {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-pill-classic:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-pill-pro {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

/* ==============================================================================
   2. SEARCH & FAVORITES STRIP
   ============================================================================== */
.sub-header-bar {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 990;
  flex-shrink: 0;
}

.search-box-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-icon-inside {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 38px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: none;
}

/* Autocomplete Dropdown */
.autocomplete-results {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.autocomplete-item:hover, .autocomplete-item.active {
  background: rgba(56, 189, 248, 0.15);
}

.autocomplete-item-title {
  font-weight: 600;
  color: var(--text-main);
}

.autocomplete-item-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Horizontal Favorites Carousel */
.favorites-carousel {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.favorites-carousel::-webkit-scrollbar {
  display: none;
}

.fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.fav-chip:hover, .fav-chip:active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-main);
  border-color: var(--primary-glow);
}

.fav-chip.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.4), rgba(56, 189, 248, 0.3));
  border-color: var(--primary-glow);
  color: #fff;
  font-weight: 600;
}

/* ==============================================================================
   3. MAIN CONTENT: MAP CONTAINER & FLOATING CONTROLS
   ============================================================================== */
.main-stage {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  background: #090d16;
  z-index: 1;
}

/* Floating Map Controls */
.map-floating-panel {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
}

.map-control-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-control-btn:hover, .map-control-btn:active {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--primary-glow);
  transform: scale(0.96);
}

/* Custom Layer Picker */
.layer-menu-popup {
  position: absolute;
  top: 60px;
  right: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 550;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}

.layer-option-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.layer-option-btn:hover, .layer-option-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--text-main);
}

.layer-option-btn.active {
  color: var(--primary-glow);
  font-weight: 600;
}

/* PWA Install Floating Banner */
.pwa-install-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 70px;
  max-width: 380px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 132, 199, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  z-index: 600;
  animation: slideDown 0.3s ease;
}

.pwa-install-text {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pwa-install-btn {
  background: #fff;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  cursor: pointer;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==============================================================================
   4. BOTTOM SELECTION & RESULT SHEET (BOTTOM SHEET)
   ============================================================================== */
.selection-bottom-sheet {
  position: absolute;
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
  left: 12px;
  right: 12px;
  max-width: 580px;
  margin: 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 700;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.3s ease;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.selection-bottom-sheet.open {
  display: flex;
}

.sheet-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sheet-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.sheet-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

/* Hierarchy Segmented Switcher (Koko järvi vs. järven osa) */
.hierarchy-segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.hierarchy-tab {
  flex: 1;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hierarchy-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Quick Action Row */
.sheet-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn-main {
  flex: 1;
  height: 44px;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  transition: all 0.2s ease;
}

.action-btn-main:hover, .action-btn-main:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
}

.action-btn-video {
  height: 44px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.fav-toggle-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-toggle-btn.is-fav {
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

/* Results Content Area */
.results-area {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.kpi-box {
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 6px;
  border-radius: var(--radius-sm);
}

.kpi-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Forecast Table Container */
.table-scroll-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.forecast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.forecast-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 8px 10px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.forecast-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.badge-ice {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-ice-open { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-ice-thin { background: rgba(14, 165, 233, 0.25); color: #7dd3fc; }
.badge-ice-safe { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-ice-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Satellite & Video Media */
.media-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-preview-img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #000;
}

.video-player {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #000;
}

/* ==============================================================================
   5. BOTTOM NAVIGATION BAR
   ============================================================================== */
.bottom-nav {
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  flex-shrink: 0;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item-icon {
  font-size: 20px;
}

.nav-item-label {
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--primary-glow);
}

.nav-item:active {
  transform: scale(0.92);
}

/* ==============================================================================
   6. MODAL DIALOGS (SSO, PRO, OPAS, SUOSIKIT)
   ============================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* SSO Login Options */
.sso-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sso-btn {
  height: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sso-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-focus);
}

.sso-btn-google { border-color: rgba(66, 133, 244, 0.4); }
.sso-btn-apple { border-color: rgba(255, 255, 255, 0.3); }

/* Pro Subscription Card */
.pro-hero-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.pro-price-tag {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-gold);
  margin: 6px 0;
}

.pro-feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pro-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.pro-feature-icon {
  color: var(--accent-gold);
  font-size: 16px;
  line-height: 1;
}

/* Guide Styles */
.guide-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-glow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guide-rule-box {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Responsive adjustments for Tablets and Desktops */
@media (min-width: 768px) {
  .sub-header-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .search-box-row {
    max-width: 400px;
    flex: 1;
  }
  .selection-bottom-sheet {
    bottom: calc(var(--bottom-nav-height) + 20px);
    left: 20px;
    right: auto;
    width: 480px;
  }
}

/* ==============================================================================
   7. HEXAGON GRID & TOOLTIP STYLING
   ============================================================================== */
.hex-tooltip {
  background: rgba(15, 23, 42, 0.94) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  line-height: 1.4 !important;
  pointer-events: none;
}

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

.map-control-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary-glow) !important;
  color: #fff !important;
  box-shadow: var(--shadow-glow) !important;
}

/* ==============================================================================
   8. IMAGE CARDS & LIGHTBOX FULLSCREEN MODAL
   ============================================================================== */
.img-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.img-card-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.img-card-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.img-card-badge:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
}

.zoomable-img {
  cursor: zoom-in;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.zoomable-img:hover {
  opacity: 0.95;
}

.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox-modal.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.lightbox-content {
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
  border: 1px solid var(--border-subtle);
}

.lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  gap: 12px;
}

.lightbox-title {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.lightbox-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==============================================================================
   9. CACHE STATUS BADGE & REFRESH BUTTON
   ============================================================================== */
.cache-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  color: #34d399;
}

.cache-status-bar.miss {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--primary-glow);
}

.btn-refresh-cache {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-refresh-cache:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
}

/* ==============================================================================
   10. FLOATING MAP TIME CONTROLLER (14 VRK ENNUSTE)
   ============================================================================== */
.map-time-controller {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 480px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  z-index: 450;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.map-time-controller.sheet-open {
  bottom: calc(52vh + 12px);
}

.time-ctrl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.time-ctrl-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-ctrl-badge {
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.time-ctrl-date {
  font-weight: 600;
  color: var(--text-main);
  font-size: 13px;
}

.time-ctrl-ice-info {
  font-size: 12px;
  color: var(--text-muted);
}

.time-ctrl-ice-info b {
  color: var(--accent-cyan);
}

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

.time-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.time-ctrl-btn:active {
  transform: scale(0.92);
  background: rgba(14, 165, 233, 0.3);
}

.time-ctrl-btn.play-btn {
  background: var(--accent-cyan);
  color: #030712;
  font-size: 15px;
  font-weight: bold;
}

.time-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  cursor: pointer;
  border: 2px solid #ffffff;
}

.time-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  cursor: pointer;
  border: 2px solid #ffffff;
}

