/* CSS Custom Properties */
:root {
  --color-primary: #2c2c2c;
  --color-secondary: #8b7355;
  --color-accent: #6b5b47;
  --color-background: #fefefe;
  --color-surface: #f8f6f0;
  --color-border: rgba(240, 235, 220, 0.5);
  --color-text: #2c2c2c;
  --color-text-muted: #666;

  --font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont,
    sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  --border-radius: 8px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);

  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


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

html {
  scroll-behavior: smooth;
  font-size: clamp(14px, 1.5vw, 16px);
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Remove default link styles */
a {
  text-decoration: none;
  color: inherit;
}

/* Focus styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
  border-radius: var(--border-radius);
}

/* Improved image handling */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Better text selection */
::selection {
  background: rgba(139, 115, 85, 0.2);
  color: var(--color-text);
}

/* Utility container */
.container {
  width: min(95%, 1200px);
  margin: 0 auto;
  padding: 0 clamp(var(--spacing-sm), 4vw, var(--spacing-lg));
}

/* Responsive typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

/* Improved button focus states */
.btn:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Modern scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--color-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* -------------------------- Header / Navbar -------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  color: #2c2c2c;
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(240, 235, 220, 0.3);
  transition: all 0.3s ease;
}

.site-header.scrolled {
  padding: 5px 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.12);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 95%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.school-name {
  font-weight: 600;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  letter-spacing: -0.02em;
  color: #2c2c2c;
}

/* Nav (desktop) */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.main-nav a {
  color: #2c2c2c;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus {
  background: #f5f1e8;
  color: #8b7355;
  transform: translateY(-1px);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger {
  width: 22px;
  height: 2px;
  background: #2c2c2c;
  display: block;
  position: relative;
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #2c2c2c;
  transition: all 0.3s ease;
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  top: 6px;
}

/* Animated hamburger */
.main-nav.open ~ .nav-toggle .hamburger {
  background: transparent;
}

.main-nav.open ~ .nav-toggle .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.main-nav.open ~ .nav-toggle .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* -------------------------- Hero / Home -------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(135deg, #fefefe 0%, #f8f6f0 100%);
  text-align: center;
  padding: 100px 20px 60px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(248, 246, 240, 0.3),
    rgba(245, 241, 232, 0.5)
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  color: #2c2c2c;
  max-width: 980px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 20px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: #2c2c2c;
}

.tagline {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin-bottom: 40px;
  opacity: 0.8;
  color: #8b7355;
  font-weight: 400;
  line-height: 1.4;
}

.welcome-heading {
  color: #8b7355;
  transition: all 0.3s ease;
  cursor: pointer;
}

.welcome-heading:hover {
  color: #6b5b47;
  transform: translateY(-2px);
}


/* Buttons */
.btn {
  background: #2c2c2c;
  color: #fefefe;
  border: 0;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(44, 44, 44, 0.15);
  transition: all 0.3s ease;
  font-size: clamp(0.9rem, 2vw, 1rem);
  text-align: center;
  display: inline-block;
  letter-spacing: -0.01em;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(44, 44, 44, 0.25);
  background: #1a1a1a;
}

.btn:active {
  transform: translateY(0);
}

.btn.ghost {
  background: transparent;
  color: #2c2c2c;
  border: 2px solid rgba(44, 44, 44, 0.2);
  backdrop-filter: blur(10px);
}

.btn.ghost:hover {
  background: rgba(44, 44, 44, 0.05);
  border-color: rgba(44, 44, 44, 0.4);
}

/* small button */
.btn.small {
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.85rem;
}

/* -------------------------- Section general -------------------------- */
.section {
  padding: clamp(60px, 10vw, 120px) 0;
}

.section h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: #2c2c2c;
  position: relative;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.section h2::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: #8b7355;
  border-radius: 1px;
}

