/* ==========================================================================
   OUR ANALYTICS PAGE STYLES (pages/our-analytics.css)
   ========================================================================== */

.analytics-hero-section {
  position: relative;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px var(--page-margin) 20px;
}

.analytics-title-wrapper {
  margin-bottom: 32px;
}

.analytics-main-title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.analytics-kicker {
  display: inline-block;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #A3D88D;
  margin-bottom: 8px;
}

.analytics-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 800px;
  line-height: 1.6;
}

/* KPI Summary Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
  margin-bottom: 40px;
}

.kpi-card {
  background: linear-gradient(145deg, rgba(30, 32, 35, 0.9), rgba(18, 20, 22, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(163, 216, 141, 0.4);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.kpi-value .unit {
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  color: #A3D88D;
  margin-left: 4px;
}

.kpi-subtext {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 6px;
}

/* Section Filter Bar & Tab Nav */
.analytics-controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(20, 22, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 8px 16px;
  margin-bottom: 40px;
  backdrop-filter: blur(10px);
}

.tab-group {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 20px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
  background: linear-gradient(180deg, #4C6646 0%, #2E4832 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(76, 102, 70, 0.4);
}

.analytics-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.analytics-search-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 8px 16px 8px 36px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: border-color 0.25s ease, width 0.25s ease;
}

.analytics-search-input:focus {
  border-color: #A3D88D;
  width: 260px;
}

.analytics-search-icon {
  position: absolute;
  left: 12px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

/* Visualization Section Containers */
.analytics-section {
  margin-bottom: 60px;
}

.section-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 16px;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
}

.section-badge {
  background: rgba(163, 216, 141, 0.15);
  border: 1px solid rgba(163, 216, 141, 0.3);
  color: #A3D88D;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 9999px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.charts-grid.full-width {
  grid-template-columns: 1fr;
}

.chart-card {
  background: linear-gradient(160deg, rgba(28, 30, 33, 0.95), rgba(18, 19, 22, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease;
}

.chart-card.full-col {
  grid-column: 1 / -1;
}

.chart-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.chart-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.chart-card-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-chart-control {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chart-control:hover,
.btn-chart-control.active {
  background: rgba(163, 216, 141, 0.2);
  border-color: #A3D88D;
  color: #A3D88D;
}

.chart-wrapper {
  width: 100%;
  min-height: 380px;
  position: relative;
  flex: 1;
}

/* Pie Chart Container Styling as specified in Prompt */
.pie-chart-card-1 {
  background-color: rgb(222, 232, 210) !important;
  padding: 20px !important;
  border-radius: 8px !important;
  border: none !important;
}

.pie-chart-card-1 .chart-card-title,
.pie-chart-card-1 .chart-card-subtitle {
  color: #1e1e1e !important;
}

.pie-chart-card-2 {
  background-color: rgb(232, 239, 194) !important;
  padding: 20px !important;
  border-radius: 8px !important;
  border: none !important;
}

.pie-chart-card-2 .chart-card-title,
.pie-chart-card-2 .chart-card-subtitle {
  color: #1e1e1e !important;
}

/* Map Containers */
.leaflet-map-container {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  z-index: 1;
}

/* Responsive Grid for Analytics */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .analytics-hero-section {
    padding: 24px var(--page-margin, 16px) 16px;
  }

  .analytics-main-title {
    font-size: clamp(26px, 6vw, 36px);
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 24px;
    margin-bottom: 28px;
  }

  .kpi-card {
    padding: 16px 18px;
    border-radius: 12px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .analytics-controls-bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 16px;
    padding: 10px 14px;
    gap: 12px;
    margin-bottom: 28px;
  }

  .tab-group {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .tab-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 12.5px;
  }

  .analytics-search-box {
    width: 100%;
  }

  .analytics-search-input {
    width: 100% !important;
    font-size: 16px !important;
    min-height: 44px;
  }

  .section-header-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }

  .chart-card {
    padding: 16px;
    border-radius: 12px;
  }

  .chart-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .chart-controls {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .btn-chart-control {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .chart-wrapper {
    min-height: 300px;
  }

  .leaflet-map-container {
    height: 320px;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-title {
    font-size: 22px;
  }

  .chart-card-title {
    font-size: 16px;
  }

  .chart-wrapper {
    min-height: 260px;
  }

  .leaflet-map-container {
    height: 280px;
  }
}

/* Static Leaflet Map Tooltip */
.static-map-tooltip {
  background: rgba(20, 22, 25, 0.9) !important;
  border: 1px solid rgba(163, 216, 141, 0.5) !important;
  color: #ffffff !important;
  font-family: var(--font-body) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
}

.static-map-tooltip::before {
  border-top-color: rgba(20, 22, 25, 0.9) !important;
}
