/*1. VARIABEL & RESET --- */
:root {
    --color-primary: #0a7549;    /* Hijau Tua */
    --color-secondary: #FFD700;  /* Emas */
    --color-accent: #28a745;     /* Hijau Cerah */
    --color-text: #333333;
    --color-light: #f8f9fa;
    --color-background: #ffffff;
    --color-krem: #f9f6f1;
   
    --font-heading: 'Merriweather', serif;
    --font-body: 'Poppins', sans-serif;
   
    --spacing-large: 80px;
    --spacing-medium: 40px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-background);
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- 2. TYPOGRAPHY & GLOBAL --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.3;
}

h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 1em;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    margin: 15px auto 0;
}

.section-padded { padding: var(--spacing-large) 0; }
.bg-light { background-color: var(--color-krem); }
.section-description { text-align: center; margin-bottom: var(--spacing-medium); font-size: 1.1em; color: #555; }

/* --- 3. HEADER & NAVIGASI --- */
header {
    background-color: #2c2c2c; /* Warna hitam keabu-abuan */
    padding: 10px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo { height: 45px; transition: 0.3s; }

#main-nav ul {
    list-style: none;
    display: flex;
    gap: 35px;
}

#main-nav ul li a {
    color: #ffffff; /* Warna teks putih */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#main-nav ul li a:hover {
    color: #4CAF50; /* Warna hijau saat kursor menempel (opsional) */
}
.nav-toggle {
    color: #ffffff; /* Warna ikon garis tiga jadi putih */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- 4. HERO SECTION --- */
#home.hero {
    position: relative;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
}

#home.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55); /* Gelap agar teks terbaca */
    z-index: 2;
}

.hero-slider {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slider img.active { opacity: 1; }

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 850px;
    padding: 20px;
}

.hero-content h1 {
    font-size: clamp(2.5em, 5vw, 4em);
    color: #fff;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

.hero-content h3 {
    font-size: clamp(1.2em, 3vw, 1.8em);
    color: var(--color-secondary);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1em;
    margin-bottom: 30px;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}

/* --- 5. BUTTONS --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    border: 2px solid transparent;
}

.primary-btn {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    animation: pulse-green 2s infinite;
}

.primary-btn:hover { background: var(--color-accent); border-color: var(--color-accent); transform: translateY(-2px); }

.secondary-btn {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.secondary-btn:hover { background: #fff; color: var(--color-primary); }

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 2000;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 18px;
    max-width: 1100px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 2rem;
    cursor: pointer;
}

.brochure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.a4-sheet {
    background: #fdfdfd;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.a4-sheet img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.414;
    object-fit: contain;
    border-radius: 12px;
}

.hidden {
    display: none !important;
}

/* --- FLOATING WHATSAPP POPUP --- */
.whatsapp-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(16, 46, 31, 0.2);
    z-index: 1500;
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whatsapp-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
}

.whatsapp-popup-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.whatsapp-popup-header {
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.whatsapp-popup-header i {
    font-size: 1.8rem;
}

.whatsapp-popup-header p {
    margin: 0;
    font-size: 1rem;
}

.whatsapp-popup-options {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whatsapp-option {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 12px;
    background: #f5f5f5;
    text-decoration: none;
    color: var(--color-deep);
    transition: all 0.25s ease;
    border: 1px solid #e0e0e0;
}

.whatsapp-option:hover {
    background: #e8f5e9;
    border-color: #25d366;
    transform: translateX(4px);
}

.whatsapp-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.whatsapp-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.whatsapp-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-deep);
}

.whatsapp-number {
    font-size: 0.82rem;
    color: #666;
    margin-top: 8px;
}

.whatsapp-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-deep);
}

.whatsapp-number {
    font-size: 0.82rem;
    color: #666;
    margin-top: 4px;
}

@media (max-width: 480px) {
    .whatsapp-popup {
        width: calc(100% - 24px);
        right: 12px;
        bottom: 12px;
    }
}

/* --- FLOATING CONTACT BUTTON --- */
.floating-contact-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1400;
    transition: all 0.3s ease;
}

.floating-contact-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 16px 45px rgba(37, 211, 102, 0.4);
}

.floating-contact-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .floating-contact-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

/* --- 6. GRIDS (ABOUT, EKSKUL, GALERI) --- */
/* --- PERBAIKAN TENTANG KAMI --- */

