:root {
  /* Colors */
  --primary-color: #0b345f; /* Federal Navy Blue */
  --primary-light: #16569f;
  --secondary-color: #b12521; /* Official Red/Crimson */
  --secondary-dark: #8f1c19;
  --accent-gold: #c29d3b;

  --bg-light: #f4f6f9;
  --bg-white: #ffffff;
  --text-dark: #121e29;
  --text-muted: #576574;
  --text-light: #f8f9fa;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;

  /* Transitions */
  --transition: all 0.3s ease-in-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "Playfair Display", serif;
  color: var(--primary-color);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background-color: transparent;
  border-color: white;
  color: white;
}

.btn-outline:hover {
  background-color: white;
  color: var(--primary-color);
}

.btn-white {
  background-color: white;
  color: var(--primary-color);
}

.btn-white:hover {
  background-color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn.small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Navbar */
.gov-banner {
  background-color: #0f172a;
  color: #e2e8f0;
  font-size: 0.8rem;
  padding: 0.4rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1001;
}

.gov-banner img {
  width: 16px;
  height: 16px;
}

.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
  border-bottom: 2px solid var(--primary-color);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: "Playfair Display", serif;
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dark);
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active-link {
  color: var(--secondary-color);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  transition: var(--transition);
}

/* Hero Section */
.hero {
  position: relative;
  height: 80vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  color: white;
  background-image: url("../images/state_capitol_hero.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(11, 52, 95, 0.9) 0%,
    rgba(22, 86, 159, 0.7) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: white;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Stats Section */
.stats-section {
  position: relative;
  z-index: 5;
  margin-top: -50px;
  padding: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.stat-item {
  padding: 2.5rem;
  text-align: center;
  border-right: 1px solid var(--bg-light);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 1px;
}

/* Programs Section */
.programs-section {
  background-color: var(--bg-light);
  padding-top: 8rem; /* Account for stats overlap */
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.125rem;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.program-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-top: 4px solid transparent; /* Keep logic or remove if image covers top */
  overflow: hidden; /* For image corners */
  padding: 0; /* Reset padding for image */
  display: flex;
  flex-direction: column;
}

.program-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.program-card-content {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.program-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  /* border-top-color: var(--secondary-color); Remove this as image is on top */
}

/* Remove or adjust icon-box if keeping it over image? 
   Let's keep icon-box but make it smaller or inline?
   Or move it to float over image? Let's put it inside content. */
.program-card .icon-box {
  width: 50px;
  height: 50px;
  margin-bottom: 1rem;
}

.icon-box {
  width: 60px;
  height: 60px;
  background-color: rgba(0, 168, 107, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--secondary-color);
}

.program-card h3 {
  margin-bottom: 1rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
}

.program-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.learn-more {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.learn-more:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Testimonials */
.testimonials-section {
  background-color: white;
  padding: 5rem 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.testimonial-card {
  background: var(--bg-light);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.testimonial-card::before {
  content: '"';
  font-family: "Playfair Display", serif;
  font-size: 5rem;
  color: rgba(0, 168, 107, 0.1);
  position: absolute;
  top: 10px;
  left: 20px;
}

.testimonial-text {
  font-style: italic;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.author-info h5 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
  color: var(--primary-color);
}

.author-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* About Section */
.about-section {
  background-color: white;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.check-list {
  list-style: none;
  margin-top: 1.5rem;
}

.check-list li {
  margin-bottom: 1rem;
  padding-left: 2rem;
  position: relative;
  color: var(--text-dark);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--secondary-color);
  font-weight: 700;
}

.image-block {
  width: 100%;
  height: 400px;
  background: linear-gradient(45deg, var(--bg-light), #e0e7ff);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.image-block::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 20px;
  bottom: -20px;
  left: -20px;
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-lg);
  z-index: 0;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  color: white;
  text-align: center;
}

.cta-content h2 {
  color: white;
  margin-bottom: 1rem;
}

.cta-content p {
  opacity: 0.9;
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* Footer */
.footer {
  background-color: #111827;
  color: #9ca3af;
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: "Playfair Display", serif;
  margin-bottom: 1rem;
}

.footer h4 {
  color: white;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.footer ul {
  list-style: none;
}

.footer ul li {
  margin-bottom: 0.75rem;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
}

/* Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    opacity 0.5s ease-out,
    visibility 0.5s ease-out;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--secondary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 3D Carousel Styles */
.carousel-3d-container {
  perspective: 1000px;
  width: 100%;
  max-width: 900px;
  margin: 4rem auto;
  position: relative;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-3d-wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.carousel-card {
  position: absolute;
  width: 300px;
  height: 450px;
  left: 50%;
  top: 50%;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  opacity: 0;
  z-index: 0;
  cursor: pointer;
}

.carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.carousel-card .card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(10, 49, 97, 0.9), transparent);
  padding: 2rem 1.5rem;
  color: white;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.carousel-card:hover img {
  transform: scale(1.1);
}

.carousel-card:hover .card-overlay {
  transform: translateY(0);
}

.carousel-card .card-overlay h3 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

/* Card States */
.carousel-card.active {
  transform: translate(-50%, -50%) scale(1.2);
  opacity: 1;
  z-index: 3;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.carousel-card.prev {
  transform: translate(-120%, -50%) scale(0.9) rotateY(15deg);
  opacity: 0.7;
  z-index: 2;
  filter: blur(2px);
}

.carousel-card.next {
  transform: translate(20%, -50%) scale(0.9) rotateY(-15deg);
  opacity: 0.7;
  z-index: 2;
  filter: blur(2px);
}

.btn-sm {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--secondary-color);
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-decoration: none;
  transition: background 0.3s;
}

.btn-sm:hover {
  background: #008c59;
}

/* Carousel Controls */
.carousel-controls {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-btn {
  background: none;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s;
}

.nav-btn:hover {
  background: var(--primary-color);
  color: white;
}

.carousel-dots {
  display: flex;
  gap: 0.5rem;
}

.dot {
  width: 10px;
  height: 10px;
  background: #ccc;
  border-radius: 50%;
  transition: 0.3s;
}

.dot.active {
  background: var(--secondary-color);
  transform: scale(1.3);
}

/* Responsive */
@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: white;
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: 999;
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--bg-light);
    padding: 1.5rem;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  /* Carousel Mobile Adjustments */
  .carousel-3d-container {
    height: 450px;
    margin: 2rem auto;
    perspective: none; /* Disable 3D perspective to flatten */
  }

  .carousel-card {
    width: 260px;
    height: 380px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  }

  /* Simplify transforms for mobile to avoid off-screen issues */
  .carousel-card.active {
    transform: translate(-50%, -50%) scale(1);
    z-index: 10;
    opacity: 1;
  }

  .carousel-card.prev {
    transform: translate(-50%, -50%) scale(0.85) translateX(-40px);
    z-index: 5;
    opacity: 0.5;
    filter: blur(1px);
  }

  .carousel-card.next {
    transform: translate(-50%, -50%) scale(0.85) translateX(40px);
    z-index: 5;
    opacity: 0.5;
    filter: blur(1px);
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2rem;
  }

  .carousel-3d-container {
    height: 400px;
  }

  .carousel-card {
    width: 240px;
    height: 340px;
  }

  /* Even simpler stack for very small screens */
  .carousel-card.prev,
  .carousel-card.next {
    opacity: 0; /* Hide side cards on very small screens to focus on content */
    pointer-events: none;
  }
}
