/* ==========================================
   RESPONSIVE.CSS — Shared Responsive Styles
   ThermoCity Climate Project
   ========================================== */

/* ==========================================
   GLOBAL BOX-SIZING & OVERFLOW
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* ==========================================
   SITE FOOTER — Reusable across all pages
   Replaces inline styles on <footer> elements
   ========================================== */
.site-footer {
  background: var(--text-dark);
  color: white;
  padding: 3rem 1.5rem 2rem;
}

.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.site-footer .footer-grid h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.site-footer .footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-footer .footer-links a {
  color: #D1D5DB;
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer .footer-links a:hover {
  color: white;
}

.site-footer .footer-links p {
  color: #D1D5DB;
  margin: 0;
}

.site-footer .footer-subscribe p {
  color: #D1D5DB;
  margin-bottom: 1rem;
}

.site-footer .footer-subscribe form {
  display: flex;
  gap: 0.5rem;
}

.site-footer .footer-subscribe input[type="email"] {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--text-gray);
  border-radius: 6px;
  background: white;
  color: var(--text-dark);
  font-family: var(--font-main);
}

.site-footer .footer-subscribe button {
  padding: 0.75rem 1.5rem;
  background: var(--sky-blue);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.site-footer .footer-subscribe button:hover {
  background: var(--primary-green);
}

.site-footer .footer-subscribe .subscribe-message {
  color: var(--accent-green);
  margin-top: 0.75rem;
  display: none;
}

.site-footer .footer-bottom {
  border-top: 1px solid var(--text-gray);
  padding-top: 2rem;
  text-align: center;
}

.site-footer .footer-bottom .tagline {
  color: #D1D5DB;
  margin: 0 0 1rem 0;
}

.site-footer .footer-bottom .copyright {
  color: #6B7280;
  margin: 0;
  font-size: 0.875rem;
}

/* ==========================================
   SIMULATION PAGE — Enhanced Responsive
   Shared across all simulation detail pages
   ========================================== */
.simulation-container {
  padding-top: 80px;
  min-height: 100vh;
}

.sim-header {
  text-align: center;
  padding: 2rem;
}

.sim-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.sim-header p {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* ---- Tablet (max-width: 1024px) ---- */
@media (max-width: 1024px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }

  .main-content {
    grid-template-columns: 1fr;
  }
}

/* ---- Mobile (max-width: 768px) ---- */
@media (max-width: 768px) {
  .simulation-container {
    padding-top: 70px;
  }

  .sim-header h1 {
    font-size: 1.75rem;
  }

  .sim-header p {
    font-size: 0.9rem;
  }

  .main-content {
    padding: 0 1rem;
  }

  /* Canvas / visualization panels */
  .visualization-panel canvas,
  #floodCanvas {
    height: 350px !important;
  }

  /* Metrics grid fallback */
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  /* Control groups spacing */
  .control-group {
    margin-bottom: 1rem;
  }

  /* Footer responsive */
  .site-footer {
    padding: 2rem 1rem 1.5rem;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .site-footer .footer-subscribe form {
    flex-direction: column;
  }

  .site-footer .footer-subscribe button {
    width: 100%;
  }

  /* Tech section cards */
  .tech-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Small Phone (max-width: 480px) ---- */
@media (max-width: 480px) {
  .simulation-container {
    padding-top: 65px;
  }

  .sim-header {
    padding: 1.5rem 1rem;
  }

  .sim-header h1 {
    font-size: 1.4rem;
  }

  .main-content {
    padding: 0 0.75rem;
    margin: 1rem auto;
  }

  /* Canvas shrink further */
  .visualization-panel canvas,
  #floodCanvas {
    height: 250px !important;
  }

  .visualization-panel,
  .canvas-container,
  .controls-panel,
  .panel {
    padding: 1rem;
    border-radius: 12px;
  }

  /* Buttons */
  .btn-action,
  .btn-control {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  /* Scenario card */
  .scenario-card {
    padding: 1rem;
  }

  /* Clock display on earth simulation */
  .clock-value {
    font-size: 2rem !important;
  }

  /* Footer small phone */
  .site-footer .footer-grid h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }
}

/* ==========================================
   INDEX.HTML — Hero Video Responsive
   ========================================== */
.hero-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .hero-video-container {
    height: 80vh;
  }

  .hero-overlay h1 {
    font-size: clamp(1.5rem, 6vw, 2.5rem) !important;
  }

  .hero-overlay p {
    font-size: clamp(0.85rem, 3vw, 1.1rem) !important;
  }
}

@media (max-width: 480px) {
  .hero-video-container {
    height: 70vh;
  }

  .hero-overlay {
    padding: 1rem;
  }
}

/* ==========================================
   DASHBOARD — Enhanced Responsive
   ========================================== */
@media (max-width: 768px) {
  .dash-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .search-section {
    flex-direction: column !important;
  }

  .search-section input {
    width: 100% !important;
  }

  .search-section button {
    width: 100% !important;
  }

  #map {
    height: 300px !important;
    min-height: 300px !important;
  }
}

@media (max-width: 480px) {
  .dash-metrics-grid {
    grid-template-columns: 1fr !important;
  }

  #map {
    height: 250px !important;
  }
}
