/* ============================================
   DNR PROTOCOL GUIDE - STYLESHEET
   Educational site about Out-of-Hospital DNR
   ============================================ */

/* --- THEME VARIABLES --- */
:root {
  /* Color Palette */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --red-500: #ef4444;
  --red-600: #dc2626;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --green-500: #22c55e;
  --blue-500: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

  /* Glassmorphism */
  --glass-blur: 10px;
  --glass-border: rgba(255, 255, 255, 0.2);

  /* Status Colors for Glassmorphism */
  --green-glow: rgba(34, 197, 94, 0.3);
  --amber-glow: rgba(245, 158, 11, 0.3);
  --red-glow: rgba(239, 68, 68, 0.3);

  --green-bg-start: rgba(34, 197, 94, 0.05);
  --green-bg-end: rgba(34, 197, 94, 0.02);
  --amber-bg-start: rgba(245, 158, 11, 0.05);
  --amber-bg-end: rgba(245, 158, 11, 0.02);
  --red-bg-start: rgba(239, 68, 68, 0.05);
  --red-bg-end: rgba(239, 68, 68, 0.02);

  /* Spacing Scale */
  --space-xs: 0.5rem;      /* 8px - tight gaps */
  --space-sm: 1rem;        /* 16px - default margins */
  --space-md: 2rem;        /* 32px - card gaps */
  --space-lg: 4rem;        /* 64px - section spacing */
  --space-xl: 6rem;        /* 96px - large breaks */
  --space-section: 5rem;   /* Standard section padding */

  /* Typography Scale */
  --font-size-h1: clamp(2.5rem, 5vw, 3.5rem);
  --font-size-h2: clamp(2rem, 4vw, 2.5rem);
  --font-size-h3: 1.75rem;
  --font-size-h4: 1.25rem;
  --font-size-body: 1rem;
  --font-size-small: 0.875rem;

  --line-height-tight: 1.2;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Animation Timing */
  --duration-fast: 0.15s;     /* Quick hovers */
  --duration-medium: 0.3s;    /* Transitions */
  --duration-slow: 0.6s;      /* Scroll animations */
  --easing: cubic-bezier(0.4, 0.0, 0.2, 1); /* Material Design standard */
}

/* --- RESET & BASE STYLES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: white;
  color: var(--slate-800);
  font-size: var(--font-size-body);
  line-height: var(--line-height-relaxed);
  overflow-x: hidden;
}

/* --- ACCESSIBILITY --- */

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--slate-900);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: 600;
  z-index: 2000;
  border-radius: 0 0 0.5rem 0;
}

.skip-link:focus {
  top: 0;
}

/* Keyboard focus indicators */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* Improved text readability */
p {
  max-width: 65ch;
  line-height: var(--line-height-relaxed);
}

.hero-story,
.subtitle {
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes glowPulse {
  0%, 100% {
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
  }
  50% {
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
  }
}

@keyframes expandWidth {
  from {
    width: 0;
  }
  to {
    width: 80px;
  }
}

@keyframes floatIcon {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* --- ANIMATION CLASSES --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.animate-delay-1 { transition-delay: 0.1s; }
.animate-delay-2 { transition-delay: 0.2s; }
.animate-delay-3 { transition-delay: 0.3s; }
.animate-delay-4 { transition-delay: 0.4s; }
.animate-delay-5 { transition-delay: 0.5s; }

/* --- UTILITIES --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-padding {
  padding: var(--space-section) 0;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* --- TYPOGRAPHY --- */
h1 {
  font-size: var(--font-size-h1);
  font-weight: 800;
  line-height: var(--line-height-tight);
  letter-spacing: -0.025em;
  color: var(--slate-900);
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: 800;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.025em;
  color: var(--slate-900);
  line-height: var(--line-height-tight);
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: 700;
  line-height: var(--line-height-normal);
  color: var(--slate-900);
}

h4 {
  font-size: var(--font-size-h4);
  font-weight: 600;
  line-height: var(--line-height-normal);
  color: var(--slate-900);
}

.subtitle {
  color: var(--slate-600);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto var(--space-lg);
}

/* --- NAVIGATION --- */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--duration-medium) var(--easing);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand i {
  color: var(--red-500);
  font-size: 1.5rem;
}

.brand-short {
  display: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--slate-300);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: color var(--duration-fast) var(--easing);
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red-500);
  transition: width var(--duration-medium) var(--easing);
}

