/* ========================================================
   GLOBAL VARIABLES & BRAND DESIGN TOKENS
   ======================================================== */
:root {
  --mu-blue: #008bcc;
  --mu-blue-dark: #006699;
  --mu-blue-mid: #007ab3;
  --mu-blue-light: #33aadd;
  --mu-blue-pale: #e6f7ff;
  --mu-gold: #C8A84B;
  --mu-gold-light: #e8ca70;
  --mu-gold-dark: #a08030;

  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-50: #f4f5f7;
  --gray-100: #e8eaed;
  --gray-200: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(25, 68, 136, 0.1);
  --shadow-lg: 0 10px 40px rgba(25, 68, 136, 0.15);
  --shadow-xl: 0 20px 60px rgba(25, 68, 136, 0.2);
  
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  --container-max: 1400px;
  --navbar-height: 68px;
  --topbar-height: 40px;
}

/* =========================================
   1. TOP BAR
   ========================================= */
.topbar { background: var(--mu-blue-dark); height: var(--topbar-height); display: flex; align-items: center; padding: 0 24px; gap: 16px; font-family: 'Sarabun', 'Inter', sans-serif; }
.topbar-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.topbar-links a { color: var(--white); font-size: 14px; font-weight: 500; padding: 4px 8px; border-radius: var(--radius-sm); text-shadow: 0 1px 3px rgba(0,0,0,0.4); text-decoration: none; }
.topbar-links a:hover { color: var(--mu-gold-light); }
.topbar-links .sep { color: rgba(255,255,255,0.5); font-size: 12px; margin: 0 4px; }
.topbar-social { display: flex; align-items: center; gap: 8px; }
.topbar-social a { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); background: rgba(255,255,255,0.1); text-decoration: none;}
.topbar-social a:hover { background: var(--mu-gold); transform: translateY(-1px); }
.topbar-social img { width: 18px; height: 18px; border-radius: 4px; }
.topbar-lang a { display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,0.75); font-size: 12px; padding: 3px 10px; border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius-full); text-decoration: none; }
.topbar-lang a:hover { background: var(--mu-gold); border-color: var(--mu-gold); color: white; }
.topbar-lang img { width: 20px; height: 14px; border-radius: 2px; }

/* =========================================
   2. SITE HEADER
   ========================================= */
.site-header {
  background: linear-gradient(135deg, var(--mu-blue-dark) 0%, var(--mu-blue) 60%, var(--mu-blue-light) 100%);
  padding: 24px; display: flex; align-items: center; gap: 20px; position: relative; overflow: hidden;
}
.site-header::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--mu-gold) 0%, var(--mu-gold-light) 50%, var(--mu-gold) 100%); }
.header-logo { flex-shrink: 0; height: 75px; display: flex; align-items: center; }
.header-logo img { width: auto; height: 100%; max-width: 250px; object-fit: contain; }
.header-text { flex: 1; }
.header-dept-name { font-family: 'Sarabun', 'Inter', sans-serif; font-size: clamp(20px, 2.5vw, 28px); font-weight: 500; color: var(--white); line-height: 1.3; text-shadow: 2px 2px 5px rgba(0,0,0,0.5); letter-spacing: 0.5px; }

/* =========================================
   3. NAVIGATION BAR (DESKTOP)
   ========================================= */
