/* ==========================================================================
   CSS MASTER THEME: BLUE MADRASAH - KAK YUSUF
   
   DAFTAR ISI:
   1. Variabel Global (Root)
   2. Base & Reset (Body, Main)
   3. Utilities & Global Classes
   4. Navbar & Dropdown Menu
   5. Hero & Carousel
   6. Komponen Card & Element
   7. Sections (Statistik, Kategori, Testimoni)
   8. Galeri & Media (Foto, Video, Poster)
   9. Fitur Khusus (Chat WA)
   10. Footer
   11. Responsive (Media Queries)
   12. Buku Tamu
   ========================================================================== */

/* ==========================================================================
   1. VARIABEL GLOBAL (ROOT)
   ========================================================================== */
:root {
  --biru-primer: #1e3c72;
  --biru-sekunder: #2a5298;
  --aksen-kuning: #ffc107;
  --putih: #ffffff;
  --bg-light: #f8f9fa;
  --text-dark: #333;
  --biru-soft: #f0f7ff; /* Tambahan untuk konsistensi */
  --primary-color: #0d6efd; /* Diambil dari beberapa style */
}

/* ==========================================================================
   2. BASE & RESET
   ========================================================================== */
html, body {
  height: 100%; 
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

main {
  flex: 1 0 auto; 
  padding-top: 30px;
  padding-bottom: 30px;
  min-height: 60vh;
}

/* ==========================================================================
   3. UTILITIES & GLOBAL CLASSES
   ========================================================================== */
.section-padding { 
    padding: 80px 0; 
}

.bg-light-section {
    background-color: #f8f9fa;
    padding: 60px 0;
}

.divider {
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-title h2 {
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

/* Transisi Global */
.transition-hover {
    transition: all 0.3s ease-in-out;
}

/* ==========================================================================
   4. NAVBAR & DROPDOWN MENU
   ========================================================================== */
.navbar {
  background: var(--putih);
  border-bottom: 3px solid var(--aksen-kuning);
}

.nav-link {
  font-weight: 500;
  position: relative;
  padding: 0.5rem 1rem !important;
}

.nav-link.active {
    color: var(--biru-primer) !important;
    font-weight: 700 !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: var(--aksen-kuning);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after { 
    width: 70%; 
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 10px 0;
    margin-top: 10px;
}

.dropdown-item {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--biru-soft);
    color: var(--biru-primer);
    padding-left: 25px;
}

.dropdown-item.active {
    background-color: var(--biru-primer) !important;
    color: var(--putih) !important;
    font-weight: 600;
}

/* Panah Dropdown Melayang */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--putih);
}

/* Form Input Search */
#search-guru:focus {
    box-shadow: 0 0 0 0.25rem rgba(30, 60, 114, 0.15);
    border-color: var(--biru-primer);
}

.input-group-text {
    background-color: var(--putih);
}

/* ==========================================================================
   5. HERO & CAROUSEL
   ========================================================================== */
#heroCarousel .carousel-item { 
    height: 80vh; 
    min-height: 400px; 
    background: #000; 
}

#heroCarousel img,
.carousel-item img { 
    object-fit: cover; 
    height: 100%; 
    width: 100%; 
    aspect-ratio: 21 / 9;
    transition: transform 10s ease; 
}

#heroCarousel .carousel-item.active img,
.carousel-item.active img { 
    transform: scale(1.05); /* Skala aman digabungkan */
}

/* Animasi Caption Carousel */
.animate-caption {
    transform: translateY(30px);
    transition: all 0.8s ease-in-out;
}

.carousel-item.active .animate-caption {
    
    transform: translateY(0);
}

/* ==========================================================================
   6. KOMPONEN CARD & ELEMENT
   ========================================================================== */
/* Generic Custom Card */
.custom-card {
    transition: all 0.4s ease;
    background: #ffffff;
    border-radius: 20px !important;
}
.custom-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

/* Card Visual Program */
.card-visual {
  border-radius: 20px;
  background: var(--putih);
  border: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  transition: 0.3s;
}
.card-visual:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 15px 30px rgba(30, 60, 114, 0.15); 
}

/* Variasi Efek Card (Hover & Transition) */
.transition-card, .hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.transition-card:hover, .hover-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}
.transition-card:hover img {
    transform: scale(1.1);
}

