/* =========================================
   1. VARIABLES & RESET (TETAP)
   ========================================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap");

:root {
  --primary: #0d47a1;
  --primary-dark: #002171;
  --accent: #ffffff;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --bg-light: #f3f4f6;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden;
}

/* =========================================
   2. NAVBAR (MODIFIED: CENTERED & HAMBURGER)
   ========================================= */
.navbar {
  background: white;
  padding: 20px 0;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #f0f0f0;
}

.inner-nav {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between; /* Logo Kiri, Tombol Desktop Kanan */
  align-items: center;
  position: relative; /* PENTING: Agar menu bisa di tengah absolut */
}

.logo h3 {
  color: #333;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
  margin: 0;
}

/* MENU DESKTOP (TENGAH) */
.navbar .menu {
  display: flex;
  gap: 25px; /* Saya kurangi sedikit dari 30px agar lebih muat */
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;

  /* Centering */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  /* --- PERBAIKAN UTAMA --- */
  white-space: nowrap; /* Memaksa teks tetap sebaris (Dilarang turun) */
}

.navbar .menu a {
  color: #555;
  font-weight: 500;
  font-size: 0.95rem;
  transition: 0.3s;
  text-decoration: none !important;
}

.navbar .menu a:hover {
  color: var(--primary);
}

/* VISIBILITY CLASSES (Untuk Mengatur Tombol Login) */
.desktop-auth-btn {
  display: block;
} /* Muncul di Desktop */
.mobile-auth-btn {
  display: none;
} /* Hilang di Desktop */

/* TOMBOL DASHBOARD STYLE */
.btn-dashboard,
.btn-dashboard-mobile {
  background: #ffffff;
  color: #1f2937 !important;
  border: 1px solid #e5e7eb;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-dashboard:hover {
  background: #f9fafb;
  border-color: var(--primary);
  color: var(--primary) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* HAMBURGER TOGGLE (Default Sembunyi) */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.menu-toggle .bar {
  width: 25px;
  height: 3px;
  background: #333;
  border-radius: 3px;
  transition: 0.3s;
}

/* =========================================
   MEDIA QUERY NAVBAR (MOBILE/TABLET)
   ========================================= */
@media (max-width: 900px) {
  /* 1. Munculkan Hamburger */
  .menu-toggle {
    display: flex;
    z-index: 1001;
  }

  /* 2. Sembunyikan Tombol Login Desktop (Kanan) */
  .desktop-auth-btn {
    display: none;
  }

  /* 3. Ubah Menu jadi Dropdown */
  .navbar .menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column; /* Susun ke bawah */
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    gap: 0;
    transform: none; /* Reset posisi tengah desktop */
    display: none; /* Sembunyi default */
  }

  /* Muncul saat class active ditambahkan JS */
  .navbar .menu.active {
    display: flex;
  }

  .navbar .menu li {
    width: 100%;
    text-align: center;
  }
  .navbar .menu a {
    display: block;
    padding: 15px;
    width: 100%;
    border-bottom: 1px solid #f9f9f9;
  }

  /* 4. Tampilkan Tombol Login Mobile (Di dalam menu) */
  .mobile-auth-btn {
    display: block;
    padding: 15px 20px;
    margin-top: 10px;
  }
  .btn-dashboard-mobile {
    background: var(--primary);
    color: white !important;
    padding: 12px;
    border-radius: 8px;
    display: block;
    text-align: center;
    justify-content: center;
  }

  /* Animasi Hamburger X */
  .menu-toggle.is-active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.is-active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }
}

/* =========================================
   3. HERO SECTION & GLOBAL BUTTONS (TETAP)
   ========================================= */
.hero {
  background: linear-gradient(rgba(13, 71, 161, 0.85), rgba(13, 71, 161, 0.9)),
    url("../images/sekolah-bg.jpg");
  background-size: cover;
  background-position: center;
  height: 600px;
  color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
}
.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 30px;
  max-width: 700px;
}

