/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* --- Base Reset & Typography --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: #F0F4F8; /* Light Blue-Grey background */
  color: #3A4149; /* Darker grey for general text */
  line-height: 1.6;
  font-size: 16px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* --- Header Section --- */
.site-header {
  background-color: #0D47A1; /* Deep Blue */
  color: #fff;
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
}

.logo span {
  color: #64B5F6; /* Bright Sky Blue Accent */
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
}

.main-nav a {
  color: #BBDEFB; /* Light Blue for links */
  text-decoration: none;
  font-weight: 500;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active-link {
  color: #fff; /* White on hover */
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #fff;
  cursor: pointer;
}

/* --- General Button Styles --- */
.btn {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  border: 1px solid transparent;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-primary {
  background-color: #1976D2; /* Primary Blue */
  color: #fff;
}

.btn-primary:hover {
  background-color: #1565C0; /* Darker Primary Blue */
}

.btn-secondary {
  background-color: #64B5F6; /* Bright Sky Blue */
  color: #0D47A1; /* Deep Blue text */
  border: 1px solid #42A5F5;
}

.btn-secondary:hover {
  background-color: #42A5F5; /* Slightly darker sky blue */
  color: #0D47A1;
}

.btn-outline { /* For hero section */
  border: 2px solid #90CAF9; /* Lighter Blue border */
  color: #fff;
  background: transparent;
}

.btn-outline:hover {
  background-color: #90CAF9;
  color: #0D47A1; /* Deep Blue text */
}

/* --- Section Base Styling --- */
section {
  padding: 60px 0;
}

section h2 {
  text-align: center;
  font-size: 2.3rem;
  margin-bottom: 35px;
  color: #0D47A1; /* Deep Blue for headings */
  font-weight: 600;
}

/* General section subtitles - dark text for readability on light backgrounds */
section p.subtitle, section > .container > p:first-of-type {
    text-align: center;
    font-size: 1.15rem;
    color: #0042b3; /* Dark Grey-Blue text */
    margin-bottom: 35px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}


/* --- Hero Section --- */
.hero-section {
  background: linear-gradient(135deg, #1565C0 0%, #42A5F5 100%); /* Blue Gradient */
  color: #fff;
  padding: 90px 0;
  text-align: center;
}

.hero-section h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #fff;
  font-weight: 700;
}

/* Specific subtitle for hero section - light text on dark background */
.hero-section .subtitle {
  font-size: 1.35rem;
  margin-bottom: 35px;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
  color: #E3F2FD; /* Very Light Blue text for contrast */
}
.hero-section .quick-alerts {
  margin-top: 35px;
  margin-bottom: 35px;
}
.hero-section .quick-alerts h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  color: #E3F2FD; /* Very Light Blue for sub-heading */
}

.cta-buttons .btn {
  margin: 10px 15px;
}

/* --- Alert Item Styling (Homepage & Alert Banners) --- */
.alert-item, .alert-banner {
  padding: 18px 22px;
  border-radius: 8px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}
.alert-item i, .alert-banner i {
  font-size: 1.3rem;
}

.alert-warning {
  background-color: #FFF3E0; /* Lighter Orange/Amber */
  color: #E65100; /* Dark Orange */
  border-left: 5px solid #FFA726; /* Vibrant Amber border */
}

.alert-danger {
  background-color: #FFEBEE; /* Lighter Pink/Red */
  color: #C62828; /* Darker Red text */
  border-left: 5px solid #E53935; /* Red border */
}

/* --- Live Data Dashboard Section --- */
.data-dashboard {
  background-color: #ffffff;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 30px;
  margin-top: 25px;
}

.metric-card {
  background-color: #E3F2FD; /* Very Light Blue */
  padding: 30px 25px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #B0BEC5; /* Blue Grey border */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 15px rgba(13, 71, 161, 0.15); /* Deep Blue shadow */
}

.metric-card i {
  font-size: 2.5rem;
  margin-bottom: 15px;
}
.metrics-grid .metric-card:nth-of-type(1) i { /* Temperature */
  color: #4FC3F7; /* Light Blue */
}
.metrics-grid .metric-card:nth-of-type(2) i { /* Flame Detection */
  color: #FFA726; /* Orange */
}
.metrics-grid .metric-card:nth-of-type(3) i { /* Water Level */
  color: #29B6F6; /* Cyan Blue */
}
.metrics-grid .metric-card:nth-of-type(4) i { /* Pollution Index */
  color: #78909C; /* Blue Grey */
}

.metric-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #0D47A1; /* Deep Blue */
  font-weight: 500;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1A237E; /* Indigo */
}

.status-indicator {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 12px;
}
.status-normal {
  background-color: #A5D6A7; /* Light Green */
  color: #2E7D32; /* Dark Green */
}
.status-moderate {
  background-color: #BBDEFB; /* Light Blue */
  color: #0D47A1; /* Deep Blue */
}
.status-warning {
  background-color: #FFF176; /* Pale Yellow */
  color: #5D4037; /* Brownish */
}
.status-danger {
  background-color: #EF9A9A; /* Light Red */
  color: #C62828; /* Dark Red */
}


