/* Root Variables for Light Blue and Yellow Color Scheme */
:root {
  --primary-blue: #e3f2fd;
  --secondary-blue: #bbdefb;
  --accent-blue: #2196f3;
  --primary-yellow: #fff9c4;
  --secondary-yellow: #fff176;
  --accent-yellow: #ffc107;
  --text-primary: #1565c0;
  --text-secondary: #424242;
  --background-light: #f8fbff;
  --shadow-light: rgba(33, 150, 243, 0.1);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--background-light) 0%, var(--primary-blue) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* Header Styles */
.app-header {
  background: linear-gradient(90deg, var(--primary-blue) 0%, var(--primary-yellow) 100%);
  padding: 10px 0;
  box-shadow: 0 2px 10px var(--shadow-light);
  position: relative;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-text {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
}

.app-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  display: block;
  margin: 0 auto;
}

.app-title {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 1px;
  margin: 0 0 8px 0;
}

.app-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
  text-align: center;
}

/* Main Content */
.app-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 20px;
}

/* Map Container */
.map-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow-light);
  padding: 20px;
  position: relative;
  width: 680px; /* Fixed width: 640px map + 40px padding (20px each side) */
  margin: 0 auto;
}

.map-title {
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 15px;
  text-align: center;
  font-weight: 400;
}

#map {
  border-radius: 8px;
  border: 2px solid var(--secondary-blue);
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.15);
  width: 640px !important; /* Fixed 640px width */
  height: 640px !important; /* Fixed 640px height */
  display: block;
  margin: 0 auto;
}

/* Loader Styles */
#loader {
  color: var(--accent-yellow) !important;
  background: var(--accent-blue);
  padding: 12px;
  border-radius: 50%;
  box-shadow: 0 4px 16px var(--shadow-light);
  z-index: 1000;
}

/* Preview Image */
#prev {
  border-radius: 8px;
  border: 2px solid var(--secondary-yellow);
  box-shadow: 0 4px 16px rgba(255, 193, 7, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

#prev:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
}

/* Controls */
.map-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 10px;
}

.status-indicator {
  background: var(--primary-yellow);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--secondary-yellow);
}

/* MapLibre GL Overrides */
.maplibregl-popup-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--shadow-light);
  border: 1px solid var(--secondary-blue);
}

.maplibregl-popup-close-button {
  color: var(--accent-blue);
  font-size: 18px;
}

.maplibregl-popup-close-button:hover {
  background: var(--primary-blue);
}

/* Responsive Design */
@media (max-width: 768px) {
  .app-title {
    font-size: 2rem;
  }
  
  .app-subtitle {
    font-size: 1rem;
  }
  
  .header-content {
    padding: 0 20px;
  }
  
  .header-text {
    gap: 12px;
  }
  
  .app-logo {
    height: 80px;
  }
  
  .map-container {
    width: 660px; /* Reduced padding for smaller screens */
    margin: 20px auto;
    padding: 10px;
  }
  
  #map {
    width: 640px !important; /* Keep fixed 640px */
    height: 640px !important; /* Keep fixed 640px */
  }
  
  .app-main {
    padding: 20px 10px;
    overflow-x: auto; /* Allow horizontal scroll if needed */
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 15px;
  }
  
  .header-text {
    gap: 10px;
  }
  
  .app-title {
    font-size: 1.8rem;
  }
  
  .app-logo {
    height: 70px;
  }
  
  .map-container {
    width: 660px; /* Keep container width */
    margin: 10px auto;
    padding: 10px;
  }
  
  #map {
    width: 640px !important; /* Always 640px */
    height: 640px !important; /* Always 640px */
  }
  
  .app-main {
    padding: 10px 5px;
    overflow-x: auto; /* Allow horizontal scroll if needed */
  }
}

/* Focus and Accessibility */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--accent-blue);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mb-3 {
  margin-bottom: 1rem;
}

.pb-3 {
  padding-bottom: 1rem;
}