:root {
  /* Minimalist Flat Vector Color Palette */
  --water-color: #4d759a;     /* Slate-800 for water */
  --bg-color: var(--water-color);        /* Deep slate background for the entire page */
  --land-color: #b8c3d1;      /* Slate-400 for land */
  --land-border: #475569;     /* Slate-600 for country borders */
  --graticule-color: #334155; /* Slate-700 for lat/lng grid lines */
  
  /* Flat panel variables - dark half-transparent layout (no blur) */
  --panel-bg: rgba(0, 0, 0, 0.4);      /* Translucent dark greyscale background */
  --panel-bg-local: rgba(0, 0, 0, 0.3); /* Slightly darker local section */
  --panel-border: rgba(255, 255, 255, 0.15); /* Soft white border highlight */
  --card-bg: rgba(0, 0, 0, 0.4);        /* Opaque dark slate cards */
  
  --text-primary: #f8fafc;    /* Slate-50 for primary light text */
  --text-primary-light-bg: black;   /* Black text for light background*/
  --text-secondary: #94a3b8;  /* Slate-400 for secondary light text */
  --accent-color: #3b82f6;    /* Modern blue for focus and active states */
  --danger-color: #f87171;    /* Lighter red for delete buttons on dark */
  
  /* Shadow styling */
  --twilight-fill: rgba(0, 0, 0, 0.25); /* Soft twilight overlay */
  --night-fill: rgba(0, 0, 0, 0.5);    /* Darker night overlay */
  --marker-color: #369;              /* Dark blue/green for city dots */
  --marker-glow: rgba(239, 68, 68, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Helvetica, Verdana, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Fullscreen Map Area - Changed to absolute positioning to cover whole page */
.map-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--water-color);
  z-index: 10;
}

#map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Map Elements Styling */
.land {
  fill: var(--land-color);
  stroke: var(--land-border);
  stroke-width: 0.4px;
  transition: fill 0.3s ease;
}

.graticule {
  fill: none;
  stroke: var(--graticule-color);
  stroke-width: 1px;
  /* stroke-dasharray: 2, 2; */
  opacity: 0.3;
}

.twilight-shadow {
  fill: var(--twilight-fill);
  pointer-events: none;
}

.night-shadow {
  fill: var(--night-fill);
  pointer-events: none;
}

/* City Markers */
.city-marker {
  fill: var(--marker-color);
  stroke: #ffffff;
  stroke-width: 1.5px;
  cursor: pointer;
  filter: drop-shadow(0 0 4px var(--marker-glow));
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), r 0.2s;
}

.city-marker:hover {
  transform: scale(1.4);
  r: 7px;
}

.city-marker.local-marker {
  fill: var(--accent-color);
  filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.6));
}

.city-label {
  font-size: 10px;
  font-weight: 500;
  fill: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.city-marker:hover + .city-label {
  opacity: 1;
}

/* Zoom Controls Overlay */
.zoom-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30; /* Placed above fullscreen map and dashboard overlay */
}

.zoom-btn {
  width: 36px;
  height: 36px;
  background-color: var(--panel-bg);
  border: 0 none;
  border-radius: 6px;
  font-size: 18px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s, color 0.2s, transform 0.1s;

  color: rgba(255, 255, 255, 0.75);
}

.zoom-btn:hover {
  background-color: #f1f5f9;
  color: var(--accent-color);
}

.zoom-btn:active {
  transform: scale(0.95);
}

/* Overlayed Glassmorphic Dashboard Panel */
.dashboard {
  position: absolute;
  --offset: 0;
  bottom: var(--offset);
  left: var(--offset);
  right: var(--offset);
  height: 190px;
  background-color: var(--panel-bg);
  display: flex;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: transform 0.3s ease, height 0.3s ease;
}

/* Local Time Section (Made slightly smaller) */
.local-time-section {
  width: 280px;
  border-right: 1px solid var(--panel-border);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: var(--panel-bg-local);
}

.local-time-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.local-clock, .local-weekday, .local-date {
  text-align: center;
}