/* About section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
  margin-top: 30px;
}

.history {
  background: #f8f6f0;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(240, 235, 220, 0.5);
}

.history h3 {
  margin-bottom: 20px;
  color: #2c2c2c;
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  text-align: center;
  font-weight: 500;
}

.history ul {
  margin: 15px 0;
  padding-left: 20px;
}

.history li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.principal-card {
  background: #fefefe;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  text-align: center;
  transition: transform 0.3s ease;
  border: 1px solid rgba(240, 235, 220, 0.3);
}

.principal-card:hover {
  transform: translateY(-3px);
}

.principal-photo {
  width: 60%;
  height: auto;
  max-height: 250px;
  max-width: 200px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto 20px;
  border: 3px solid #8b7355;
}

.principal-message h4 {
  color: #2c2c2c;
  margin-bottom: 12px;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 500;
}

.principal-message p {
  font-style: italic;
  color: #666;
  line-height: 1.7;
}

/* Gallery */
.gallery-buttons {
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.gallery-buttons button {
  padding: 12px 24px;
  background: #f8f6f0;
  color: #2c2c2c;
  border: 1px solid rgba(139, 115, 85, 0.2);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.gallery-buttons button:hover {
  background: #8b7355;
  color: #fefefe;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.2);
}

.event-gallery h3 {
  text-align: center;
  color: #2c2c2c;
  margin-bottom: 24px;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 500;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 3vw, 24px);
  margin-top: var(--spacing-md);
}

.gallery-grid .g-item {
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  border: 1px solid rgba(240, 235, 220, 0.3);
}

.gallery-grid .g-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-grid img:hover {
  transform: scale(1.1);
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(20px, 4vw, 32px);
  margin-top: var(--spacing-lg);
}

.achievement-card {
  background: #fefefe;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(240, 235, 220, 0.3);
}

.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.achievement-card img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: blocl;
}

.achievement-card p {
  padding: 20px;
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 500;
  color: #2c2c2c;
  line-height: 1.6;
}

/* Know your school - facts */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(16px, 3vw, 24px);
  margin: var(--spacing-lg) 0;
}

.fact-card {
  background: #f8f6f0;
  color: #2c2c2c;
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  border: 1px solid rgba(139, 115, 85, 0.1);
}

.fact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.fact-number {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 300;
  margin-bottom: 10px;
  color: #8b7355;
}

.fact-label {
  opacity: 0.8;
  font-size: clamp(0.9rem, 2vw, 1rem);
  font-weight: 500;
}

/* Quiz */
.quiz-section {
  margin-top: 40px;
  text-align: center;
}

.quiz-section h3 {
  color: #2c2c2c;
  margin-bottom: 24px;
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 500;
}

.quiz-container {
  max-width: 600px;
  margin: 24px auto;
  background: #f8f6f0;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(240, 235, 220, 0.5);
}

.quiz-question {
  font-weight: 500;
  margin-bottom: 24px;
  color: #2c2c2c;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.quiz-opt {
  padding: 14px 20px;
  border-radius: 8px;
  border: 2px solid rgba(139, 115, 85, 0.2);
  background: #fefefe;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.quiz-opt:hover {
  transform: translateY(-2px);
  border-color: #8b7355;
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.15);
}

.quiz-result {
  margin: 15px 0;
  min-height: 30px;
  font-weight: 600;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.quiz-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
}

.contact-form-wrap {
  background: #f8f6f0;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(240, 235, 220, 0.5);
}

.contact-form-wrap h2 {
  margin-bottom: 25px;
  text-align: center;
}

.contact-form label {
  display: block;
  margin-bottom: 18px;
  font-weight: 500;
  color: #2c2c2c;
}