/* Card Pimpinan & Foto Wrapper */
.card-pimpinan:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.foto-wrapper {
    width: 120px;
    height: 120px;
    margin: 0 auto; /* Tengah */
    overflow: hidden;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.foto-pimpinan {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

/* Wrapper Ikon Bulat (Gabungan dari duplikat) */
.icon-wrapper {
    width: 85px; 
    height: 85px; 
    margin: 0 auto;
    background: var(--putih); 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    position: relative; /* Bisa dioverride di inline html jika butuh absolute */
    border: 5px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    z-index: 5; 
}
.custom-card:hover .icon-wrapper {
    background: var(--primary-color);
}
.icon-wrapper img, .icon-wrapper i {
    font-size: 2.5rem;
    color: var(--primary-color);
    transition: all 0.4s ease;
    width: 40px;
    height: auto;
}
.custom-card:hover .icon-wrapper i,
.custom-card:hover .icon-wrapper img {
    filter: brightness(0) invert(1);
}

/* ==========================================================================
   7. SECTIONS SPESIFIK
   ========================================================================== */
/* --- Statistik Section --- */
#statistik {
    background-image: linear-gradient(rgba(13, 110, 253, 0.9), rgba(13, 110, 253, 0.9));
    background-size: cover;
    background-attachment: fixed;
    color: white;
    text-align: center;
}
#statistik .section-title h2 {
    color: white;
}
#statistik .section-title h2::before {
    background-color: white;
}
.stat-item {
    text-align: center;
    padding: 30px;
    background: #dcdbe7;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(48, 4, 204, 0.05);
    transition: 0.3s;
}
.stat-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
.stat-item i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
}
.stat-item .counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}
.stat-item p {
    color: #666;
    font-weight: 500;
    margin-bottom: 0;
}

/* --- Kategori Section --- */
#kategori {
    background-image: linear-gradient(rgba(13, 110, 253, 0.9), rgba(13, 110, 253, 0.9));
    background-size: cover;
    background-attachment: fixed;
    color: white;
    text-align: center;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    background-color: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    height: 100%; 
}
.category-card i {
    font-size: 2.5rem;
    color: #0D8ABC;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}
.category-card h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}
.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(13, 138, 188, 0.15); 
    border-color: #0D8ABC;
    color: #0D8ABC;
}
.category-card:hover i {
    transform: scale(1.15);
}