.charts-maps-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 45px;
}

.chart-container,
.map-container {
  flex: 1 1 48%;
  min-width: 300px;
  background-color: #FAFCFF; /* Off-White with slight blue tint */
  padding: 25px;
  border-radius: 12px;
  border: 1px solid #CFD8DC; /* Blue Grey border */
}
.chart-container h3, .map-container h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.3rem;
  color: #1976D2; /* Primary Blue */
}

#dataChart {
  width: 100% !important;
  height: 360px !important;
  margin: auto;
}
#map {
  height: 360px;
  width: 100%;
  border-radius: 10px;
}

/* --- Danger Zone Alert System Section --- */
.alert-system {
  background-color: #E3F2FD; /* Very Light Cyan */
}
.alert-system .alert-banner.alert-danger strong {
  color: #B71C1C; /* Dark Red for emphasis */
}
.alert-system .alert-banner.alert-warning strong {
  color: #E65100; /* Dark Orange for emphasis */
}

.alert-subscription {
  margin-top: 45px;
  background: #ffffff;
  padding: 35px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid #B2EBF2; /* Light Cyan border */
}
.alert-subscription h3 {
  text-align: center;
  margin-bottom: 20px;
  color: #006064; /* Dark Cyan */
}

.subscription-form input,
.subscription-form select {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid #B0BEC5; /* Blue Grey border */
  border-radius: 8px;
  font-size: 1rem;
}
.subscription-form button {
  width: 100%;
  background-color: #00838F; /* Medium Cyan */
  color: #fff;
}
.subscription-form button:hover {
  background-color: #006064; /* Darker Cyan */
}

