:root {
  --primary-color: #28a745; /* Bootstrap Success Green */
  --secondary-color: #ffffff;
  --text-dark: #333333;
  --text-light: #f8f9fa;
  --paud-yellow: #ffc107;
  --paud-blue: #0d6efd;
  --paud-pink: #e83e8c;
  --paud-orange: #fd7e14;
}

body {
  font-family: 'Baloo 2', sans-serif;
  color: var(--text-dark);
  background-color: #fafffa;
  background-image: radial-gradient(rgba(40, 167, 69, 0.1) 2.5px, transparent 2.5px);
  background-size: 35px 35px;
  overflow-x: hidden;
}

/* Navbar */
.navbar {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1030;
  position: relative; /* Bug Fix #1 & #5: anchor untuk .navbar-collapse absolute */
}
.navbar > .container {
  overflow: visible !important;
}
.navbar-brand {
  font-weight: 700;
  color: var(--primary-color) !important;
}
.navbar-brand img {
  transition: none !important;
}
.navbar-brand img:hover {
  transform: none !important;
}
.nav-link {
  font-weight: 500;
  color: #555 !important;
  transition: color 0.3s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary-color) !important;
}

/* Dropdown menu styling */
.dropdown-menu {
  border: none;
  border-radius: 12px;
  padding: 8px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  animation: dropdownFade 0.25s ease;
}
.dropdown-item {
  padding: 10px 20px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.dropdown-item:hover {
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--primary-color);
  padding-left: 25px;
}
@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dropdown on hover for desktop */
@media (min-width: 992px) {
  .navbar .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
  }
}

/* Hero Section */
.hero-section {
  background-color: #f0fdf4; /* Soft green pastel */
  padding: 100px 0 120px 0;
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-shadow: 2px 2px 0px rgba(255, 193, 7, 0.4);
}
.hero-subtitle {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 30px;
  font-weight: 600;
}
.hero-img {
  border-radius: 40px;
  border: 8px solid #fff;
  box-shadow: 0 15px 0px rgba(40, 167, 69, 0.3);
}

/* Buttons */
.btn-primary-custom {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border-radius: 50px;
  padding: 12px 35px;
  font-weight: 800;
  border: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 0px rgba(33, 136, 56, 0.9); /* Bubbly hard shadow */
}
.btn-primary-custom:hover {
  background-color: #218838;
  color: var(--secondary-color);
  transform: translateY(3px);
  box-shadow: 0 3px 0px rgba(33, 136, 56, 0.9);
}

