/* ─── VARIABLES ───────────────────────────────────────────── */
:root {
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;
  --gold:      #b7973a;
  --gold-light:#e8d48b;
  --text-main: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border:    #e5e7eb;
  --white:     #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

/* ─── NAVBAR ───────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: 68px;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

.logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
  margin-right: 28px;
}
.logo-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: transparent;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.08));
  transition: transform var(--transition);
}
.logo:hover .logo-icon {
  transform: scale(1.05);
}
.logo-icon img { 
  width: 100%; height: 100%; 
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  display: block;
}
.logo-text {
  font-family: 'Lora', serif;
  font-size: .85rem;
  font-weight: 700;
  color: var(--green-800);
  line-height: 1.2;
  max-width: 200px;
}

.nav-links {
  display: flex; align-items: center; gap: 2px;
  flex: 1; justify-content: center;
  margin: 0; padding: 0; list-style: none;
}

.nav-item { position: relative; }

.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 14px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--green-800); }
.nav-link.active { background: var(--green-50); }

.nav-link .chevron {
  width: 14px; height: 14px;
  transition: transform var(--transition);
  opacity: .5;
}
.nav-item:hover .chevron,
.nav-item.open .chevron { transform: rotate(180deg); opacity: 1; }

.nav-link.active::after {
  content: '';
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2.5px;
  background: var(--green-700);
  border-radius: 99px;
}

/* ─── DROPDOWN BASE ────────────────────────────────────────── */
.dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%; transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity var(--transition) 150ms, transform var(--transition) 150ms;
  z-index: 100;
  min-width: 200px;
}
.dropdown::after {
  content: '';
  position: absolute;
  top: -15px; left: 0; right: 0; height: 15px;
  background: transparent;
}
.nav-item:hover .dropdown,
.nav-item.open .dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
  transition: opacity var(--transition) 0ms, transform var(--transition) 0ms;
}

.dropdown-simple { padding: 8px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  font-size: .875rem;
  font-weight: 400;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.dropdown-item:hover { background: var(--green-50); color: var(--green-800); }
.dropdown-item:hover .item-icon { background: var(--green-100); color: var(--green-700); }

.item-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  background: #f3f4f6;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.item-text-wrap { display: flex; flex-direction: column; gap: 1px; }
.item-title { font-weight: 500; font-size: .85rem; line-height: 1.2; }
.item-desc { font-size: .75rem; color: var(--text-light); line-height: 1.3; }

/* ─── DEPT DROPDOWN ────────────────────────────────────────── */
.dropdown-dept {
  min-width: 600px;
  padding: 16px;
  left: 50%; transform: translateX(-50%);
}
.dept-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  transition: all var(--transition);
}
.dept-image-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 220px;
  flex-shrink: 0;
}
.dept-image-panel img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.dept-image-panel:hover img { transform: scale(1.03); }
.dept-img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(22,101,52,.45) 0%, rgba(0,0,0,.15) 100%);
}
.dept-img-label {
  position: absolute; bottom: 12px; left: 14px;
  font-family: 'Lora', serif;
  font-size: .8rem; font-weight: 600;
  color: white;
  letter-spacing: .03em;
}
.dept-content-panel {
  display: flex; flex-direction: column; gap: 4px;
  justify-content: center;
}
.dept-panel-label {
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-light);
  margin-bottom: 6px;
  padding: 0 4px;
}
.dept-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
}
.dept-item:hover { background: var(--green-50); }
.dept-item:hover .dept-item-icon { background: var(--green-100); color: var(--green-700); }
.dept-item-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  background: #f3f4f6;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: background var(--transition), color var(--transition);
}
.dept-item-body { flex: 1; }
.dept-item-title {
  font-size: .875rem; font-weight: 500;
  color: var(--text-main); line-height: 1.2;
}
.dept-item-desc {
  font-size: .75rem; color: var(--text-muted);
  line-height: 1.4; margin-top: 2px;
}