.nav-link:hover {
  color: white;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active {
  color: white;
}

.nav-link.active::after {
  width: 100%;
}

/* Mobile Navigation - Simple responsive version */
@media (max-width: 768px) {
  .nav-container {
    padding: 0.75rem 1rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.75rem;
  }

  .nav-brand {
    font-size: 1rem;
  }

  .brand-full {
    display: none;
  }

  .brand-short {
    display: inline;
  }
}

/* --- HERO SECTION --- */
.hero {
  background: linear-gradient(135deg, var(--slate-900) 0%, #0a0f1a 100%);
  color: white;
  padding: 6rem 1.5rem;
  padding-top: 8rem; /* Add extra padding to account for fixed nav */
  border-bottom: 1px solid var(--slate-800);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: var(--font-size-h1);
  font-weight: 800;
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-md);
  color: white;
  animation: fadeInUp 0.8s ease-out;
}

.hero-story {
  font-size: 1.25rem;
  color: var(--slate-200) !important;
  line-height: var(--line-height-relaxed);
  font-weight: 300;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.highlight-red {
  color: var(--red-500);
  font-weight: 600;
  animation: glowPulse 3s ease-in-out infinite;
}

.hero-divider {
  width: 80px;
  height: 4px;
  background: var(--red-600);
  margin: var(--space-md) auto;
  border-radius: 2px;
  animation: expandWidth 1s ease-out 0.4s backwards;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* --- REALITY CARDS (Dark Cards) --- */
.reality-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-top: calc(var(--space-lg) * -0.75);
  margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
  .reality-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dark-card {
  background: linear-gradient(135deg, var(--slate-800) 0%, #1a2332 100%);
  color: white !important;
  padding: calc(var(--space-md) + 0.5rem);
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-700);
  transition: transform var(--duration-medium) var(--easing),
              box-shadow var(--duration-medium) var(--easing),
              border-color var(--duration-medium) var(--easing);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.dark-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dark-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dark-card:hover::before {
  opacity: 1;
}

.dark-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.dark-card:hover.icon-yellow-card {
  border-color: var(--amber-400);
  box-shadow: 0 20px 40px rgba(251, 191, 36, 0.2);
}

.dark-card:hover.icon-red-card {
  border-color: var(--red-500);
  box-shadow: 0 20px 40px rgba(239, 68, 68, 0.2);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: calc(var(--space-sm) + 0.5rem);
  display: inline-block;
  transition: transform var(--duration-medium) var(--easing);
}

.icon-yellow {
  color: var(--amber-400);
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
}

.icon-red {
  color: var(--red-500);
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.3));
}

.dark-card h3 {
  font-size: var(--font-size-h3);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: white !important;
}

.dark-card p {
  color: #e2e8f0 !important;
  font-size: var(--font-size-body);
  line-height: var(--line-height-relaxed);
}

.dark-card strong {
  color: white !important;
}

/* Info Box (Similar Style to Dark Card) */
.info-box {
  background-color: var(--slate-800);
  color: white;
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-700);
}

.info-icon {
  font-size: 2rem;
  color: var(--blue-500);
  margin-bottom: 1.5rem;
  display: block;
}

.info-content h4 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

.info-content p {
  color: var(--slate-300);
  font-size: 1rem;
  line-height: 1.7;
}

/* --- TIMELINE SECTION --- */
.timeline-section {
  background: linear-gradient(180deg, white 0%, var(--slate-50) 100%);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto 4rem;
  padding: 2rem 0;
}

/* Vertical Line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24px;
  width: 4px;
  background: linear-gradient(180deg, var(--green-500) 0%, var(--amber-500) 50%, var(--red-500) 100%);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 60px;
}

/* Timeline Dots */
.timeline-dot {
  position: absolute;
  left: 14px;
  top: 0px;
  width: 24px;
  height: 24px;
  background: white;
  border: 4px solid var(--slate-400);
  border-radius: 50%;
  z-index: 2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
}

.timeline-item:hover .timeline-dot.dot-green {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
}

.timeline-item:hover .timeline-dot.dot-amber {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
}

.timeline-item:hover .timeline-dot.dot-red {
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
}

/* Timeline Cards */
.timeline-card {
  background: white;
  padding: calc(var(--space-sm) + 0.25rem) calc(var(--space-sm) + 0.5rem);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-md);
  border-left: 5px solid var(--slate-200);
  display: inline-block;
  min-width: 280px;
  transition: transform var(--duration-medium) var(--easing),
              box-shadow var(--duration-medium) var(--easing);
}