/* --- Testimoni Section --- */
.testimoni-slider {
    padding-bottom: 50px; 
}
.testimoni-slider .swiper-slide {
    height: auto; 
}
.testimoni-slider .swiper-pagination-bullet {
    background-color: #0d8abc; 
    transition: all 0.3s ease;
}
.testimoni-slider .swiper-pagination-bullet-active {
    
    width: 25px;
    border-radius: 10px;
}
.testimoni-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow: hidden;
}
.testimoni-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(13, 138, 188, 0.1);
}
.quote-icon {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 4rem;
    color: #0d8abc;
    z-index: -1;
    transition: transform 0.4s ease;
}
.testimoni-card:hover .quote-icon {
    transform: scale(1.1) rotate(5deg);
    animation: floatIcon 2s ease-in-out infinite alternate;
}
@keyframes floatIcon {
    0% { transform: translateY(0) scale(1.1) rotate(5deg); }
    100% { transform: translateY(-5px) scale(1.1) rotate(5deg); }
}
.testimoni-text {
    font-style: italic;
    color: #555555;
    line-height: 1.7;
    flex-grow: 1; 
    margin-bottom: 25px;
    font-size: 0.95rem;
}
.testimoni-user {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
    margin-top: auto;
}
.testimoni-user img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0f2fe;
}
.testimoni-user h6 {
    margin: 0 0 3px 0;
    font-weight: 600;
    font-size: 1rem;
    color: #2c3e50;
}
.testimoni-user small {
    color: #888888;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==========================================================================
   8. GALERI & MEDIA
   ========================================================================== */
/* Galeri Foto */
.gallery-item {
    display: block;
    transition: transform 0.4s ease;
}
.gallery-item:hover {
    transform: scale(1.05); 
    z-index: 2;
}
.gallery-img {
    transition: filter 0.3s ease;
}
.gallery-img:hover {
    filter: brightness(90%); 
}
.gallery-img-square {
    width: 100%;
    aspect-ratio: 1 / 1; 
    object-fit: cover;  
    border-radius: 12px;
    transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-img-square {
    transform: scale(1.05); 
}

/* Galeri Video Thumbnail */
.video-thumbnail-card {
    display: block;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.video-thumbnail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.video-thumbnail-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}
.video-thumbnail-card:hover img {
    transform: scale(1.05);
}
.play-icon-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    transition: background 0.3s ease;
}
.video-thumbnail-card:hover .play-icon-overlay {
    background: rgba(0, 0, 0, 0.6);
}
.play-icon-overlay i {
    font-size: 4rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Poster Slider Vertikal */
.poster-slider-container {
    height: 450px;
    overflow: hidden;
}
.poster-slider .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.poster-slider .swiper-pagination-vertical.swiper-pagination-bullets {
    right: 10px; left: auto; top: 50%;
    transform: translateY(-50%);
}
.poster-slider .swiper-pagination-bullet {
    background-color: var(--primary-color);
}
.poster-slider .swiper-pagination-bullet-active {
    opacity: 1;
}
.poster-box {
    height: 400px; 
    overflow: hidden;
    position: relative;
    border-radius: 10px; 
}
.swiper-slide img.img-main-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.img-blur-bg {
    display: none;
}

/* ==========================================================================
   9. FITUR KHUSUS
   ========================================================================== */
/* Chat Modal (WA Style) */
.chat-container {
  height: 400px; 
  overflow-y: auto; 
  background-color: #e5ddd5;
  background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
}
.bubble { 
    max-width: 80%; 
    padding: 10px 14px; 
    margin-bottom: 5px; 
    border-radius: 15px; 
}
.bubble-siswa { 
    background-color: #dcf8c6; 
    margin-left: auto; 
}
.bubble-panitia { 
    background-color: #ffffff; 
    margin-right: auto; 
}

/* ==========================================================================
   10. FOOTER
   ========================================================================== */
footer { 
    border: 2px solid var(--aksen-kuning); 
}
.main-footer {
  flex-shrink: 0; 
  background: linear-gradient(135deg, var(--biru-primer) 0%, var(--biru-sekunder) 100%);
  color: var(--putih);
  padding-top: 60px;
  width: 100%;
}
.footer-title { 
    color: var(--aksen-kuning); 
    font-weight: 700; 
    margin-bottom: 25px; 
}
.footer-link { 
    color: rgba(255,255,255,0.7); 
    text-decoration: none; 
    display: block; 
    margin-bottom: 10px; 
    transition: 0.3s; 
}
.footer-link:hover { 
    color: var(--aksen-kuning); 
    padding-left: 5px; 
}
.sosmed-icon {
  width: 38px; height: 38px; 
  background: rgba(255,255,255,0.1);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: white; transition: 0.3s;
}
.sosmed-icon:hover { 
    background: var(--aksen-kuning); 
    color: var(--biru-primer); 
}
.footer-bottom {
  background: rgba(0,0,0,0.2);
  padding: 20px 0;
  margin-top: 50px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ==========================================================================
   11. RESPONSIVE UTILITIES (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 768px) {
  #heroCarousel .carousel-item { 
      height: 350px; 
      min-height: auto;
  }
}

/* ==========================================================================
   12. BUKU TAMU
   ========================================================================== */
/* --- PERLINDUNGAN SPAM --- */
    .honeypot-field {
        position: absolute;
        left: -9999px;
        top: -9999px;
        visibility: hidden;
    }

    /* --- BACKGROUND & WRAPPER --- */
    .guestbook-wrapper {
        /* Menggunakan variabel warna dari styleyusuf.css */
        background: linear-gradient(135deg, var(--bg-light) 0%, #e2e8f0 100%);
        position: relative;
        overflow: hidden;
        padding: 40px 0;
    }

    /* --- CARD & SPLIT LAYOUT --- */
    .card-custom {
        border-radius: 20px;
        backdrop-filter: blur(12px);
        background-color: rgba(255, 255, 255, 0.98);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
        transition: transform 0.4s ease, box-shadow 0.4s ease;
        z-index: 1;
    }
    .card-custom:hover {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    }
    
    /* Panel Info Kiri */
    .info-panel {
        background: linear-gradient(145deg, var(--biru-primer) 0%, var(--biru-sekunder) 100%);
        border-top-left-radius: 20px;
        border-bottom-left-radius: 20px;
        color: var(--putih);
    }
    @media (max-width: 767.98px) {
        .info-panel {
            border-bottom-left-radius: 0;
            border-top-right-radius: 20px;
        }
    }

    /* --- INPUT FORM STYLE --- */
    .form-control-custom {
        border-radius: 10px;
        border: 2px solid #e9ecef;
        padding: 12px 16px;
        background-color: #f8f9fa;
        transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
    .form-control-custom:focus {
        background-color: var(--putih);
        border-color: var(--primary-color);
        box-shadow: 0 8px 20px rgba(13, 110, 253, 0.08);
        transform: translateY(-2px);
    }

    .input-group-text-custom {
        border: 2px solid #e9ecef;
        border-right: none;
        background-color: #f8f9fa;
        border-radius: 10px 0 0 10px;
        color: #6c757d;
        transition: all 0.3s ease;
    }
    .input-group:focus-within .input-group-text-custom {
        background-color: var(--primary-color);
        color: var(--putih);
        border-color: var(--primary-color);
    }
    .input-group:focus-within .form-control-custom {
        border-left-color: var(--primary-color);
    }

    /* --- BUTTON & ANIMASI --- */
    .btn-animate {
        border-radius: 10px;
        padding: 12px;
        font-weight: 600;
        letter-spacing: 0.5px;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        background-color: var(--primary-color);
        border: none;
        color: white;
    }
    .btn-animate:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 10px 20px rgba(13, 110, 253, 0.3);
        background-color: var(--biru-primer);
        color: white;
    }
    .btn-animate:active {
        transform: translateY(-1px) scale(0.99);
    }

    @keyframes slowBounce {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }
    .icon-bounce {
        display: inline-block;
        animation: slowBounce 3s infinite ease-in-out;
    }