/*
 * ========================================
 * STYLE.CSS - VERSION 2.0.0 (Dark Mode Fix)
 * ========================================
 * If you don't see this comment in DevTools,
 * the browser is caching an old file!
 */

/* =========================================
 *  LANDING PAGE STYLES
 *  ========================================= */

body.landing-page {
  overflow-y: auto; /* Allow scrolling on landing page */
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  color: #000000;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 20px;
  text-align: center;
}

.landing-page .hero {
  max-width: 600px;
  margin: 40px auto;
  animation: fadeIn 0.8s ease-out;
}

.landing-page h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.landing-page h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: #555;
  margin-bottom: 1.5rem;
}

.landing-page p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 2rem;
}

.landing-page .cta {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.landing-page .btn {
  display: inline-block;
  padding: 15px 30px;
  background-color: #3388ff;
  color: #ffffff;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: transform 0.2s, background-color 0.2s;
  border: none;
  cursor: pointer;
}

.landing-page .btn:hover {
  background-color: #2568d6;
  transform: translateY(-2px);
}

.landing-page .faq-link {
  color: #3388ff;
  text-decoration: none;
  font-weight: 500;
}

.landing-page .faq-link:hover {
  text-decoration: underline;
}

.landing-page .faq-section {
  max-width: 600px;
  margin: 40px auto;
  text-align: left;
  padding: 20px;
  background: rgba(0,0,0,0.03);
  border-radius: 8px;
}

.landing-page .faq-section h3 {
  margin-top: 0;
  border-bottom: 2px solid #3388ff;
  padding-bottom: 10px;
  display: inline-block;
}

.landing-page .faq-section ul {
  list-style: none;
  padding: 0;
}

.landing-page .faq-section li {
  margin-bottom: 15px;
  line-height: 1.5;
}

/* Dark Mode Support for Landing Page */
html.dark-mode body.landing-page {
  background-color: #121212;
  color: #ffffff;
}

html.dark-mode .landing-page h2,
html.dark-mode .landing-page p {
  color: #cccccc;
}

html.dark-mode .landing-page .faq-section {
  background: rgba(255,255,255,0.05);
}

html.dark-mode .landing-page .faq-section h3 {
  border-bottom-color: #ffffff;
}

html.dark-mode .landing-page .faq-link {
  color: #4da3ff;
}

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

/* Mobile Optimization */
@media (max-width: 600px) {
  .landing-page h1 { font-size: 2.2rem; }
  .landing-page h2 { font-size: 1.2rem; }
  .landing-page .cta { flex-direction: column; }
}

/* =========================================
 *  MAP STYLES
 *  ========================================= */
/* RESET */
* { box-sizing: border-box; }
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
  /* Light Mode Defaults */
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* MAP - CRITICAL FIX */
#map {
position: absolute; /* Force it to fill parent */
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
background-color: #eeeeee !important; /* Visible fallback */
}

/* UI CONTROLS */
#ui-controls {
position: absolute; /* Changed from fixed to absolute to sit on top of map */
top: 10px;
right: 10px;
z-index: 1000;
display: flex;
flex-direction: column;
gap: 10px;
pointer-events: none;
}

.icon-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #000 !important;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#timer-display {
background: rgba(0,0,0,0.8);
color: #0f0;
padding: 5px 10px;
border-radius: 4px;
font-family: monospace;
font-size: 14px;
display: none;
pointer-events: auto;
}

/* DEBUG PANEL */
#debug-panel {
position: absolute;
top: 70px;
right: 10px;
width: 200px;
background: rgba(0, 0, 0, 0.85) !important;
color: #0f0 !important;
font-family: monospace;
font-size: 11px;
padding: 8px;
border-radius: 4px;
z-index: 999;
pointer-events: none;
border: 1px solid #444;
}
#debug-panel * { pointer-events: auto; }
.debug-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.debug-label { color: #aaa !important; }
.debug-value { color: #fff !important; font-weight: bold; }
.debug-log { max-height: 100px; overflow-y: auto; border-top: 1px solid #444; margin-top: 5px; font-size: 9px; color: #ccc !important; }

/* =========================================
 *  DARK MODE - NUCLEAR OPTION
 *  ========================================= */

/* 1. Target HTML tag directly (Higher specificity than body) */
html.dark-mode {
  background-color: #121212 !important;
  color: #ffffff !important;
}

/* 2. Force Map Background */
html.dark-mode #map {
  background-color: #222222 !important;
  /* In case Leaflet sets inline styles, we try to override */
  z-index: 1 !important;
}

/* 3. Force UI Buttons */
html.dark-mode #ui-controls .icon-btn {
  background-color: #333333 !important;
  color: #ffffff !important;
  border: 1px solid #555 !important;
}

/* 4. Force Debug Panel */
html.dark-mode #debug-panel {
  background-color: #000000 !important;
  color: #00ff00 !important;
  border: 1px solid #555 !important;
}

html.dark-mode #debug-panel h4 {
  color: #ffffff !important;
  border-bottom: 1px solid #555 !important;
}

html.dark-mode .debug-label { color: #bbbbbb !important; }
html.dark-mode .debug-value { color: #ffffff !important; }

/* 5. Force Timer */
html.dark-mode #timer-display {
  background: rgba(255,255,255,0.2) !important;
  color: #00ff00 !important;
}

/* =========================================
 *  DARK MODE MAP FILTER (OPTIMIZED)
 *  ========================================= */

/*
 *  We target the main pane container.
 *  This applies the filter to EVERYTHING inside it (tiles, canvas, markers).
 *  No need for fallbacks or specific child selectors.
 */
/*html.dark-mode .leaflet-pane {
  filter: brightness(1.7) !important;
  transition: filter 0.3s ease;
}*/

html.dark-mode .leaflet-tile-pane {
  /* Invert Dark Matter to make it light, then invert colors back */
  /* This often yields sharper results than brightness adjustments */
  filter: contrast(0.85) !important;
}

/*
 *  OPTIONAL: If you want markers/buttons to remain NORMAL (unfiltered)
 *  while only the map tiles change, uncomment this:
 */

  html.dark-mode .leaflet-marker-pane,
  html.dark-mode .leaflet-popup-pane,
  html.dark-mode .leaflet-control-container {
  filter: none !important;
}