.contact-form label span {
  display: block;
  margin-bottom: 5px;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: 8px;
  border: 2px solid rgba(139, 115, 85, 0.2);
  font-size: clamp(0.9rem, 2vw, 1rem);
  background: #fefefe;
  transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.contact-actions {
  display: flex;
  gap: 15px;
  margin: 25px 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-details {
  margin-top: 20px;
  color: #123;
  font-size: clamp(0.9rem, 2vw, 1rem);
  text-align: center;
}

.contact-details p {
  margin-bottom: 8px;
}

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

.contact-map h3 {
  color: #2c2c2c;
  margin-bottom: 24px;
  font-size: clamp(1.1rem, 3vw, 1.3rem);
  font-weight: 500;
}

.contact-map iframe {
  width: 100%;
  max-width: 600px;
  height: 300px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(240, 235, 220, 0.3);
}

/* Footer */
.site-footer {
  background: #f8f6f0;
  color: #2c2c2c;
  padding: 40px 0;
  margin-top: 60px;
  text-align: center;
  border-top: 1px solid rgba(240, 235, 220, 0.5);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.site-footer .social {
  display: flex;
  gap: 20px;
}

.site-footer .social a {
  color: #8b7355;
  font-size: 1.5rem;
  padding: 12px;
  border-radius: 50%;
  background: rgba(139, 115, 85, 0.1);
  transition: all 0.3s ease;
}

.site-footer .social a:hover {
  background: #8b7355;
  color: #fefefe;
  transform: translateY(-2px);
}

.site-footer p {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  opacity: 0.9;
}

/* ================================ RESPONSIVE BREAKPOINTS ================================ */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
    padding: 0 var(--spacing-xl);
  }

  .about-grid {
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-xl);
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }

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

  .facts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .about-grid {
    grid-template-columns: 3fr 2fr;
    gap: var(--spacing-lg);
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
  }

  .facts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .nav-inner {
    padding: 10px 15px;
  }

  .hero {
    background-attachment: scroll; /* Fix parallax issues on tablets */
  }

  .facts-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .quiz-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Small Tablet / Large Phone (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .nav-toggle {
    display: block;
    margin-right: 10px;
  }

  .main-nav {
    position: absolute;
    right: 15px;
    top: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(240, 235, 220, 0.3);
  }

  .main-nav.open {
    display: block;
    animation: slideDown 0.3s ease-out;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 10px;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 0;
  }

  .hero {
    background-attachment: scroll;
    padding: 100px 20px 50px;
  }

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

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .quiz-options {
    grid-template-columns: 1fr 1fr;
  }

  .contact-actions {
    justify-content: center;
  }
}

/* Mobile (320px - 575px) */
@media (max-width: 575px) {
  .container {
    width: 98%;
    padding: 0 5px;
  }

  .nav-inner {
    padding: 8px 10px;
  }

  .nav-toggle {
    display: block;
    margin-right: 5px;
  }

  .main-nav {
    position: absolute;
    right: 10px;
    top: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    min-width: 180px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(240, 235, 220, 0.3);
  }

  .main-nav.open {
    display: block;
    animation: slideDown 0.3s ease-out;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 8px;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 1px 0;
    font-size: 0.9rem;
  }

  .school-name {
    font-size: 0.95rem;
  }

  .logo {
    width: 38px;
    height: 38px;
  }

  .hero {
    min-height: 90vh;
    background-attachment: scroll;
    padding: 90px 15px 40px;
  }

  .hero-content {
    padding: 0 10px;
  }

  .section {
    padding: 30px 0;
  }

  .history {
    padding: 20px 15px;
  }

  .principal-card {
    padding: 15px;
  }

  .principal-photo {
    width: 70%;
    max-width: 150px;
  }

  .facts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .fact-card {
    padding: 20px 15px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .gallery-grid img {
    height: 250px;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .quiz-container {
    padding: 20px 15px;
  }

  .quiz-options {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quiz-controls {
    flex-direction: column;
    align-items: center;
  }

  .contact-form-wrap {
    padding: 20px 15px;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-actions .btn {
    margin-bottom: 10px;
    text-align: center;
  }

  .contact-map iframe {
    height: 250px;
  }

  .footer-inner {
    gap: 12px;
  }

  .site-footer .social {
    gap: 15px;
  }

  .site-footer .social a {
    font-size: 1.3rem;
    padding: 8px;
  }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
  .container {
    width: 100%;
    padding: 0 3px;
  }

  .nav-inner {
    padding: 6px 8px;
  }

  .school-name {
    font-size: 0.85rem;
  }

  .logo {
    width: 32px;
    height: 32px;
  }

  .hero {
    padding: 85px 10px 35px;
  }

  .section {
    padding: 25px 0;
  }

  .history {
    padding: 15px 10px;
  }

  .principal-card {
    padding: 12px;
  }

  .quiz-container {
    padding: 15px 10px;
  }

  .contact-form-wrap {
    padding: 15px 10px;
  }
}

/* Animation Keyframes */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth scrolling for all browsers */
html {
  scroll-behavior: smooth;
}

/* Focus states for accessibility */
.btn:focus,
.quiz-opt:focus,
.gallery-buttons button:focus,
input:focus,
textarea:focus {
  outline: 2px solid #004085;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero-overlay {
    background: rgba(0, 0, 0, 0.8);
  }

  .btn {
    border: 2px solid #004085;
  }
}

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

  .hero {
    background-attachment: scroll !important;
  }
}

/* Print styles */
@media print {
  .site-header,
  .nav-toggle,
  .hero-cta,
  .quiz-section,
  .contact-form,
  .site-footer {
    display: none !important;
  }

  .hero {
    background: none !important;
    color: #000 !important;
    min-height: auto !important;
    padding: 20px !important;
  }

  .hero-overlay {
    display: none !important;
  }

  .section {
    page-break-inside: avoid;
    padding: 20px 0 !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
  }

  /* Uncomment to enable dark mode
    body {
      background: var(--bg-primary);
      color: var(--text-primary);
    }
    
    .history,
    .principal-card,
    .quiz-container,
    .contact-form-wrap {
      background: var(--bg-secondary);
      color: var(--text-primary);
    }
    
    .contact-form input,
    .contact-form textarea {
      background: var(--bg-primary);
      color: var(--text-primary);
      border-color: #444;
    }
    */
}

/* Loading states */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #004085;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Utility classes for better responsive control */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.d-none {
  display: none;
}
.d-block {
  display: block;
}
.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}

.w-100 {
  width: 100%;
}
.h-100 {
  height: 100%;
}

.m-0 {
  margin: 0;
}
.p-0 {
  padding: 0;
}

.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 1rem;
}
.mt-4 {
  margin-top: 1.5rem;
}
.mt-5 {
  margin-top: 3rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 1rem;
}
.mb-4 {
  margin-bottom: 1.5rem;
}
.mb-5 {
  margin-bottom: 3rem;
}

