/* Import font dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* Warna utama dan teks disimpan dalam variabel */
:root {
  --primary: #1D8A6B;
  --primary-dark: #16694f;
  --text-dark: #1A2E44;
  --text-gray: #1f2937;
  --card-text: #0f3f56;
}

/* Gaya dasar untuk body */
body {
  font-family: 'Poppins', sans-serif;
  background-color: white; /* Default background, bisa di-override oleh kelas spesifik */
  color: #0c3b57;
}

/* Styling untuk scrollbar (di browser berbasis WebKit seperti Chrome) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: #0f766e;
  border-radius: 10px;
}

/* Efek hover bayangan pada gambar di grid kejuaraan */
.grid-cols-5 .flex-col:hover img {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease-in-out;
}

/* === TOPBAR === */
.topbar {
  background-color: #1D8A6B;
  color: white;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column; /* Di HP: kolom */
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  position: relative;
  z-index: 50;
}

/* Di layar besar, topbar jadi baris */
@media (min-width: 640px) {
  .topbar {
    flex-direction: row;
    justify-content: space-between;
    font-size: 1rem;
  }
}

/* Item dalam topbar (lokasi dan email) */
.topbar-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* === NAVBAR === */
.navbar {
  background-color: white; /* Warna solid putih untuk navbar */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Opsional: Tambah bayangan */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #E5E7EB;
  color: #1A2E44;
  position: sticky; /* Sticky navbar */
  top: 0;
  z-index: 20; /* Pastikan di atas konten lain */
}

/* Logo sekolah */
.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  width: 50px;
  height: 60px;
  object-fit: contain;
}