/* --- Firefighter Unit Response Tracker Section --- */
.response-tracker {
  background-color: #ffffff; /* Very Light Blue */
}
.tracker-table-container {
  overflow-x: auto;
}
.tracker-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  background-color: #ffffff;
  box-shadow: 0 3px 10px rgba(13, 71, 161, 0.1); /* Deep Blue shadow */
  border-radius: 10px;
  overflow: hidden;
}
.tracker-table th,
.tracker-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid #CFD8DC; /* Blue Grey border */
  font-size: 0.95rem;
}
.tracker-table th {
  background-color: #BBDEFB; /* Light Blue for header */
  color: #0D47A1; /* Deep Blue text */
  font-weight: 600;
}
.tracker-table tr:hover {
  background-color: #E3F2FD; /* Very light blue hover */
}
.tracker-table .status-onscene { color: #388E3C; } /* Green */
.tracker-table .status-enroute { color: #1976D2; } /* Primary Blue */
.tracker-table .status-dispatched { color: #F57C00; } /* Orange */
.tracker-table .status-active { color: #0288D1; } /* Light Blue (for drone/aerial) */

/* --- Donation Page Section --- */
.donation-page {
  background-color: #E3F2FD; /* Lightest Blue */
}
.donation-page h2 {
  color: #0277BD; /* Medium Light Blue */
}
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 35px;
}
.campaign-card {
  background: #fff;
  padding: 30px 25px;
  border-radius: 12px;
  border: 1px solid #B3E5FC; /* Lighter Blue border */
  box-shadow: 0 3px 12px rgba(2, 119, 189, 0.08); /* Medium Light Blue shadow */
}
.campaign-card h3 {
  color: #01579B; /* Darker Light Blue */
}
.campaign-card progress::-webkit-progress-value { background-color: #03A9F4; } /* Bright Cyan Blue */
.campaign-card progress::-moz-progress-bar { background-color: #03A9F4; }
.btn-donate-select { background-color: #0288D1; } /* Medium Light Blue */
.btn-donate-select:hover { background-color: #0277BD; }

.donation-form-container {
  margin-top: 50px;
  background: linear-gradient(to bottom right, #f0fdfa, #81c4f1);
  padding: 50px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #bae6fd;
  transition: transform 0.3s ease;
}

.donation-form-container:hover {
  transform: translateY(-3px);
}

.donation-form-container h3 {
  margin-bottom: 20px;
  color: #0f766e;
  text-align: center;
  font-size: 1.6rem;
}

.donation-form-container form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.payment-methods {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-payment-method {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-payment-method[data-method="paypal"] {
  background-color: #003087;
  color: #fff;
}

.btn-payment-method[data-method="stripe"] {
  background-color: #635bff;
  color: #fff;
}

.btn-submit-donation {
  padding: 10px 20px;
  background-color: #0f766e;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}
select[name="donation_purpose"] {
  display: block;
  margin: 0 auto;
}

#donation_amount {
  width: 100%;
  text-align: center;
  font-size: 1.1rem;
}
.form-group {
  width: 100%;
  display: flex;
  justify-content: center;
}
.btn-submit-donation:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.secure-note {
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
  margin-top: 10px;
}

/* --- About Us Section (Blue Theme) --- */
.about-us {
  background-color: #ffffff; /* Very Light Blue, consistent with other sections */
}
.about-us h2, .about-us h3 {
  color: #0D47A1; /* Deep Blue */
}
.about-us h3 {
  text-align: center;
  margin-top: 45px;
  margin-bottom: 25px;
  font-size: 1.8rem;
}
/* The general rule for section > .container > p:first-of-type now handles this */
/* .about-us > .container > p:first-of-type is already covered by the general section p rule */

.team-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 35px;
  margin-top: 25px;
}
.team-member {
  background-color: #fff;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  width: calc(25% - 26.25px);
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(13, 71, 161, 0.1); /* Deep Blue shadow */
  border: 1px solid #BBDEFB; /* Light blue border */
}
.team-member img {
  width: 100px;
  height: 100px;
  border-radius: 50%; /* Make it perfectly round */
  object-fit: cover;
  object-position: center;
  margin-bottom: 18px;
  border: 4px solid #90CAF9; /* Lighter Blue border */
}
.team-member p {
  font-weight: 600;
  color: #1976D2; /* Primary Blue */
  font-size: 1.15rem;
}
.team-member p i {
  margin-right: 8px;
  color: #64B5F6; /* Bright Sky Blue icon */
}

/* --- Footer Section --- */
.site-footer {
  background-color: #0A2840; /* Very Deep, Dark Blue */
  color: #B0BEC5; /* Blue Grey text */
  padding: 35px 0;
  font-size: 0.95rem;
}
.footer-links a { color: #64B5F6; } /* Bright Sky Blue links */
.footer-links a:hover { color: #fff; }

/* --- Utility Classes --- */
.campaign-card p {
  flex-grow: 1;
  margin-bottom: 18px;
  font-size: 0.95rem;
  color: #4E4E4E;
  text-align: left;
}
.campaign-card label {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 6px;
  display: block;
}
.campaign-card progress {
  width: 100%;
  height: 12px;
  margin-bottom: 6px;
  border-radius: 6px;
}
.campaign-card progress::-webkit-progress-bar {
  background-color: #E0E0E0;
  border-radius: 6px;
}
.campaign-card span {
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 18px;
  display: block;
}
.donation-form-container form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
}
.form-group {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.payment-methods {
  display: flex;
  gap: 18px;
  justify-content: center;
  width: 100%;
}
.btn-payment-method i {
  margin-right: 8px;
}
.btn-submit-donation:disabled {
  background-color: #BDBDBD;
  cursor: not-allowed;
}
.secure-note {
  font-size: 0.9rem;
  color: #757575;
  text-align: center;
  margin-top: 12px;
}
.data-source-note {
  font-size: 0.9rem;
  color: #616161;
  text-align: center;
  margin-top: 25px;
}
.tracker-table td i {
  margin-right: 8px;
  font-size: 1.1em;
}
.tracker-table tr:last-child td {
  border-bottom: none;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .team-member {
    width: calc(50% - 17.5px);
  }
}

@media (max-width: 768px) {
  .main-nav {
    order: 3;
    width: 100%;
    position: absolute;
    top: 100%; /* Position below header */
    left: 0;
    background-color: #0D47A1; /* Match header */
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    /* display: none; */ /* Handled by .active class on ul */
  }
  .main-nav ul {
    flex-direction: column;
    display: none; /* Initially hidden */
    padding: 10px 0;
  }
  .main-nav ul.active { /* Added .active class for JS toggle */
    display: flex;
  }
  .main-nav li {
    text-align: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(30, 136, 229, 0.4); /* Lighter Blue separator, adjusted alpha */
  }
  .main-nav li:last-child {
    border-bottom: none;
  }
  .mobile-nav-toggle {
    display: block;
    order: 2;
  }
  .logo a {
    font-size: 1.7rem;
  }

  section {
    padding: 45px 0;
  }
  section h2 {
    font-size: 2rem;
  }
  .hero-section h1 {
    font-size: 2.5rem;
  }
  .hero-section .subtitle { /* Adjusted for hero section */
    font-size: 1.2rem;
    color: #023b63; /* Ensure it stays light on hero background */
  }

  .charts-maps-grid {
    flex-direction: column;
  }
  .chart-container, .map-container {
    flex-basis: 100%;
  }

  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .team-member {
    width: calc(100% - 0px); /* Full width on smaller screens */
    min-width: unset; /* Remove min-width constraint */
  }

  .donation-form-container {
    padding: 25px 20px;
  }
  .payment-methods {
    flex-direction: column;
  }
  .btn-payment-method {
    width: 100%;
  }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    section h2 {
        font-size: 1.8rem;
    }
    .hero-section h1 {
        font-size: 2.2rem;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    .campaign-card {
        padding: 20px 15px;
    }
    .donation-form-container h3 {
        font-size: 1.7rem;
    }
}