.p-1 {
  padding: 0.25rem;
}
.p-2 {
  padding: 0.5rem;
}
.p-3 {
  padding: 1rem;
}
.p-4 {
  padding: 1.5rem;
}
.p-5 {
  padding: 3rem;
}

/* Responsive utility classes */
@media (max-width: 575px) {
  .d-sm-none {
    display: none;
  }
  .d-sm-block {
    display: block;
  }
  .d-sm-flex {
    display: flex;
  }
  .text-sm-center {
    text-align: center;
  }
  .text-sm-left {
    text-align: left;
  }
}

@media (max-width: 767px) {
  .d-md-none {
    display: none;
  }
  .d-md-block {
    display: block;
  }
  .d-md-flex {
    display: flex;
  }
  .text-md-center {
    text-align: center;
  }
  .text-md-left {
    text-align: left;
  }
}

@media (max-width: 991px) {
  .d-lg-none {
    display: none;
  }
  .d-lg-block {
    display: block;
  }
  .d-lg-flex {
    display: flex;
  }
  .text-lg-center {
    text-align: center;
  }
  .text-lg-left {
    text-align: left;
  }
}

/* Image optimization for performance */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.lazy-load {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-load.loaded {
  opacity: 1;
}

/* Better form validation styles */
.form-group {
  position: relative;
  margin-bottom: 1rem;
}

.form-control:invalid {
  border-color: #dc3545;
}

.form-control:valid {
  border-color: #28a745;
}

.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
}

.form-control:invalid + .invalid-feedback {
  display: block;
}

/* Improved button states */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1001;
}

.skip-link:focus {
  top: 6px;
}

/* High performance scrolling */
.scroll-container {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

/* Better mobile touch targets */
@media (max-width: 767px) {
  .btn,
  .quiz-opt,
  .gallery-buttons button,
  .main-nav a {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Performance optimizations */
.hero {
  will-change: transform;
}

.gallery-grid img,
.achievement-card,
.fact-card {
  will-change: transform;
}

/* Prevent layout shift */
.aspect-ratio-16-9 {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
}

.aspect-ratio-16-9 > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Error states */
.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.success-message {
  color: #28a745;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Final responsive fixes */
@media (max-width: 480px) {
  .gallery-buttons {
    flex-direction: column;
    align-items: center;
  }

  .gallery-buttons button {
    width: 100%;
    max-width: 200px;
  }

  .contact-details {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .contact-details p {
    margin-bottom: 10px;
  }
}

/* Landscape orientation fixes for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 60px 15px 30px;
  }

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

  .tagline {
    font-size: 1rem;
    margin-bottom: 20px;
  }
}
