/* =========================================================
   DroughtGuard - Andromeda-inspired Dashboard Theme (Cleaned)
   ========================================================= */

/* Root color palette */
:root {
  --bg-dark: #0e1a2b;
  --bg-sidebar: #15223b;
  --bg-card: #1f2d47;
  --bg-map: #0e1a2b;
  --accent-primary: #00d0ff;
  --accent-secondary: #1ea1f3;
  --accent-success: #09ff00;
  --accent-warning: #ffc107;
  --accent-danger: #ff6b6b;
  --text-light: #e0e8f9;
  --text-muted: #9daac2;
  --border-color: rgba(255, 255, 255, 0.08);
  --radius: 10px;
  --transition: 0.3s ease;
}

/* Global reset */
body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  margin: 0;
  overflow: hidden;
}

/* Layout grid */
.container {
  display: flex;
  height: 100vh;      /* full screen height */
  overflow: hidden;    /* keep the map fixed and only sidebar scrolls */
}

/* ------------------------------------
   Sidebar (left panel)
------------------------------------ */
.sidebar {
  width: 320px;
  background-color: var(--bg-sidebar);
  padding: 30px;
  padding-bottom: 70px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;

  /* 👇 The key scroll fix 👇 */
  overflow-y: auto;
  height: 100vh;          /* full height of viewport */
  max-height: 100vh;      /* ensures scroll area matches screen */
  box-sizing: border-box; /* prevent padding from shrinking height */

  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-card);
}

.sidebar h3,
.sidebar label {
  color: var(--text-light);
  font-weight: 600;
}

.sidebar select,
.sidebar input,
.sidebar button {
  width: 100%;
  border-radius: var(--radius);
  border: none;
  outline: none;
  padding: 0.75rem;
  background-color: var(--bg-card);
  color: var(--text-light);
  font-size: 0.9rem;
  transition: var(--transition);
}

.sidebar select:focus,
.sidebar input:focus {
  border: 1px solid var(--accent-primary);
}

/* Predict Button */
.predict-btn {
  background-color: var(--accent-primary);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 0.5rem; /* close to search bar */
  padding: 0.85rem 1rem;
  border: 1px solid black; /* thin black border */
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.predict-btn:hover {
  background-color: var(--accent-secondary);
  transform: translateY(-2px);
}

/* Instructions Box */
.instructions-panel {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem; /* sits right below the button */
  color: var(--text-light);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.instructions-panel h3 {
  color: var(--accent-primary);
  font-size: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Results box (if applicable) */
.results-panel {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  color: var(--text-light);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.results-panel h3 {
  color: var(--accent-primary);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* ------------------------------------
   Map container
------------------------------------ */
.map-container {
  flex: 1;
  position: relative;
  z-index: 1;
}

#map {
  height: 100%;
  width: 100%;
  border-left: 1px solid var(--border-color);
}

/* ------------------------------------
   Leaflet map tweaks
------------------------------------ */
.leaflet-container {
  background-color: var(--bg-map);
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text-light);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-tip {
  background: var(--bg-card);
}

/* ------------------------------------
   Legend (color key)
------------------------------------ */
.legend {
  position: absolute;
  bottom: 80px;
  right: 20px;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  z-index: 1000; /* bring forward above map */
}

.legend h4 {
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

/* ------------------------------------
   Header (navbar)
------------------------------------ */
.navbar {
  background: var(--bg-card);
  color: var(--text-light);
  padding: 1rem 2rem; /* thicker top bar */
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem; /* space between logo and brand */
}

.navbar img {
  width: 36px; /* slightly larger logo */
  border-radius: 50%;
  margin-right: 0.5rem;
}

.navbar .brand {
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-primary);
  font-size: 1.25rem;
}

.navbar .brand span {
  color: var(--text-light);
}
/* ------------------------------------
   Risk Indicators & Progress Bars
------------------------------------ */

.risk-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 0 auto 10px;
  box-shadow: 0 0 10px rgba(0, 208, 255, 0.6);
  transition: var(--transition);
}

.progress {
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
  height: 16px;
  margin-top: 0.5rem;
  width: 100%;
  position: relative;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius);
  transition: width 0.6s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Optional hover glow for interactive cards */
.forecast-card:hover .progress-bar {
  box-shadow: 0 0 10px var(--accent-primary);
}

/* ------------------------------------
   Scrollbars (dark)
------------------------------------ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}