/* ─── NAV RIGHT ────────────────────────────────────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 24px;
}
.btn-login {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green-800);
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-login:hover {
  background: var(--green-50);
  color: var(--green-900);
}
.btn-register {
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  color: white !important;
  background: var(--green-800);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(20, 83, 45, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-register:hover {
  background: var(--green-700);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 83, 45, 0.2);
}

.dropdown::before {
  content: '';
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 11px; height: 11px;
  background: var(--white);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: translateX(-50%) rotate(45deg);
}

/* ─── FOOTER ───────────────────────────────────────────────── */
footer {
  background: var(--green-900);
  color: white;
  padding: 40px 0 20px;
  position: relative;
}
footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 50%, var(--gold) 100%);
  opacity: 0.3;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 30px;
  margin-bottom: 30px;
}
.footer-about .footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  text-decoration: none;
}
.footer-logo-icon {
  width: 48px; height: 48px;
  background: white;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.footer-logo-icon img {
  width: 100%; height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  display: block;
}
.footer-logo-text {
  font-family: 'Lora', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}
.footer-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}
.footer-social {
  display: flex;
  gap: 12px;
}
.social-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}
.social-btn:hover {
  background: var(--gold);
  color: var(--green-900);
  transform: translateY(-4px);
}
.footer-title {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--gold);
}
.footer-links {
  list-style: none;
  padding: 0; margin: 0;
}
.footer-links li {
  margin-bottom: 15px;
}
.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}
.footer-links a:hover {
  color: white;
  padding-left: 8px;
}
.footer-contact-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}
.contact-icon {
  width: 20px; height: 20px;
  color: var(--gold);
  flex-shrink: 0;
}
.contact-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}
.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}
.footer-legal {
  display: flex;
  gap: 24px;
}
.footer-legal a {
  color: inherit;
  text-decoration: none;
}
.footer-legal a:hover { color: white; }

@media (max-width: 991.98px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-about { grid-column: span 2; }
}
@media (max-width: 575.98px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-about { grid-column: span 1; }
  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}

/* ─── ANIMATIONS ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Delay helpers */
.delay-100 { transition-delay: 100ms; animation-delay: 100ms; }
.delay-200 { transition-delay: 200ms; animation-delay: 200ms; }
.delay-300 { transition-delay: 300ms; animation-delay: 300ms; }
.delay-400 { transition-delay: 400ms; animation-delay: 400ms; }
.delay-500 { transition-delay: 500ms; animation-delay: 500ms; }


/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE ENHANCEMENTS (iPhone SE 375px to 430px+)
   ═══════════════════════════════════════════════════════════════ */

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (min-width: 992px) {
  .nav-menu-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible !important;
  }
  .nav-hamburger,
  .nav-backdrop {
    display: none !important;
  }
  .nav-links {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  .nav-right {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 0 0 auto !important;
    flex-shrink: 0 !important;
    height: 100% !important;
    padding: 0 !important;
    border-top: none !important;
    width: auto !important;
  }
  .btn-login,
  .btn-register {
    width: auto !important;
    padding: 10px 20px !important;
    font-size: 0.875rem !important;
  }
}

@media (max-width: 991.98px) {
  nav {
    height: 64px;
  }

  .nav-inner {
    padding: 0 16px;
    justify-content: space-between;
  }

  .logo {
    margin-right: 0;
    gap: 8px;
  }

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

  .logo-text {
    font-size: 0.74rem;
    max-width: 185px;
    line-height: 1.15;
  }

  /* Hamburger Toggle */
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
    margin-left: auto;
  }

  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--green-800);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  .nav-hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Backdrop */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 22, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  /* Mobile Drawer Menu */
  .nav-menu-wrapper {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 32px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.32s ease;
    z-index: 999;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  }

  .nav-menu-wrapper.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  body.nav-menu-open {
    overflow: hidden !important;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 4px;
    flex: none;
    margin: 0;
    padding: 0;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid #f0f2f1;
  }

  .nav-link {
    padding: 12px 6px;
    font-size: 0.95rem;
    justify-content: space-between;
    width: 100%;
    border-radius: 6px;
  }

  .nav-link.active::after {
    display: none;
  }

  /* Dropdowns as Accordions */
  .dropdown {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 0 10px 10px !important;
    min-width: 100% !important;
    display: none;
    background: #fbfdfc !important;
  }

  .nav-item.mobile-expanded .dropdown {
    display: block !important;
  }

  .nav-item.mobile-expanded .chevron {
    transform: rotate(180deg);
    opacity: 1;
  }

  .dropdown-item {
    padding: 8px 10px;
  }

  .dept-layout {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .dept-image-panel {
    display: none !important;
  }

  .dept-content-panel {
    gap: 4px !important;
  }

  .dept-item {
    padding: 8px;
  }

  /* Right Action Buttons in Drawer */
  .nav-right {
    margin: 20px 0 0 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
  }

  .btn-login,
  .btn-register {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 0.70rem;
    max-width: 155px;
    line-height: 1.15;
  }
}