/* 1. Styling Icon agar Besar dan Berwarna */
.icon-large {
    font-size: 4em;             /* Ukuran diperbesar dari sebelumnya */
    color: var(--color-accent); /* Menggunakan Hijau Cerah agar menonjol */
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.3s ease;
}

/* 2. Styling Kartu (About Item) */
.about-item {
    background: #ffffff;
    padding: 40px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* Shadow lebih halus */
    text-align: center;
    border-top: none; /* Kita ganti garis atas dengan efek lain */
    border-bottom: 4px solid var(--color-primary); /* Garis di bawah agar lebih modern */
    transition: all 0.3s ease;
}

.about-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.about-item:hover .icon-large {
    transform: scale(1.1) rotate(5deg); /* Efek sedikit berputar saat disorot */
    color: var(--color-primary);        /* Berubah warna saat hover */
}

/* 3. Merapikan Judul dan Teks dalam Kartu */
.about-item h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--color-primary);
}

.about-item p {
    font-size: 0.95em;
    color: #666;
    line-height: 1.7;
}

/* 4. Merapikan List Keunggulan */
.check-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    text-align: left; /* Teks list tetap rata kiri agar rapi */
}

.check-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9em;
}

.check-list li i {
    color: var(--color-accent);
    margin-top: 4px;
}

/* --- PERBAIKAN EKSKUL (RESPONSIVE) --- */

.ekskul-wrapper {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* --- PERBAIKAN TOTAL EKSKUL UNTUK MOBILE --- */

.ekskul-detail {
    display: flex;
    align-items: center; /* Tengah vertikal di desktop */
    gap: 30px;
    background: #ffffff;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    width: 100%; /* Pastikan lebar penuh */
}

/* Selang-seling kiri-kanan hanya di desktop */
.ekskul-detail:nth-child(even) {
    flex-direction: row-reverse;
}

.ekskul-text {
    flex: 1;
    min-width: 0; /* Mencegah teks meluap */
}

/* WADAH GAMBAR: Ini kuncinya agar tidak 0px di HP */
.ekskul-slider-container {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 280px; /* Memberi tinggi minimum agar tidak hilang */
    height: 300px;     /* Tinggi tetap di desktop */
    border-radius: 12px;
    overflow: hidden;
    background-color: #f0f0f0; /* Warna cadangan jika gambar belum muncul */
}

.ekskul-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Agar foto tidak gepeng */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

/* Class active yang digerakkan JavaScript */
.ekskul-slider img.active {
    opacity: 1;
    z-index: 2;
}


/* Galeri 9 Slots */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.gallery-item { overflow: hidden; border-radius: 10px; height: 250px; }
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: 0.5s; filter: grayscale(30%);
}
.gallery-item img:hover { transform: scale(1.1); filter: grayscale(0); }

/* --- 7. FORM & PENDAFTARAN --- */
.registration-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-column { background: #fff; padding: 25px; border-radius: 10px; box-shadow: var(--shadow); border-left: 5px solid var(--color-secondary); }

.registration-form-section {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 900px;
    margin: 0 auto;
}

.form-grid { display: grid; gap: 20px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--color-primary); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-family: inherit;
}

.full-width { width: 100%; }

/* --- 8. KONTAK & FOOTER --- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.social-buttons { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.social-btn {
    padding: 10px 20px; border-radius: 5px; color: #fff; text-decoration: none;
    font-weight: 600; display: flex; align-items: center; gap: 8px; transition: 0.3s;
}
.social-btn:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

.wa { background: #25d366; }
.ig { background: #e1306c; }
.tt { background: #000; }

footer { background: var(--color-primary); color: #fff; padding: 40px 0; text-align: center; }

/* --- STYLING PROGRAM PENDIDIKAN --- */
#program {
    background-color: #f9f9f9; /* Warna background tipis agar beda dengan section lain */
}

.program-wrapper {
    display: flex;
    flex-direction: column;
    gap: 60px; /* Jarak antar program */
    margin-top: 40px;
}