.logo-text {
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* Navigasi Utama */
.nav-links {
    display: none; /* Sembunyikan secara default untuk mobile */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
}

/* Kelas yang akan ditambahkan oleh JavaScript saat menu utama dibuka */
.nav-links.open {
    display: flex;
}

/* Styling untuk item dropdown di mobile */
.nav-links li ul {
    display: none;
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
    padding-left: 1rem;
}

/* Kelas yang akan ditambahkan oleh JavaScript saat dropdown dibuka di mobile */
.nav-links li ul.open-dropdown {
    display: flex;
    flex-direction: column;
    position: static;
    box-shadow: none;
    border: none;
    background-color: transparent;
}

/* Animasi putaran caret untuk dropdown */
.fa-caret-down.rotate-180 {
    transform: rotate(180deg);
}

/* Tombol di navbar seperti "Login" */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-login {
  background-color: #1D8A6B;
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-login:hover {
  background-color: #16694f;
}

/* === HERO BAGIAN ATAS === */
.hero-curtain {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Background gambar hero */
.hero-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-image-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Konten di atas gambar hero */
.hero-content-curtain {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 1;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 600;
}

/* Tombol atau elemen yang ingin difixed */
.fixed {
  z-index: 30;
}

/* === KEJUARAAN DAN EKSTRA === */
.kejuaraan-card {
  background-color: white;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
  color: #0f3f56;
  font-size: 1rem;
  text-align: center;
}

.kejuaraan-card i {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.kejuaraan-card:hover {
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

/* === STYLE BARU UNTUK TOMBOL TAB (dari index.php) === */
.tab-button {
  background-color: white;
  border-radius: 0.5rem;
  width: 9rem;
  height: 7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
  color: #0f3f56;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}

.tab-button i {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.tab-button:hover {
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
  background-color: #f0f0f0;
}

/* Judul dan konten bagian kejuaraan dan ekskul */
.section-white-bg {
  background-color: white;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
  color: #1f2937;
  margin-bottom: 2.5rem;
}

/* Galeri gambar grid */
.grid-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Efek hover gambar */
.grid-gallery img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.grid-gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Tombol Selengkapnya */
.btn-show-more {
  display: inline-block;
  margin-top: 2rem;
  background-color: #1d8a6b;
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}
.btn-show-more:hover {
  background-color: #16694f;
}

/* === Dropdown Menu Desktop Hover === */
.nav-links li.relative:hover > ul {
    display: flex;
    opacity: 1;
    visibility: visible;
    flex-direction: column;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.25rem;
    padding: 0;
    background-color: white;
    border: 1px solid #E5E7EB;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 50;
}

.nav-links li.relative > ul li a {
    padding: 0.75rem 1rem;
}


/* === EKSTRAKURIKULER CARD === */
.ekskul-card {
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background-color: white;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
}
.ekskul-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Gambar ekskul */
.ekskul-img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Label teks ekskul */
.ekskul-label {
  text-align: center;
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-gray);
}

/* ===================== CSS KHUSUS UNTUK HALAMAN VISI-MISI ===================== */
body.visi-misi-page {
    background-image: url('./images/bgfix.png'); /* DIKEMBALIKAN KE JALUR RELATIF DARI STYLE.CSS */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
.vm-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2.5rem;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.vm-header {
    text-align: center;
    margin-bottom: 3rem;
    color: #0c3b57;
}
.vm-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.vm-header p {
    font-size: 1.125rem;
    color: #555;
}
.vm-section {
    margin-bottom: 2.5rem;
}
.vm-section h2 {
    font-weight: 700;
    color: #0f766e;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    text-align: center;
}
.vm-section p {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #333;
    text-align: center;
    font-style: italic;
    margin-bottom: 2rem;
}
.vm-section ul {
    list-style-type: none;
    padding-left: 0;
}
.vm-section ul li {
    position: relative;
    margin-bottom: 1rem;
    padding-left: 2rem;
    line-height: 1.6;
    color: #333;
    font-size: 1.1rem;
}
.vm-section ul li:before {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: #0f766e;
    font-size: 1.2rem;
    top: 0.2rem;
}
.school-photo {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 3rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===================== CSS KHUSUS UNTUK HALAMAN PROFIL GURU ===================== */
body.profile-guru-page {
  background-image: url('./images/bgfix.png'); /* DIKEMBALIKAN KE JALUR RELATIF DARI STYLE.CSS */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.hero-curtain.profile-guru-hidden {
  display: none;
}
.section-title-wrapper {
    background-color: white;
    display: block;
    width: fit-content;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    z-index: 7;
    position: relative;
    margin-left: auto;
    margin-right: auto;
    margin-top: 3rem;
    margin-bottom: 2rem;
}
.section-title-wrapper h1 {
    margin: 0;
}
.main-content-curtain {
    background-color: transparent;
    position: relative;
    z-index: 6;
    padding-top: 0;
    padding-bottom: 2rem;
}
.guru-grid {
    background: transparent;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 0rem;
    padding-bottom: 3rem;
    position: relative;
    z-index: 1;
}
.guru-item {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(15, 111, 86, 0.1);
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}
.guru-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(15, 111, 86, 0.15);
}
.guru-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 3px solid #0f766e;
    margin-bottom: 1rem;
}
.guru-nama {
    font-weight: 600;
    font-size: 1.125rem;
    color: #0f766e;
    margin-bottom: 0.25rem;
}
.guru-alumni {
    font-style: italic;
    color: #555;
    font-weight: 400;
    font-size: 0.875rem;
}

/* ===================== CSS KHUSUS UNTUK HALAMAN PROFIL SEKOLAH ===================== */
body.profile-sekolah-page {
    background-image: url('./images/bgfix.png'); /* DIKEMBALIKAN KE JALUR RELATIF DARI STYLE.CSS */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
.profile-container {
    max-width: 900px;
    margin: 4rem auto;
    padding: 2.5rem;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.profile-header {
    text-align: center;
    margin-bottom: 3rem;
    color: #0c3b57;
}
.profile-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.profile-header p {
    font-size: 1.125rem;
    color: #555;
}
.profile-section {
    margin-bottom: 2.5rem;
}
.profile-section h3 {
    font-weight: 600;
    color: #0f766e;
    margin-bottom: 1rem;
    border-bottom: 2px solid #0f766e;
    padding-bottom: 0.75rem;
    font-size: 1.5rem;
}
.profile-section p {
    line-height: 1.7;
    color: #333;
    margin-bottom: 1rem;
    text-align: justify;
}
.profile-section ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    line-height: 1.6;
    color: #333;
}

/* ===================== CSS KHUSUS UNTUK HALAMAN PENDAFTARAN (daftar.php dan pendaftaran.php) ===================== */
body.pendaftaran-page, body.registration-form-page { /* Terapkan kelas ini ke kedua halaman pendaftaran */
    background-image: url('./images/bgfix.png'); /* DIKEMBALIKAN KE JALUR RELATIF DARI STYLE.CSS */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
.registration-container {
    max-width: 900px;
    margin: 4rem auto;
    padding: 2.5rem;
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.registration-header {
    text-align: center;
    margin-bottom: 3rem;
    color: #0c3b57;
}
.registration-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.registration-header p {
    font-size: 1.125rem;
    color: #555;
}
.registration-section {
    margin-bottom: 2.5rem;
}
.registration-section h3 {
    font-weight: 600;
    color: #0f766e;
    margin-bottom: 1rem;
    border-bottom: 2px solid #0f766e;
    padding-bottom: 0.75rem;
    font-size: 1.5rem;
}
.registration-section ul {
    list-style-type: decimal;
    margin-left: 1.5rem;
    line-height: 1.8;
    color: #333;
}
.registration-section p {
    line-height: 1.7;
    color: #333;
    margin-bottom: 0.75rem;
}
.registration-button-container {
    text-align: center;
    margin-top: 3rem;
}
.registration-button {
    background-color: #0f766e;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 9999px;
    font-size: 1.125rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}
.registration-button:hover {
    background-color: #0c5f57;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Formulir Pendaftaran (daftar.php) */
.form-group {
    margin-bottom: 1.25rem;
}
.registration-form-page .container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    color: #0f766e;
}
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #0c3b57;
}
input:not([type="file"]), select {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font-size: 1rem;
    color: #333;
}
input[type="file"] {
    width: 100%;
    padding: 10px 0;
}
button[type="submit"] {
    background-color: #0f766e;
    color: white;
    padding: 12px;
    width: 100%;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
button[type="submit"]:hover {
    background-color: #0c5f57;
}

/* ===================== RESPONSIF MOBILE ===================== */

/* Logo lebih kecil di mobile */
@media (max-width: 480px) {
  .logo-img {
    width: 40px;
    height: 50px;
  }
  .logo-text {
    font-size: 0.9rem;
  }
  .btn-login {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
  }
  .section-title {
    font-size: 1.5rem;
  }
  /* Penyesuaian tab-button di mobile */
  .tab-button {
    width: 7.5rem;
    height: 6rem;
    font-size: 0.875rem;
    padding: 0.75rem;
  }
  .tab-button i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  /* Penyesuaian untuk visi-misi di mobile */
  .vm-container {
    margin: 2rem auto;
    padding: 1.5rem;
  }
  .vm-header h1 {
    font-size: 2rem;
  }
  .vm-header p {
    font-size: 1rem;
  }
  .vm-section h2 {
    font-size: 1.75rem;
  }
  .vm-section p {
    font-size: 1.1rem;
  }
  .vm-section ul li {
    font-size: 1rem;
  }
  /* Penyesuaian untuk profil guru di mobile */
  .section-title-wrapper {
      margin-top: 2rem;
      padding: 0.5rem 1rem;
  }
  .section-title-wrapper h1 {
      font-size: 1.75rem;
  }
  /* Penyesuaian untuk profil sekolah di mobile */
  .profile-container {
    margin: 2rem auto;
    padding: 1.5rem;
  }
  .profile-header h1 {
    font-size: 2rem;
  }
  .profile-header p {
    font-size: 1rem;
  }
  .profile-section h3 {
    font-size: 1.25rem;
  }
  .profile-section p, .profile-section ul li {
    font-size: 1rem;
  }
  /* Penyesuaian untuk halaman pendaftaran di mobile */
  .registration-container {
    margin: 2rem auto;
    padding: 1.5rem;
  }
  .registration-header h1 {
    font-size: 2rem;
  }
  .registration-header p {
    font-size: 1rem;
  }
  .registration-section h3 {
    font-size: 1.25rem;
  }
  .registration-section ul li, .registration-section p {
    font-size: 1rem;
  }
  .registration-button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
  }
  /* Form Pendaftaran Responsif */
  input, select, button[type="submit"] {
    font-size: 0.875rem;
    padding: 0.75rem;
  }
}

/* Grid galeri jadi 1 kolom di layar kecil */
@media (max-width: 640px) {
  .grid-gallery {
    grid-template-columns: 1fr;
  }
  /* Grid guru jadi 1 kolom di mobile */
  .guru-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .guru-item img {
    height: auto;
    max-height: 250px;
  }
  .guru-item {
    padding: 0.75rem;
  }
}

/* Aturan untuk tampilan desktop (tablet ke atas) */
@media (min-width: 768px) {
  .nav-links {
    display: flex;
    position: static;
    box-shadow: none;
    padding: 0;
    flex-direction: row;
    width: auto;
  }

  .nav-links li ul { /* Dropdown menu di desktop (hidden by default unless hovered) */
    display: none;
  }

  /* Pastikan tombol mobile menu tidak terlihat di desktop */
  #mobile-menu-button {
    display: none;
  }

  /* Grid guru untuk layar besar (tablet ke atas) */
  @media (min-width: 1024px) {
    .guru-grid {
      grid-template-columns: repeat(4, 1fr);
    }
  }
  @media (max-width: 1023px) and (min-width: 768px) {
    .guru-grid {
      grid-template-columns: repeat(2, 1fr);
    }
    .guru-item img {
      height: 220px;
    }
  }
}
