/* ===== CSS Variables for Responsive Design ===== */
:root {
  /* Desktop defaults */
  --header-h: 100px;
  --header-pad-y: 12px;
  --logo-size: 100px;
  --title-size: 2.5rem;
  --subtitle-size: 1rem;
  --nav-padding: 1rem;
  --container-padding: 1rem;
}

/* ===== Base Styles ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f8f9fa;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* ===== Header Styles ===== */
header {
  background: linear-gradient(135deg, #2d7e0d, #4a9c2d);
  height: var(--header-h);
  padding: var(--header-pad-y) 0;
  display: flex;
  align-items: center;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Logo Styles ===== */
.logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0; /* Allows flexbox to shrink */
}

.school-logo {
  height: var(--logo-size);
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.school-logo:hover {
  transform: scale(1.05);
}

/* ===== Title Styles ===== */
.title-section {
  flex: 1;
  min-width: 0; /* Allows text to wrap */
}

header h1 {
  font-weight: 700;
  line-height: 1.1;
  font-size: var(--title-size);
  margin: 0;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header h1 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

header h1 a:hover {
  color: #d7ffd6;
}

header small {
  display: block;
  line-height: 1.2;
  margin-top: 4px;
  font-size: var(--subtitle-size);
  color: #e8f5e8;
  font-weight: 400;
}

/* ===== Social Links ===== */
.social-links {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.social-links a {
  color: #fff;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-links a:hover {
  color: #d7ffd6;
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

/* ===== Navbar Styles ===== */
nav.navbar {
  background: linear-gradient(135deg, #245c10, #2d7e0d);
  padding: var(--nav-padding) 0;
  border-top: 2px solid rgba(255,255,255,0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
}

.navbar-toggler {
  border: 2px solid #fff;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(255,255,255,0.25);
}

.navbar-nav {
  gap: 0.5rem;
}

.navbar-nav .nav-link {
  color: #fff !important;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #2d7e0d !important;
  background: rgba(255,255,255,0.9);
  transform: translateY(-1px);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: #fff;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover::after {
  width: 80%;
  left: 10%;
}

/* ===== Dropdown Styles ===== */
.dropdown-menu {
  background: linear-gradient(135deg, #f1ffe7, #e8f5e8);
  border-radius: 0.5rem;
  border: none;
  box-shadow: 0 0.75rem 2rem rgba(0,0,0,0.15);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.dropdown-item {
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  color: #2d7e0d;
  transition: all 0.3s ease;
  border-radius: 0;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: linear-gradient(135deg, #d0f4c5, #b8e6b8);
  color: #1a4b0a;
  font-weight: 600;
  padding-left: 2rem;
}

/* ===== Footer Styles ===== */
footer {
  background: linear-gradient(135deg, #1a4b0a, #2d7e0d);
  color: #fff;
  padding: 3rem 0 1rem;
  margin-top: 2rem;
}

footer a {
  color: #c6f6c6;
  text-decoration: none;
  transition: all 0.3s ease;
}

footer a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer h6 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
}

footer .border-bottom {
  border-color: rgba(255,255,255,0.3) !important;
}

/* ===== Utility Classes ===== */
.text-shadow {
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hover-lift {
  transition: transform 0.3s ease;
}

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

.bg-gradient-primary {
  background: linear-gradient(135deg, #2d7e0d, #4a9c2d);
}

/* ===== Responsive Breakpoints ===== */

/* Extra Large Devices (Large Desktops, 1400px and up) */
@media (min-width: 1400px) {
  :root {
    --header-h: 140px;
    --header-pad-y: 16px;
    --logo-size: 120px;
    --title-size: 3rem;
    --subtitle-size: 1.125rem;
    --nav-padding: 1.25rem;
    --container-padding: 1.5rem;
  }
}

/* Large Devices (Desktops, 1200px and up) */
@media (min-width: 1200px) and (max-width: 1399px) {
  :root {
    --header-h: 130px;
    --header-pad-y: 14px;
    --logo-size: 110px;
    --title-size: 2.75rem;
    --subtitle-size: 1.0625rem;
    --nav-padding: 1.125rem;
    --container-padding: 1.25rem;
  }
}

/* Medium Devices (Tablets, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
  :root {
    --header-h: 120px;
    --header-pad-y: 12px;
    --logo-size: 100px;
    --title-size: 2.5rem;
    --subtitle-size: 1rem;
    --nav-padding: 1rem;
    --container-padding: 1rem;
  }
}

/* Small-Medium Devices (Large Tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
  :root {
    --header-h: 100px;
    --header-pad-y: 10px;
    --logo-size: 80px;
    --title-size: 2rem;
    --subtitle-size: 0.9rem;
    --nav-padding: 0.875rem;
    --container-padding: 0.875rem;
  }

  header .container {
    flex-direction: row;
    align-items: center;
  }

  .social-links {
    order: 3;
  }

  .navbar-nav .nav-link {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
  }
}

/* Small Devices (Phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
  :root {
    --header-h: 90px;
    --header-pad-y: 8px;
    --logo-size: 70px;
    --title-size: 1.75rem;
    --subtitle-size: 0.85rem;
    --nav-padding: 0.75rem;
    --container-padding: 0.75rem;
  }

  header .container {
    gap: 0.75rem;
  }

  header h1 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  header small {
    font-size: 0.8rem;
  }

  .social-links {
    gap: 0.5rem;
  }

  .social-links a {
    font-size: 1.25rem;
    padding: 0.375rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .dropdown-item {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* Extra Small Devices (Small Phones, less than 576px) */
@media (max-width: 575px) {
  :root {
    --header-h: 80px;
    --header-pad-y: 6px;
    --logo-size: 60px;
    --title-size: 1.5rem;
    --subtitle-size: 0.8rem;
    --nav-padding: 0.625rem;
    --container-padding: 0.5rem;
  }

  header .container {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  .logo-section {
    gap: 0.75rem;
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .title-section {
    flex: 1;
  }

  header h1 {
    font-size: 1.25rem;
    line-height: 1.1;
  }

  header small {
    font-size: 0.75rem;
    margin-top: 2px;
  }

  .social-links {
    gap: 0.375rem;
    flex-shrink: 0;
  }

  .social-links a {
    font-size: 1.125rem;
    padding: 0.25rem;
  }

  .navbar-brand {
    font-size: 1.125rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
  }

  .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  /* Contact info section in footer */
  .contact-info-section .container > div {
    margin-bottom: 1rem;
  }

  /* Footer form adjustments */
  footer .row > div {
    margin-bottom: 2rem;
  }
}

/* Ultra Small Devices (Very Small Phones, less than 380px) */
@media (max-width: 379px) {
  :root {
    --header-h: 70px;
    --header-pad-y: 4px;
    --logo-size: 50px;
    --title-size: 1.25rem;
    --subtitle-size: 0.75rem;
    --nav-padding: 0.5rem;
    --container-padding: 0.375rem;
  }

  header h1 {
    font-size: 1.125rem;
  }

  header small {
    font-size: 0.7rem;
  }

  .social-links a {
    font-size: 1rem;
    padding: 0.25rem;
  }

  .navbar-nav .nav-link {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }

  .dropdown-item {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
  }
}

/* ===== Print Styles ===== */
@media print {
  header,
  nav,
  footer,
  .social-links {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* ===== High DPI/Retina Display Support ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .school-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ===== Focus and Accessibility ===== */
*:focus {
  outline: 2px solid #2d7e0d;
  outline-offset: 2px;
}

.navbar-toggler:focus {
  outline: 2px solid #fff;
}

/* ===== Animation Classes ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

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

/* ===== Dark Mode Support (Optional) ===== */
@media (prefers-color-scheme: dark) {
  .dropdown-menu {
    background: linear-gradient(135deg, #1a4b0a, #2d7e0d);
  }
  
  .dropdown-item {
    color: #c6f6c6;
  }
  
  .dropdown-item:hover {
    background: linear-gradient(135deg, #2d7e0d, #4a9c2d);
    color: #fff;
  }
}