.timeline-card:hover {
  transform: translateX(10px) scale(1.02);
}

.timeline-card.green {
  border-color: var(--green-500);
}

.timeline-card.green:hover {
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.2);
}

.timeline-card.amber {
  border-color: var(--amber-500);
}

.timeline-card.amber:hover {
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.2);
}

.timeline-card.red {
  border-color: var(--red-500);
}

.timeline-card.red:hover {
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.2);
}

.time-label {
  font-weight: 700;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.25rem;
}

.green .time-label {
  color: var(--green-500);
}

.amber .time-label {
  color: var(--amber-500);
}

.red .time-label {
  color: var(--red-600);
}

.event-label {
  font-weight: 600;
  color: var(--slate-800);
}

/* --- STATS ROW --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  max-width: 1000px;
  margin: 0 auto var(--space-lg);
}

@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-box {
  background: white;
  border: 1px solid var(--slate-200);
  padding: calc(var(--space-sm) + 0.5rem);
  border-radius: 0.75rem;
  text-align: center;
  transition: transform var(--duration-medium) var(--easing),
              box-shadow var(--duration-medium) var(--easing),
              border-color var(--duration-medium) var(--easing);
  position: relative;
  overflow: hidden;
}

.stat-box::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green-500), var(--amber-500), var(--red-500));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease;
}

.stat-box.animate-in::before {
  transform: scaleX(1);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-color: var(--slate-300);
}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--slate-900);
  display: block;
  margin-bottom: 0.25rem;
  transition: transform 0.3s ease;
}

.stat-box:hover .stat-val {
  transform: scale(1.1);
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.stat-desc {
  font-size: 1.125rem;
  color: var(--slate-900);
  margin-top: 0.75rem;
  font-weight: 700;
}

/* --- IRONY BOX --- */
.irony-container {
  max-width: 900px;
  margin: 0 auto;
}

.irony-box {
  background-color: var(--slate-900);
  color: white;
  padding: 2.5rem;
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
}

.irony-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.irony-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.irony-icon {
  color: var(--amber-400);
  font-size: 1.5rem;
}

.irony-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--slate-300);
}

.irony-text strong {
  color: white;
}

.irony-text .highlight {
  color: var(--amber-400);
  font-weight: 600;
}

/* --- STATE SUMMARY CARDS --- */
.state-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 900px;
  margin: 0 auto var(--space-lg);
}

@media (min-width: 768px) {
  .state-summary {
    grid-template-columns: repeat(4, 1fr);
  }
}

.summary-card {
  background: white;
  padding: var(--space-md);
  border-radius: 1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: all var(--duration-medium) var(--easing);
  border-top: 4px solid;
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.05;
  pointer-events: none;
}

.summary-card.conclusive {
  border-top-color: var(--green-500);
}

.summary-card.conclusive::before {
  background: var(--green-500);
}

.summary-card.good {
  border-top-color: var(--green-500);
}

.summary-card.good::before {
  background: var(--green-500);
}

.summary-card.partial {
  border-top-color: var(--amber-500);
}

.summary-card.partial::before {
  background: var(--amber-500);
}

.summary-card.bad {
  border-top-color: var(--red-500);
}

.summary-card.bad::before {
  background: var(--red-500);
}

.summary-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.summary-number {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-xs);
  color: var(--slate-900);
}

.summary-label {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--slate-900);
}

.summary-desc {
  font-size: 0.875rem;
  color: var(--slate-600);
  line-height: var(--line-height-normal);
}

/* Toggle Details Button */
.toggle-details-btn {
  background: var(--slate-800);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--duration-medium) var(--easing);
  box-shadow: var(--shadow-md);
}

.toggle-details-btn:hover {
  background: var(--slate-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.toggle-details-btn i {
  transition: transform var(--duration-medium) var(--easing);
}

.toggle-details-btn.expanded i {
  transform: rotate(180deg);
}

/* Collapsible State Details */
.state-details-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--easing);
}

.state-details-container.expanded {
  max-height: 5000px;
}

