* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1c472d;
  --primary-gradient: linear-gradient(145deg, #1c472d 0%, #929073 50%, #99ca99 100%);
  --hero-gradient: linear-gradient(135deg, #7d2f95 0%, #4C3FD9 25%, #5D4FE8 50%, #7C6FFF 75%, #a19bcc 100%);
  --secondary-color: #193f02;
  --accent-color: #9B8EFF;
  --dark-color: #1c472d;
  --light-color: #FFFFFF;
  --text-color: #1c472d;
  --border-color: #E0D7FF;
  --glass-light: rgba(255, 255, 255, 0.72);
  --glass-light-border: rgba(255, 255, 255, 0.6);
  --glass-dark: rgba(10, 15, 20, 0.18);
  --glass-dark-border: rgba(255, 255, 255, 0.08);
}

/* Dark theme overrides (applied with data-theme="dark" on <html>) */
html[data-theme="dark"] {
  --primary-color: #9B8EFF;
  --primary-gradient: linear-gradient(135deg, #3A2F95 0%, #4C3FD9 50%, #5D4FE8 100%);
  --hero-gradient: linear-gradient(135deg, #1F1A4D 0%, #3A2F95 25%, #4C3FD9 50%, #5D4FE8 75%, #7C6FFF 100%);
  --secondary-color: #7C6FFF;
  --accent-color: #6D60E8;
  --dark-color: #a19dad;
  --light-color: #0A0815;
  --text-color: #E0D7FF;
  --border-color: rgba(255, 255, 255, 0.06);
  --glass-light: rgba(255, 255, 255, 0.03);
  --glass-light-border: rgba(255, 255, 255, 0.06);
  --glass-dark: rgba(0, 0, 0, 0.55);
  --glass-dark-border: rgba(255, 255, 255, 0.04);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Navigation Bar */
.navbar {
  background: var(--glass-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(10, 20, 30, 0.06);
  border-bottom: 1px solid var(--glass-light-border);
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  height: 4rem;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}

.logo {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.logo a {
  text-decoration: none;
}

.logo .brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.logo .brand i {
  font-size: 40px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo .brand span {
  font-size: 28px;
  font-weight: bold;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo .yayasan {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-color);
  text-align: center;
  width: 100%;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.logo .yayasan span {
  display: block;
}

.menu-nav {
  flex: 3;
  display: flex;
  justify-content: space-evenly;
  gap: 5px;
  height: 100%;
  width: 100%;
}

/* Glass utility classes */
.glass {
  background: var(--glass-light);
  border: 1px solid var(--glass-light-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
}

.glass-dark {
  background: var(--glass-dark);
  border: 1px solid var(--glass-dark-border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px;
}

/* Theme toggle button */
.nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease, transform 0.3s ease, text-shadow 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  transition: transform 0.3s ease;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  transform: translateY(-3px);
  text-shadow: 0 4px 12px rgba(93, 79, 232, 0.2);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

.hamburger {
  display: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--dark-color);
  transition: 0.3s ease;
}

.hamburger:hover {
  color: var(--primary-color);
}

.hamburger.active {
  color: var(--primary-color);
}

/* Auth Buttons */
.auth-buttons {
  flex: 1;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.btn-login {
  min-width: 100px;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-login {
  color: white;
  background: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: 0 4px 15px rgba(93, 79, 232, 0.15);
}

.btn-login:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(93, 79, 232, 0.3);
  background: linear-gradient(135deg, #5D4FE8 0%, #7C6FFF 100%);
}

/* Theme Toggle Button */
.theme-toggle {
  background: transparent;
  border: 2px solid var(--primary-color);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
}

.theme-toggle:hover {
  transform: translateY(-3px) rotate(20deg);
  box-shadow: 0 8px 20px rgba(93, 79, 232, 0.25);
  background: rgba(93, 79, 232, 0.08);
}

.theme-toggle i {
  transition: transform 0.4s ease;
}

.theme-toggle:hover i {
  transform: scale(1.2) rotate(-20deg);
}

.materi h2,
.pengumuman h2,
.guru h2,
.siswa h2 {
  font-size: 36px;
  text-align: center;
  margin-bottom: 15px;
  color: var(--dark-color);
}

/* Pengumuman Section */
.pengumuman {
  padding: 80px 20px;
  background: var(--light-color);
}

.pengumuman-list {
  max-width: 800px;
  margin: 0 auto;
}

.pengumuman-item {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
  background: var(--glass-light);
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(10, 20, 30, 0.05);
  border-left: 4px solid var(--primary-color);
}

.pengumuman-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  background: linear-gradient(180deg, var(--primary-color), rgba(27, 94, 76, 0.85));
  color: white;
  border-radius: 5px;
  padding: 15px;
}

.pengumuman-date .day {
  font-size: 24px;
  font-weight: bold;
}

.pengumuman-date .month {
  font-size: 12px;
}

.pengumuman-content h3 {
  margin-bottom: 10px;
  color: var(--dark-color);
}

.pengumuman-content p {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
}

/* Guru Section */
.guru {
  padding: 80px 20px;
}

.guru-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.guru-card {
  background: var(--glass-light);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(10, 20, 30, 0.08);
  transition: transform 0.3s ease;
}

.guru-card:hover {
  transform: translateY(-5px);
}

.guru-image {
  margin-bottom: 20px;
}

.guru-image i {
  font-size: 80px;
  color: var(--primary-color);
}

.guru-card h3 {
  font-size: 18px;
  margin-bottom: 5px;
  color: var(--dark-color);
}

.guru-subject {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 10px;
}

.guru-bio {
  font-size: 14px;
  color: #6b7280;
}

/* Siswa Section */
.siswa {
  padding: 80px 20px;
  background: var(--light-color);
}

.siswa-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin: 50px auto;
  max-width: 800px;
}

.stat-card {
  background: var(--glass-light);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(10, 20, 30, 0.08);
}

.stat-card h3 {
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.stat-card p {
  font-size: 16px;
  color: #6b7280;
}

.siswa-testimonial {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin: 50px 0;
}

.testimonial-card {
  background: var(--glass-light);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(10, 20, 30, 0.08);
}

.stars {
  color: #fbbf24;
  margin-bottom: 15px;
  font-size: 16px;
}

.testimonial-card p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 15px;
  line-height: 1.6;
}

.testimonial-author {
  font-weight: 600;
  color: var(--dark-color);
}

.siswa .btn-primary {
  display: block;
  margin: 30px auto 0;
}

/* Footer */
.footer {
  position: relative;
  background: var(--dark-color);
  color: white;
  padding: 60px 20px 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h3 {
  margin-bottom: 15px;
  font-size: 18px;
}

.footer-section p {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 10px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: white;
}

.social-links {
  display: flex;
  gap: 15px;
  font-size: 20px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.7;
  font-size: 14px;
}

/* ========== IMPROVED RESPONSIVE DESIGN ========== */

/* Desktop Auth Buttons */
.desktop-auth {
  display: flex;
}

.mobile-auth {
  display: none;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 1001;
    position: relative;
  }

  .hamburger i {
    font-size: 1.25rem;
    color: var(--text-color);
    transition: all 0.3s ease;
  }

  .hamburger.active i {
    color: var(--primary-color);
  }

  /* Hide desktop auth buttons on mobile */
  .desktop-auth {
    display: none;
  }

  /* Show mobile auth buttons */
  .mobile-auth {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .menu-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-light);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--glass-light-border);
    z-index: 1000;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    animation: slideDown 0.3s ease;
  }

  .menu-nav.mobile-open {
    display: flex;
  }

  .nav-link {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 0.25rem 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
  }

  .nav-link:hover,
  .nav-link:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(0);
    color: var(--primary-color);
  }

  .nav-link::after {
    display: none;
  }

  /* Mobile theme toggle and login button */
  .mobile-auth .theme-toggle,
  .mobile-auth .btn-login {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
    min-height: 44px;
    border-radius: 12px;
  }

  .mobile-auth .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
  }

  .mobile-auth .btn-login {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Logo adjustments */
  .logo .brand span {
    font-size: 1.5rem;
  }

  .logo .brand i {
    font-size: 2rem;
  }

  .logo .yayasan {
    font-size: 0.625rem;
  }

  /* Container adjustments */
  .navbar .container {
    position: relative;
  }
}

/* Content Sections */
@media (max-width: 768px) {
  .guru-grid,
  .siswa-stats,
  .siswa-testimonial {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .pengumuman-item {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.5rem;
  }

  .pengumuman-date {
    align-self: center;
    min-width: auto;
    width: fit-content;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about,
  .materi,
  .pengumuman,
  .guru,
  .siswa {
    padding: 3rem 1.5rem;
  }

  h2 {
    font-size: clamp(1.5rem, 5vw, 2rem) !important;
    margin-bottom: 1rem;
  }

  .section-subtitle {
    font-size: clamp(0.875rem, 3vw, 1rem);
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  .navbar {
    height: 3.5rem;
    padding: 0 1rem;
  }

  .menu-nav {
    padding: 1rem;
  }

  .nav-link {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .mobile-auth .btn-login,
  .mobile-auth .theme-toggle {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }

  .guru-card,
  .stat-card,
  .testimonial-card {
    padding: 1.5rem;
  }

  .pengumuman-item {
    padding: 1.25rem;
  }

  .about,
  .materi,
  .pengumuman,
  .guru,
  .siswa {
    padding: 2.5rem 1rem;
  }

  h2 {
    font-size: clamp(1.25rem, 6vw, 1.75rem) !important;
  }

  .section-subtitle {
    font-size: 0.875rem;
  }

  /* Improved touch targets */
  .guru-card,
  .stat-card,
  .testimonial-card {
    min-height: 44px;
    cursor: pointer;
  }
}

/* Animation for mobile menu */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: 70vh;
  }
  
  .about,
  .materi,
  .pengumuman,
  .guru,
  .siswa {
    padding: 2rem 1.5rem;
  }

  .menu-nav {
    max-height: calc(100vh - 3.5rem);
  }
}

/* Dark mode adjustments */
html[data-theme="dark"] .menu-nav {
  background: rgba(10, 8, 21, 0.95);
  backdrop-filter: blur(15px);
}

html[data-theme="dark"] .nav-link {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

html[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .mobile-auth .theme-toggle {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Ensure menu is above other content */
.navbar {
  position: relative;
  z-index: 1000;
}

.menu-nav {
  z-index: 1001;
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Focus states for accessibility */
.hamburger:focus,
.nav-link:focus,
.mobile-auth .theme-toggle:focus,
.mobile-auth .btn-login:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}