.btn-group {
  display: flex;
  gap: 15px;
}
.btn-light {
  background: white;
  color: var(--primary);
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  transition: 0.3s;
  border: 2px solid white;
}
.btn-light:hover {
  background: transparent;
  color: white;
}

.btn-outline {
  background: transparent;
  color: white;
  padding: 12px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  border: 2px solid white;
  transition: 0.3s;
}
.btn-outline:hover {
  background: white;
  color: var(--primary);
}

/* =========================================
   4. STATS & SECTIONS UTAMA (TETAP)
   ========================================= */
.stats-section {
  margin-top: -80px;
  position: relative;
  z-index: 10;
  padding-bottom: 50px;
}
.stats-grid {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.stat-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 15px;
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  display: block;
}
.stat-label {
  color: var(--text-gray);
  font-size: 0.9rem;
}

/* Layout Sections */
.section {
  padding: 60px 0;
}
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}
.text-center {
  text-align: center;
  margin-bottom: 50px;
}
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 15px;
}
.section-desc {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-gray);
  line-height: 1.6;
}

/* =========================================
   5. BERITA (LIST & DETAIL) (TETAP)
   ========================================= */
/* Grid Berita */
.grid-berita {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* Card Berita Modern */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid #f3f4f6;
  padding: 0 !important;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}
.card-title a {
  color: #1f2937;
  text-decoration: none;
  transition: 0.2s;
}
.card-title a:hover {
  color: var(--primary);
}
.card-meta {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Fix Text Overflow di Card */
.card-text {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
  overflow-wrap: break-word;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-readmore {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
}
.btn-readmore:hover {
  text-decoration: underline;
}

/* DETAIL BERITA */
.detail-header {
  text-align: center;
  margin-bottom: 40px;
}
.detail-header h1 {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 10px;
  line-height: 1.2;
}

.detail-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 40px;
}
.detail-card img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.detail-body {
  padding: 40px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #374151;
  text-align: justify;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.detail-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.badge-informasi {
  background: #e0f2fe;
  color: #0369a1;
}
.badge-prestasi {
  background: #fff7ed;
  color: #c2410c;
}

/* =========================================
   6. HALAMAN EKSKUL (TETAP)
   ========================================= */
.grid-ekskul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}
.card-ekskul {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: 0.3s;
  border: 1px solid #eee;
  text-align: center;
}
.card-ekskul:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}
.ekskul-img-box {
  height: 180px;
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ekskul-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ekskul-content {
  padding: 25px;
}
.ekskul-content h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.4rem;
}
.ekskul-content .pembina {
  font-size: 0.9rem;
  color: #555;
  background: #f9fafb;
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  margin-bottom: 15px;
  border: 1px solid #eee;
}

/* =========================================
   7. CTA, SAMBUTAN & PPDB (TETAP)
   ========================================= */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  padding: 60px 0;
  color: white;
  margin-bottom: 0;
}
.cta-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}
.cta-content h2 {
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 700;
}
.cta-btn-wrapper {
  display: flex;
  gap: 15px;
  flex-shrink: 0;
}
.btn-cta {
  background: #fbbf24;
  color: #111;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: bold;
  text-decoration: none;
  transition: 0.3s;
}
.btn-cta:hover {
  background: #f59e0b;
  transform: translateY(-3px);
}
.btn-cta-outline {
  background: transparent;
  color: white;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: bold;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: 0.3s;
}
.btn-cta-outline:hover {
  background: white;
  color: var(--primary);
}

.sambutan-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 50px;
  align-items: center;
  padding: 40px 0;
}
.sambutan-img img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 20px 20px 0px var(--primary-light, #e0f2fe);
}
.sambutan-text h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #333;
}