.program-detail {
    display: flex;
    align-items: center;
    gap: 50px;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Membuat tampilan selang-seling */
.program-detail:nth-child(even) {
    flex-direction: row-reverse;
}

.program-text {
    flex: 1;
}

.program-text h3 {
    color: #2c5530; /* Hijau khas pesantren */
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-family: 'Merriweather', serif;
}

.program-text p {
    line-height: 1.8;
    color: #555;
    font-size: 1.05rem;
}

/* Container Slider Foto Program */
.program-slider-container {
    flex: 1;
    position: relative;
    height: 350px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.program-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.program-slider img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 0;
}

.program-slider img.active {
    opacity: 1;
    z-index: 1;
}

@media (max-width: 768px) {
    .program-detail,
    .program-detail:nth-child(even),
    .ekskul-detail,
    .ekskul-detail:nth-child(even) {
        flex-direction: column !important;
        padding: 15px !important;
        gap: 20px !important;
        align-items: stretch !important;
    }

    .program-text,
    .ekskul-text {
        width: 100% !important;
        order: 1;
    }

    .program-slider-container,
    .ekskul-slider-container {
        width: 100% !important;
        height: 280px !important;
        min-height: 280px !important;
        order: 2;
        display: block !important;
        position: relative !important;
        overflow: hidden;
        border-radius: 12px;
        background-color: #f0f0f0;
    }

    .program-slider img,
    .ekskul-slider img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
}


/* --- 9. ANIMASI --- */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* --- 10. RESPONSIVE --- */
@media (max-width: 992px) {
    /* 1. Sembunyikan Navigasi secara total sebelum tombol ditekan */
    #main-nav {
        display: none; /* Kunci utama: Menghilangkan dari layar */
        position: absolute;
        top: 100%; /* Muncul tepat di bawah header */
        left: 0;
        width: 100%;
        background-color: #2c2c2c;
        flex-direction: column;
        box-shadow: 0 10px 15px rgba(0,0,0,0.4);
        z-index: 999;
    }

    /* 2. Tampilkan HANYA saat ada class active dari JavaScript */
    #main-nav.active {
        display: block !important; /* Memaksa muncul saat diklik */
    }

    /* 3. Rapikan list di dalamnya agar tidak melebar berantakan */
    #main-nav ul {
        flex-direction: column;
        gap: 0; /* Reset gap desktop agar tidak renggang di laci */
        width: 100%;
        padding: 0;
    }

    #main-nav ul li {
        width: 100%;
        border-bottom: 1px solid #3d3d3d;
    }

    #main-nav ul li a {
        display: block;
        padding: 15px 20px;
        color: #ffffff !important;
        text-align: center;
        width: 100%;
    }
}
@media (max-width: 600px) {
    .form-row-2 { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2rem; }
}



footer {
    background-color: var(--color-primary); /* Hijau tua pesantren */
    color: #fff;
    padding: 40px 0 20px;
    text-align: center;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

/* Warna spesifik saat di-hover */
.social-icon.wa:hover { background-color: #25d366; transform: translateY(-5px); }
.social-icon.ig:hover { background-color: #e1306c; transform: translateY(-5px); }
.social-icon.tt:hover { background-color: #000000; transform: translateY(-5px); }

.footer-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 20px auto;
    width: 150px;
}

footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}




/* --- CONTACT GRID (DESKTOP) --- */
.contact-grid {
    display: flex;
    flex-direction: row;      /* Pastikan sejajar ke samping */
    gap: 50px;
    align-items: stretch;     /* Biar tinggi Maps sama dengan tinggi Teks */
    margin-top: 40px;
}

.contact-info {
    flex: 1;                  /* Lebar 50% */
}

.google-map {
    flex: 1;                  /* Lebar 50% */
}

.map-container {
    height: 100%;             /* Mengikuti tinggi kontainer induk */
    min-height: 400px;        /* Tinggi minimal di desktop */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

/* --- RESPONSIVE MOBILE (HP) --- */
@media (max-width: 992px) {
    .contact-grid {
        flex-direction: column !important; /* Paksa tumpuk ke bawah */
        gap: 30px;
    }

    .contact-info {
        order: 1;              /* Teks di atas */
        width: 100%;
    }

    .google-map {
        order: 2;              /* Maps di bawah teks & sosmed */
        width: 100%;
    }

    .map-container {
        height: 300px;         /* Tinggi lebih pendek di HP */
        min-height: 300px;
        pointer-events: none;  /* Agar tidak menghambat scroll jari di HP */
    }

    /* Peta aktif saat diklik (butuh JS) atau gunakan ini agar aman */
    .google-map:active .map-container {
        pointer-events: auto;
    }
}