.navbar { background: var(--mu-blue); position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 20px rgba(25, 68, 136, 0.3); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: var(--navbar-height); padding: 0 var(--space-4); max-width: var(--container-max); margin: 0 auto; }
.navbar-brand { color: var(--white); font-size: 20px; font-weight: 700; line-height: 1.2; margin-right: 20px; letter-spacing: 0.5px; }
.nav-menu { display: flex; align-items: center; height: 100%; list-style: none; margin: 0; padding: 0;}
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.nav-link { display: flex; align-items: center; gap: 5px; padding: 0 11px; height: 100%; color: var(--white); font-size: 15px; font-weight: 600; white-space: nowrap; transition: all var(--transition-fast); cursor: pointer; border: none; background: none; text-shadow: 0 1px 4px rgba(0,0,0,0.3); text-decoration: none;}
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 0; height: 3px; background: var(--mu-gold); border-radius: var(--radius-full) var(--radius-full) 0 0; transition: width var(--transition-base); }
.nav-link:hover, .nav-link.active { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.nav-link:hover::after, .nav-link.active::after { width: 60%; }
.nav-arrow { font-size: 10px; opacity: 0.7; transition: transform var(--transition-fast); }
.nav-item:hover .nav-arrow { transform: rotate(180deg); }

.dropdown { position: absolute; top: calc(100% + 4px); left: 0; min-width: 240px; background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all var(--transition-base); border: 1px solid var(--gray-100); z-index: 1100; list-style: none; padding: 0; margin: 0;}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: block; padding: var(--space-3) var(--space-5); color: var(--gray-700); font-size: 14.5px; border-bottom: 1px solid var(--gray-50); transition: all var(--transition-fast); position: relative; text-decoration: none;}
.dropdown-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--mu-blue); transition: width var(--transition-fast); }
.dropdown-item:hover { background: var(--mu-blue-pale); color: var(--mu-blue); padding-left: calc(var(--space-5) + 8px); }
.dropdown-item:hover::before { width: 4px; }
.dropdown-item:last-child { border-bottom: none; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: var(--space-2); border-radius: var(--radius-sm); border: none; background: none; }
.hamburger span { display: block; width: 24px; height: 2px; background: white; transition: all var(--transition-base); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================
   4. MOBILE MENU PANEL
   ========================================= */
.mobile-menu { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2000; background: rgba(0,0,0,0); backdrop-filter: blur(0px); transition: all var(--transition-slow); pointer-events: none; }
.mobile-menu.open { display: block; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); pointer-events: all; }
.mobile-nav-panel { position: fixed; top: 0; right: -100%; width: min(320px, 85vw); height: 100%; background: var(--mu-blue-dark); overflow-y: auto; transition: right var(--transition-slow) cubic-bezier(0.25, 0.46, 0.45, 0.94); display: flex; flex-direction: column; }
.mobile-menu.open .mobile-nav-panel { right: 0; }
.mobile-nav-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-5); border-bottom: 1px solid rgba(255,255,255,0.1); background: var(--mu-blue); }
.mobile-nav-title { color: white; font-size: 15px; font-weight: 600; }
.mobile-close { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-full); border: none; background: rgba(255,255,255,0.1); color: white; font-size: 20px; cursor: pointer; }
.mobile-nav-list { padding: var(--space-4) 0; flex: 1; display: flex; flex-direction: column; gap: 0;}
.mobile-nav-item { border-bottom: 1px solid rgba(255,255,255,0.06); }
.mobile-nav-link { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); color: var(--white); font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none;}
.mobile-dropdown { display: none; background: rgba(0,0,0,0.2); }
.mobile-dropdown.open { display: block; }
.mobile-dropdown a { display: block; padding: var(--space-3) var(--space-5) var(--space-3) calc(var(--space-5) + 16px); color: rgba(255,255,255,0.9); font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.04); text-decoration: none; }
.mobile-dropdown a::before { content: '– '; opacity: 0.5; }

/* =========================================
   6. SITE FOOTER
   ========================================= */
.site-footer { background: linear-gradient(135deg, var(--mu-blue-dark) 0%, var(--mu-blue) 100%); padding: 40px 24px; position: relative; overflow: hidden; margin-top: auto; }
.site-footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--mu-gold), var(--mu-gold-light), var(--mu-gold)); }
.footer-inner { max-width: var(--container-max); margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: start; }
.footer-info h3 { font-size: 16px; font-weight: 700; color: white; margin-bottom: 8px; }
.footer-info p { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.6; margin-bottom: 4px; }
.footer-info a { color: var(--mu-gold-light); text-decoration: none; }
.footer-info a:hover { color: var(--mu-gold); text-decoration: underline; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.1); }

/* =========================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ========================================= */
@media (max-width: 960px) {
  .nav-menu { display: none; }
  .hamburger { display: flex; }
  .navbar-brand { color: white; font-size: 18px; font-weight: 700; display: block; letter-spacing: 0.5px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  .topbar { display: none; }
  .site-header { padding: 16px; flex-direction: column; text-align: center; gap: 12px; }
  .header-logo { width: 100%; height: 60px; justify-content: center; }
  .header-dept-name { font-size: 16px; }
  .header-faculty-name { font-size: 12px; }
}


/* Fix for sticky navbar */
#header-container { display: contents; }