.ppdb-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}
.step {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}
.step-number {
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(13, 71, 161, 0.3);
}
.syarat-list li {
  margin-bottom: 15px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.syarat-list li i {
  color: #16a34a;
}
.card-info-box {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 25px;
  border: 1px solid #eee;
}
.btn-wa {
  display: block;
  background: #25d366;
  color: white;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
  transition: 0.3s;
}
.download-link {
  display: block;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid #eee;
  margin-bottom: 10px;
  border-radius: 6px;
  color: #333;
  font-weight: 500;
  text-decoration: none;
}

@media (max-width: 768px) {
  .cta-content {
    flex-direction: column;
    text-align: center;
  }
  .cta-btn-wrapper {
    flex-direction: column;
    width: 100%;
  }
  .btn-cta,
  .btn-cta-outline {
    width: 100%;
    text-align: center;
  }
  .sambutan-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .sambutan-img {
    margin-bottom: 30px;
  }
  .ppdb-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   8. HALAMAN GURU & GALERI (TETAP)
   ========================================= */
.grid-guru {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 30px;
}
.card-guru {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  text-align: center;
  padding: 30px 20px;
  transition: 0.3s;
  border: 1px solid #eee;
}
.card-guru:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}
.guru-img img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 15px;
  border: 4px solid #f3f4f6;
}
.guru-info h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 5px;
}
.guru-info .mapel {
  display: inline-block;
  background: #e0f2fe;
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}
.gallery-item {
  position: relative;
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img {
  transform: scale(1.1);
}
.gallery-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
  opacity: 0;
  transition: 0.3s;
  transform: translateY(20px);
}
.gallery-item:hover .overlay {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   9. FOOTER & LOGIN (TETAP)
   ========================================= */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding-top: 60px;
  border-top: 1px solid #1e293b;
}
.footer-grid {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  padding-bottom: 50px;
}
.footer-col h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 20px;
}
.footer-col p {
  line-height: 1.6;
  font-size: 0.9rem;
  margin-bottom: 15px;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a {
  color: #94a3b8;
  transition: 0.3s;
  text-decoration: none;
}
.footer-col ul li a:hover {
  color: white;
  padding-left: 5px;
}
.copyright {
  text-align: center;
  padding: 20px;
  border-top: 1px solid #1e293b;
  font-size: 0.9rem;
}

.partner-logos {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}
.partner-logos img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: white;
  border-radius: 50%;
  padding: 5px;
  transition: 0.3s;
  opacity: 0.8;
}
.partner-logos img:hover {
  transform: scale(1.1);
  opacity: 1;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Login Page */
body.login-body {
  background: #eef2f6;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
.login-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card h2 {
  color: var(--primary);
  margin-bottom: 10px;
}
.login-card p {
  color: var(--text-gray);
  margin-bottom: 30px;
  font-size: 0.9rem;
}
.form-group {
  margin-bottom: 20px;
  text-align: left;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}
.btn-full {
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}
.btn-full:hover {
  background: var(--primary-dark);
}
.alert {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* =========================================
   PRELOADER (LOADING SCREEN)
   ========================================= */

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff; /* Latar putih bersih */
  z-index: 99999; /* Pastikan di atas semua elemen */
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease; /* Efek fade out halus */
}

/* Animasi Lingkaran Putar */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #e2e8f0; /* Warna abu muda (jalur) */
  border-top: 5px solid var(--primary); /* Warna biru utama (gerak) */
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Keyframes Putaran */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Class untuk menyembunyikan preloader */
.loader-hide {
  opacity: 0;
  visibility: hidden;
}

/* =========================================
   SECTION VISI & MISI
   ========================================= */
.visi-misi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Bagi 2 kolom rata */
  gap: 40px;
}

.vm-card {
  background: white;
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-top: 5px solid var(--primary); /* Garis warna di atas */
  transition: 0.3s;
}

.vm-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.vm-icon {
  width: 70px;
  height: 70px;
  background: #e0f2fe;
  color: var(--primary);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 0 auto 20px auto;
}

.vm-card h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #333;
}

.vm-card p,
.vm-card div {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
}

/* Responsif HP */
@media (max-width: 768px) {
  .visi-misi-grid {
    grid-template-columns: 1fr; /* Jadi 1 kolom di HP */
  }
}