/* --- STATE SEARCH & FILTER --- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  margin-top: var(--space-md);
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  border: 1px solid var(--slate-200);
  background: white;
  color: var(--slate-600);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-btn:hover {
  background: var(--slate-100);
}

.filter-btn.active {
  background: var(--slate-800);
  color: white;
  border-color: var(--slate-800);
}

.search-box {
  position: relative;
  max-width: 500px;
  margin: 0 auto 2rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 1px solid var(--slate-300);
  border-radius: 0.5rem;
  font-size: 1rem;
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
}

/* --- STATE CARDS GRID --- */
.states-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .states-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .states-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* State Card - Glassmorphism Design */
.state-card {
  position: relative;
  padding: calc(var(--space-sm) + 0.75rem);
  border-radius: 1rem;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing);
  overflow: hidden;

  /* Glassmorphism base */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));

  /* Border and shadow */
  border: 1px solid var(--glass-border);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.state-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Status-specific glassmorphism */
.state-card.conclusive,
.state-card.good {
  background: linear-gradient(135deg,
    var(--green-bg-start),
    var(--green-bg-end)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
  border-top: 3px solid var(--green-500);
}

.state-card.conclusive:hover,
.state-card.good:hover {
  box-shadow:
    0 20px 40px var(--green-glow),
    0 10px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 20px var(--green-glow);
  border-top-color: var(--green-500);
}

.state-card.partial {
  background: linear-gradient(135deg,
    var(--amber-bg-start),
    var(--amber-bg-end)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
  border-top: 3px solid var(--amber-500);
}

.state-card.partial:hover {
  box-shadow:
    0 20px 40px var(--amber-glow),
    0 10px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 20px var(--amber-glow);
  border-top-color: var(--amber-500);
}

.state-card.bad {
  background: linear-gradient(135deg,
    var(--red-bg-start),
    var(--red-bg-end)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.5));
  border-top: 3px solid var(--red-500);
}

.state-card.bad:hover {
  box-shadow:
    0 20px 40px var(--red-glow),
    0 10px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 20px var(--red-glow);
  border-top-color: var(--red-500);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
  .state-card {
    background: rgba(255, 255, 255, 0.95);
  }
  .state-card.conclusive,
  .state-card.good {
    background: linear-gradient(135deg,
      rgba(34, 197, 94, 0.08),
      rgba(34, 197, 94, 0.04)),
      rgba(255, 255, 255, 0.95);
  }
  .state-card.partial {
    background: linear-gradient(135deg,
      rgba(245, 158, 11, 0.08),
      rgba(245, 158, 11, 0.04)),
      rgba(255, 255, 255, 0.95);
  }
  .state-card.bad {
    background: linear-gradient(135deg,
      rgba(239, 68, 68, 0.08),
      rgba(239, 68, 68, 0.04)),
      rgba(255, 255, 255, 0.95);
  }
}

/* State Card Header */
.st-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.st-name {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--slate-900);
}

/* State Badges */
.st-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.st-badge i {
  font-size: 0.8rem;
}

.badge-conclusive {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.15));
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.3);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.badge-good {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.15));
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.3);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.badge-partial {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.15));
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.badge-bad {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.15));
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.state-card:hover .st-badge {
  transform: scale(1.05);
}

.state-card:hover .badge-conclusive,
.state-card:hover .badge-good {
  box-shadow: 0 2px 8px var(--green-glow), 0 0 12px rgba(34, 197, 94, 0.2);
}

.state-card:hover .badge-partial {
  box-shadow: 0 2px 8px var(--amber-glow), 0 0 12px rgba(245, 158, 11, 0.2);
}

.state-card:hover .badge-bad {
  box-shadow: 0 2px 8px var(--red-glow), 0 0 12px rgba(239, 68, 68, 0.2);
}

/* State Card Details */
.st-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.st-detail:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.st-label {
  color: var(--slate-500);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.st-label i {
  font-size: 0.9rem;
  color: var(--slate-400);
  width: 16px;
  text-align: center;
}

.st-val {
  font-weight: 600;
  color: var(--slate-800);
  text-align: right;
  max-width: 60%;
}

.state-card:hover .st-detail {
  background: rgba(255, 255, 255, 0.3);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 0.375rem;
}

/* --- RESOURCES SECTION --- */
.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  max-width: 1000px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.resource-card {
  background: white;
  padding: var(--space-md);
  border-radius: 1rem;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-medium) var(--easing);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.resource-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--slate-300);
}

.resource-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-xs);
}

.resource-title {
  font-size: var(--font-size-h4);
  font-weight: 700;
  color: var(--slate-900);
  margin: 0;
}

.resource-desc {
  color: var(--slate-600);
  font-size: 0.95rem;
  line-height: var(--line-height-relaxed);
  flex-grow: 1;
  margin: 0;
}

.resource-link {
  color: var(--blue-500);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--duration-fast) var(--easing);
  margin-top: var(--space-xs);
}