/* General Page Styling */
.page-header {
  background-color: var(--primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath fill='%23fafffa' fill-opacity='1' d='M0,32L48,42.7C96,53,192,75,288,74.7C384,75,480,53,576,48C672,43,768,53,864,64C960,75,1056,85,1152,74.7C1248,64,1344,32,1392,16L1440,0L1440,100L1392,100C1344,100,1248,100,1152,100C1056,100,960,100,864,100C768,100,672,100,576,100C480,100,384,100,288,100C192,100,96,100,48,100L0,100Z'%3E%3C/path%3E%3C/svg%3E");
  background-position: center calc(100% + 1px);
  background-repeat: no-repeat;
  background-size: 100% 22px;
  color: white;
  padding: 35px 0 50px 0;
  text-align: center;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.page-header .container {
  position: relative;
  z-index: 1;
}
.page-header h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}
.page-header .lead {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 0;
}

/* Animations */
.fade-in {
  animation: fadeIn 1.5s ease-in-out;
}

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

/* Playful Cards (Lightweight) */
.card {
  border: 4px solid var(--primary-color) !important;
  border-radius: 25px !important;
  box-shadow: 0 6px 0px rgba(40, 167, 69, 0.25) !important;
  transition: box-shadow 0.2s ease-in-out !important;
}
.card:hover {
  box-shadow: 0 10px 0px rgba(40, 167, 69, 0.3) !important;
}

/* Alternate colors for cards in grids */
.row > div:nth-child(even) .card {
  border-color: var(--paud-orange) !important;
  box-shadow: 0 6px 0px rgba(253, 126, 20, 0.25) !important;
}
.row > div:nth-child(even) .card:hover {
  box-shadow: 0 10px 0px rgba(253, 126, 20, 0.3) !important;
}

.row > div:nth-child(3n) .card {
  border-color: var(--paud-blue) !important;
  box-shadow: 0 6px 0px rgba(13, 110, 253, 0.25) !important;
}
.row > div:nth-child(3n) .card:hover {
  box-shadow: 0 10px 0px rgba(13, 110, 253, 0.3) !important;
}

.row > div:nth-child(4n) .card {
  border-color: var(--paud-pink) !important;
  box-shadow: 0 6px 0px rgba(232, 62, 140, 0.25) !important;
}
.row > div:nth-child(4n) .card:hover {
  box-shadow: 0 10px 0px rgba(232, 62, 140, 0.3) !important;
}

/* Dash border below card images */
.card img.card-img-top {
  border-bottom: 4px dashed rgba(0,0,0,0.1);
}



/* Responsive Design untuk Tablet dan Mobile */
@media (max-width: 991.98px) {
  /* Offcanvas mobile menu styling */
  .offcanvas {
    width: 280px !important;
    border-left: none;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
  }
  .offcanvas-header {
    background: linear-gradient(135deg, var(--primary-color), #218838);
    color: white;
  }
  .offcanvas-title {
    color: white !important;
    font-weight: 700;
    font-size: 1.1rem;
  }
  .offcanvas-header .btn-close {
    filter: brightness(0) invert(1);
  }
  .offcanvas-body .navbar-nav .nav-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  .offcanvas-body .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }
  .offcanvas-body .navbar-nav .nav-link {
    padding: 12px 16px !important;
    font-weight: 500;
    color: #333 !important;
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.2s ease;
  }
  .offcanvas-body .navbar-nav .nav-link:hover {
    background-color: rgba(40, 167, 69, 0.08);
    color: var(--primary-color) !important;
  }
  .offcanvas-body .navbar-nav .nav-link.active {
    background-color: rgba(40, 167, 69, 0.12);
    color: var(--primary-color) !important;
    font-weight: 600;
  }


  .hero-section {
    padding: 60px 0 50px 0;
    min-height: auto;
    text-align: center;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 20px;
  }
  .hero-img {
    margin-top: 30px;
    max-width: 85%;
    margin-left: auto;
    margin-right: auto;
  }
  .page-header {
    padding: 30px 0 40px 0;
  }
}

@media (max-width: 767.98px) {
  .hero-title {
    font-size: 1.8rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .card-guru img {
    height: 200px;
  }
  .page-header {
    padding: 25px 0 35px 0;
  }
  .page-header h2, .page-header h1 {
    font-size: 1.4rem;
  }
  .page-header p.lead {
    font-size: 0.85rem;
  }
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  /* Mengatur tampilan gambar utama agar tidak terlalu besar di mobile */
  .hero-img {
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
  .row {
    margin-left: 0;
    margin-right: 0;
  }
  .col-12 {
    padding-left: 10px;
    padding-right: 10px;
  }
  /* Mengatur padding di bagian yang dirasa terlalu luas di mobile */
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media (max-width: 575.98px) {
  .hero-title {
    font-size: 1.6rem;
  }
  .btn-primary-custom {
    width: 100%;
    margin-bottom: 15px;
  }
  .navbar-brand {
    font-size: 1.1rem;
  }
  .navbar-brand img {
    width: 35px;
    height: 35px;
  }
  /* Bug Fix #4: nav-item styles sudah dikonsolidasi di breakpoint 991px */
  /* Tidak perlu duplikasi di sini agar tidak menimpa padding */

  /* Tabel yang responsif */
  .table-responsive {
    border: 0;
  }
}

/* Memastikan konten gambar dan elemen lainnya tidak melebihi lebar layar */
img, video, canvas, iframe {
  max-width: 100%;
  height: auto;
}

/* Bug Fix #2: Efek zoom HANYA untuk konten, bukan navbar/UI elements */
.container img:not(.navbar-brand img),
section img,
.card img,
.card-guru img {
  transition: transform 0.4s ease-in-out;
}
.container img:not(.navbar-brand img):hover,
section img:hover,
.card img:hover,
.card-guru img:hover {
  transform: scale(1.05);
}

/* Memperbaiki scroll horizontal jika ada elemen yang keluar dari flow dokumen */
body {
  overflow-x: hidden;
}
