/* Gabroverse Survey Results — Midnight Sky Theme */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&display=swap');

/* ── Variables ── */
:root {
  --navy-dark: #00296B;
  --navy-mid: #003F88;
  --blue: #00509D;
  --gold: #FDC500;
  --gold-bright: #FFD500;
  --white: #FFFFFF;
  --white-dim: rgba(255, 255, 255, 0.7);
  --white-faint: rgba(255, 255, 255, 0.15);
  --nav-height: 60px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy-mid) 60%, var(--blue) 100%);
  background-attachment: fixed;
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Sticky Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(0, 41, 107, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--white-faint);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.nav-logo {
  height: 36px;
  opacity: 0.9;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-link {
  color: var(--white-dim);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold);
  background: var(--white-faint);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

/* ── Sections ── */
section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
  scroll-margin-top: var(--nav-height);
}

section:first-of-type {
  padding-top: calc(var(--nav-height) + 40px);
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  border-bottom: 3px solid var(--gold);
  padding-bottom: 8px;
  display: inline-block;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--white-dim);
  margin-bottom: 40px;
  font-weight: 300;
}

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-logo {
  width: 300px;
  max-width: 60%;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 30px rgba(253, 197, 0, 0.15));
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.2;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 40px;
}

.counter {
  font-size: 6rem;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 60px rgba(253, 197, 0, 0.3);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.counter-label {
  font-size: 1.1rem;
  color: var(--white-dim);
  font-weight: 300;
  margin-top: 8px;
  margin-bottom: 40px;
}

/* ── Stat Grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: 900px;
}

.stat-item {
  text-align: center;
  padding: 24px 16px;
  background: var(--white-faint);
  border-radius: 15px;
  border: 1px solid rgba(253, 197, 0, 0.15);
  transition: transform 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.2;
}

.stat-of {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.6;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--white-dim);
  margin-top: 6px;
  font-weight: 400;
}

/* ── Chart Layouts ── */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 300px;
  max-height: 500px;
  margin-top: 16px;
}

.chart-container canvas {
  max-height: 100%;
}

.chart-container-tall {
  max-height: 600px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  width: 100%;
  margin-top: 16px;
}

.chart-col {
  display: flex;
  flex-direction: column;
}

.chart-col h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-bright);
  margin-bottom: 8px;
  text-align: center;
}

/* Donut layout with side legend */
.donut-layout {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-top: 16px;
}

.donut-layout .chart-container {
  flex: 1;
  min-width: 0;
  max-height: 350px;
}

.html-legend {
  flex: 0 0 auto;
  min-width: 200px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.html-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  line-height: 1.3;
}

.html-legend-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
}

.html-legend-label {
  color: var(--white);
  font-weight: 400;
  flex: 1;
}

.html-legend-value {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

/* ── Subsection tabs ── */
.sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.sub-tab {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--white-faint);
  background: transparent;
  color: var(--white-dim);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sub-tab:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.sub-tab.active {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
  font-weight: 700;
}

.sub-content {
  display: none;
}

.sub-content.active {
  display: block;
}

/* ── Filter Pills ── */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--white-faint);
  background: transparent;
  color: var(--white-dim);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.filter-pill.active {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
  font-weight: 700;
}

.filter-pill .count {
  display: inline-block;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.7rem;
  margin-left: 4px;
}

.filter-pill.active .count {
  background: rgba(0, 41, 107, 0.3);
}

/* ── Response Cards ── */
.response-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.response-card {
  background: var(--white-faint);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s;
}

.response-card:hover {
  transform: translateY(-2px);
}

.response-card.hidden {
  display: none;
}

.response-grid {
  min-height: 200px;
}

.response-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--white);
  font-weight: 300;
  margin-bottom: 12px;
}

.response-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.response-tag {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(253, 197, 0, 0.15);
  color: var(--gold);
  font-weight: 500;
}

.response-tag.category {
  background: rgba(77, 168, 218, 0.2);
  color: #4DA8DA;
}

.response-count {
  font-size: 0.85rem;
  color: var(--white-dim);
  margin-top: 12px;
  min-height: 1.4em;
}

/* ── Quote Cards ── */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.quote-card {
  background: linear-gradient(160deg, rgba(0, 24, 69, 0.6) 0%, rgba(0, 41, 107, 0.4) 100%);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid rgba(253, 197, 0, 0.15);
  position: relative;
}

.quote-text {
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--white);
  font-weight: 300;
  position: relative;
  padding-left: 24px;
}

.quote-text::before {
  content: '\201E';
  position: absolute;
  left: -4px;
  top: -12px;
  font-size: 2.5rem;
  color: var(--gold);
  font-style: normal;
  opacity: 0.5;
}

.quote-attribution {
  font-size: 0.8rem;
  color: var(--gold);
  margin-top: 16px;
  font-weight: 600;
  font-style: normal;
  padding-left: 24px;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--white-faint);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-logo {
  height: 50px;
  opacity: 0.7;
  margin-bottom: 12px;
}

.footer p {
  font-size: 0.75rem;
  color: var(--white-dim);
  font-weight: 300;
}

/* ── Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(0, 41, 107, 0.95);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
    border-bottom: 1px solid var(--white-faint);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: block;
  }

  section {
    padding: 50px 16px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .counter {
    font-size: 4rem;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .chart-row {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .donut-layout {
    flex-direction: column;
  }

  .donut-layout .html-legend {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quotes-grid {
    grid-template-columns: 1fr;
  }

  .response-grid {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    width: 200px;
  }
}

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

  .hero h1 {
    font-size: 1.3rem;
  }

  .counter {
    font-size: 3rem;
  }

  .filter-pills {
    gap: 6px;
  }

  .filter-pill {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
}