.local-clock {
  font-size: 50px;
  font-weight: 400;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.local-weekday {
  margin-top: 10px;
}

.local-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 10px;
  font-weight: 400;
}

.local-timezone {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-color);
  background-color: rgba(59, 130, 246, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  align-self: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;

  display: none; /* Hide timezone info */
}

/* Custom Cities Section (Resized paddings) */
.cities-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  overflow: hidden;
}

/* Top bar: Header & Search */
.cities-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 20px;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Search Container & Autocomplete */
.search-container {
  position: relative;
  width: 280px;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 0 none;
  border-radius: 2px;
  color: var(--text-primary);

  outline: none;
  transition: background-color 0.2s, border-color 0.2s;
}

.search-input::placeholder {
  color: white;
}

.search-input:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-color);
}

.autocomplete-dropdown {
  position: absolute;
  margin-bottom: 6px;
  left: 0;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  background-color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
  z-index: 5000;
  display: none;
}

.autocomplete-item {
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.15s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.autocomplete-item .city-name {
  font-weight: 500;
  color: var(--text-primary);
}

.autocomplete-item .country-name {
  color: var(--text-secondary);
  font-size: 10px;
}

/* Horizontally Scrollable Cards List */
.cities-grid {
  flex: 1;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  align-items: stretch;
}

/* Custom Scrollbar for cities grid */
.cities-grid::-webkit-scrollbar {
  height: 5px;
}

.cities-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.cities-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.cities-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* City Card (Made smaller) */
.city-card {
  min-width: 150px;
  max-width: 175px;
  flex: 1 0 auto;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background-color: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.city-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.city-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.city-card-info {
  display: flex;
  flex-direction: column;
  max-width: calc(100% - 16px);
}

.city-card-name {
  font-family: 'Outfit', sans-serif;
  font-size: 14px; /* Reduced from 16px */
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-card-country {
  font-size: 10px; /* Reduced from 11px */
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Day/Night indicator inside cards */
.day-night-indicator {
  width: 6px; /* Reduced from 8px */
  height: 6px;
  border-radius: 50%;
  background-color: #fbbf24; /* Default sun amber */
  box-shadow: 0 0 4px #fbbf24;
  margin-top: 5px;
  flex-shrink: 0;
}

.day-night-indicator.night {
  background-color: #38bdf8; /* Moon sky-blue */
  box-shadow: 0 0 4px #38bdf8;
}

.day-night-indicator.twilight {
  background-color: #a855f7; /* Twilight Purple */
  box-shadow: 0 0 4px #a855f7;
}

/* Card Clock styling */
.city-card-clock-box {
  margin: 4px 0 2px 0; /* Reduced margin */
}

.city-card-time {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1;
}

.city-card-offset {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.city-card .delete-city-container {
  visibility: hidden;
}

.city-card:hover .delete-city-container {
  visibility: visible;
}

.delete-city-container {
  display: flex;
  justify-content: flex-end;
}

/* Delete button */
.delete-city-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
}

.delete-city-btn:hover {
  color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.2);
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
  gap: 4px;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px;
}

.empty-state-icon {
  font-size: 20px;
}

/* Toast Notification */
.toast {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background-color: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(5px);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard {
    bottom: 10px;
    left: 10px;
    right: 10px;
    flex-direction: column;
    height: auto;
    max-height: 240px; /* Cap mobile overlay height */
  }
  .local-time-section {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
    padding: 10px 14px;
    align-items: center;
    text-align: center;
  }
  .local-clock {
    font-size: 26px;
  }
  .local-date {
    margin-bottom: 4px;
  }
  .local-timezone {
    align-self: center;
  }
  .cities-section {
    padding: 10px 14px;
  }
  .cities-header {
    margin-bottom: 6px;
    gap: 8px;
  }
  .section-title {
    font-size: 14px;
  }
  .search-container {
    width: 100%;
  }
  .search-input {
    padding: 6px 10px;
    font-size: 12px;
  }
  .autocomplete-dropdown {
    bottom: auto;
    top: 100%;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}