.resource-link:hover {
  color: var(--blue-500);
  gap: 0.75rem;
}

.resource-link i {
  font-size: 0.85rem;
  transition: transform var(--duration-fast) var(--easing);
}

.resource-link:hover i {
  transform: translateX(2px) translateY(-2px);
}

/* --- FOOTER --- */
footer {
  background: var(--slate-900);
  color: var(--slate-300);
  padding: 3rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  margin-top: 2rem;
}

footer p {
  margin-left: auto;
  margin-right: auto;
}

/* Interactive US Map */
.us-map-container {
  max-width: 900px;
  margin: 0 auto var(--space-lg);
  padding: var(--space-md);
  background: white;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
}

.us-map {
  width: 100%;
  margin-bottom: var(--space-md);
  overflow: auto;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.state-map-svg {
  width: 100%;
  height: auto;
}

.state-path {
  stroke: #fff;
  stroke-width: 1.5;
  cursor: pointer;
  transition: all 0.2s ease-out;
}

.state-path.conclusive {
  fill: #059669;
}

.state-path.good {
  fill: #10b981;
}

.state-path.partial {
  fill: #f59e0b;
}

.state-path.bad {
  fill: #dc2626;
}

.state-path:hover {
  stroke-width: 3.5;
  filter: brightness(1.25) contrast(1.1) saturate(1.2);
}

.state-path.conclusive:hover,
.state-path.good:hover {
  stroke: #d1fae5;
}

.state-path.partial:hover {
  stroke: #fef3c7;
}

.state-path.bad:hover {
  stroke: #fee2e2;
}

.map-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-small);
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
}

.legend-color.conclusive {
  background: #059669;
}

.legend-color.good {
  background: #10b981;
}

.legend-color.partial {
  background: #f59e0b;
}

.legend-color.bad {
  background: #dc2626;
}

/* States Table */
.table-container {
  overflow-x: auto;
  margin-top: var(--space-md);
}

.states-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.states-table thead {
  background: var(--slate-800);
  color: white;
}

.states-table th {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.states-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--easing);
}

.states-table th.sortable:hover {
  background: var(--slate-700);
}

.states-table th.sortable i {
  margin-left: var(--space-xs);
  opacity: 0.5;
  font-size: 0.75rem;
}

.states-table th.sorted i {
  opacity: 1;
}

.states-table tbody tr {
  border-bottom: 1px solid var(--slate-200);
  transition: background var(--duration-fast) var(--easing);
}

.states-table tbody tr:hover {
  background: var(--slate-50);
}

.states-table tbody tr:last-child {
  border-bottom: none;
}

.states-table td {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-body);
}

.states-table td:first-child {
  font-weight: 600;
  color: var(--slate-900);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.conclusive {
  background: #dcfce7;
  color: #166534;
}

.status-badge.good {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.partial {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.bad {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 768px) {
  .states-table {
    font-size: 0.875rem;
  }
  
  .states-table th,
  .states-table td {
    padding: var(--space-xs) var(--space-sm);
  }
}

/* Map Tooltip - Modern Glassmorphism */
.map-tooltip {
  position: absolute;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--slate-900);
  padding: 1.25rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  pointer-events: none;
  z-index: 1000;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.5);
  min-width: 280px;
  max-width: 320px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(10px);
}

.map-tooltip.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.map-tooltip:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

/* Status-specific border glow */
.map-tooltip.conclusive,
.map-tooltip.good {
  border-left: 4px solid var(--green-500);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    -4px 0 12px rgba(16, 185, 129, 0.2);
}

.map-tooltip.partial {
  border-left: 4px solid var(--amber-500);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    -4px 0 12px rgba(245, 158, 11, 0.2);
}

.map-tooltip.bad {
  border-left: 4px solid var(--red-500);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    -4px 0 12px rgba(220, 38, 38, 0.2);
}

.map-tooltip-state {
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.map-tooltip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.map-tooltip-badge i {
  font-size: 0.75rem;
}

.map-tooltip-badge.conclusive {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.15));
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.map-tooltip-badge.good {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.15));
  color: #166534;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.map-tooltip-badge.partial {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.15));
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.map-tooltip-badge.bad {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.15));
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.map-tooltip-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.map-tooltip-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.map-tooltip-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.map-tooltip-label i {
  font-size: 0.75rem;
  color: var(--slate-400);
}

.map-tooltip-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--slate-900);
  line-height: 1.4;
}
