/* =========================================
   1. SETUP & TYPOGRAPHY
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Poppins:wght@300;400;500;600&display=swap');

:root {
    --primary: #064e3b;      /* Hijau Tua Deep */
    --secondary: #10b981;    /* Hijau Emerald Cerah */
    --accent: #d1fae5;       /* Hijau Mint Muda */
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --white: #ffffff;
}

html, body {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    background-color: #f8fafc;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);
}

/* =========================================
   2. NAVBAR SLIM & MODERN (FIXED)
   ========================================= */
.navbar {
    background-color: var(--primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    /* Padding dikecilkan biar navbar 'Slim' */
    padding: 8px 0 !important; 
    transition: all 0.3s ease;
    /* Pastikan navbar punya tinggi minimum tapi tidak kegedean */
    min-height: 70px;
}

.navbar-brand-logo-wrap {
    background: #ffffff;
    border-radius: 50px;
    padding: 4px 10px; /* Padding logo pas */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    margin-right: 10px;
}

.navbar-brand-logo {
    height: 40px; /* Tinggi Logo dibatasi biar navbar gak melar */
    width: auto;
}

.navbar-brand-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.15rem;
    color: #fff;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0 15px !important;
    color: rgba(255,255,255,0.9) !important;
}
.nav-link:hover {
    color: var(--secondary) !important;
}

/* Tombol Donasi & Admin di Navbar */
.btn-donasi {
    background: linear-gradient(45deg, var(--secondary), #059669);
    border: none;
    color: white !important;
    border-radius: 50px;
    padding: 6px 20px;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: transform 0.3s;
}
.btn-donasi:hover {
    background: linear-gradient(45deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

/* =========================================
   3. HERO SECTION (CARD FLOATING)
   ========================================= */
#beranda {
    background-color: var(--primary);
    /* Pattern Halus */
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.3) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.3) 0px, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2310b981' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    
    /* Layout */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;

    /* PENTING: Jarak atas ditambah supaya tidak ketutup Navbar Fixed */
    padding-top: 130px; 
    padding-bottom: 80px;
}

.hero-cards-wrapper {
    max-width: 900px;
    width: 92%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Animasi Melayang */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* Kartu Kop (Atas) */
.hero-kop-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 4px solid var(--secondary);
    animation: float 6s ease-in-out infinite;
}

/* Kartu Konten (Bawah) */
.hero-main-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: float 6s ease-in-out infinite;
    animation-delay: 1s; /* Gerak gantian */
}

.hero-kop-img { max-width: 80%; height: auto; }
.hero-calligraphy-img { width: 100%; max-width: 500px; height: auto; margin-bottom: 1.5rem; }

.hero-desc-text {
    font-family: 'Poppins', sans-serif;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Tombol di Hero */
.btn-hero-green {
    background-color: var(--secondary);
    color: #fff;
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    transition: all 0.3s;
    border: 2px solid var(--secondary);
    text-decoration: none;
}
.btn-hero-green:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-3px);
    color: #fff;
}

.btn-hero-outline {
    background: transparent;
    color: var(--secondary);
    border: 2px solid var(--secondary);
    border-radius: 50px;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}
.btn-hero-outline:hover {
    background: var(--secondary);
    color: #fff;
    transform: translateY(-3px);
}

/* =========================================
   4. STATS COUNTER
   ========================================= */
.bg-white { background-color: #ffffff !important; }
.text-success { color: var(--secondary) !important; }
.border-right { border-right: 1px solid #e5e7eb; }

/* =========================================
   5. PROFIL SECTION (SPLIT)
   ========================================= */
#profil {
    padding: 100px 0;
    background-color: #fff;
}

.profile-img-box {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.profile-img-box img {
    width: 100%; transition: transform 0.5s;
}
.profile-img-box:hover img { transform: scale(1.05); }

.profile-content h2 {
    font-size: 2.5rem; margin-bottom: 1.5rem; position: relative; display: inline-block;
}
.profile-content h2::after {
    content: ''; position: absolute; width: 60px; height: 4px;
    background-color: var(--secondary); bottom: -10px; left: 0; border-radius: 2px;
}
.profile-text {
    font-size: 1rem; line-height: 1.8; color: #555; margin-bottom: 2rem; text-align: justify;
}

.feature-box {
    background: #f9fafb; padding: 20px; border-radius: 15px;
    border-left: 4px solid var(--secondary); margin-bottom: 15px; transition: 0.3s;
}
.feature-box:hover { background: #f0fdf4; transform: translateX(5px); }
.feature-box h5 { font-size: 1.1rem; margin-bottom: 5px; }

/* =========================================
   6. BUKU SECTION (MODERN)
   ========================================= */
#buku {
    padding: 100px 0;
    background-color: #f3f4f6;
}

.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 10px; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

.book-card-modern {
    position: relative; border-radius: 15px; overflow: hidden;
    height: 380px; box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    cursor: pointer; background-color: #fff; transition: transform 0.3s;
}
.book-card-modern:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }
.book-card-modern img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.book-card-modern:hover img { transform: scale(1.1); }

.book-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 25px 20px;
    background: linear-gradient(to top, rgba(6, 78, 59, 0.95) 0%, rgba(6, 78, 59, 0.5) 50%, transparent 100%);
    color: white; display: flex; flex-direction: column; justify-content: flex-end;
    height: 100%; transition: all 0.4s ease;
}
.book-title-overlay {
    font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.2rem;
    margin-bottom: 5px; text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    transition: transform 0.4s; transform: translateY(20px);
}
.book-author-overlay {
    font-size: 0.9rem; opacity: 0.95; margin-bottom: 15px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.6);
    transition: transform 0.4s; transform: translateY(20px);
}
.book-card-modern:hover .book-title-overlay,
.book-card-modern:hover .book-author-overlay { transform: translateY(0); }

.book-btn-wrapper {
    max-height: 0; opacity: 0; overflow: hidden; transition: all 0.5s ease; transform: translateY(20px);
}
.book-card-modern:hover .book-btn-wrapper { max-height: 60px; opacity: 1; transform: translateY(0); }

.btn-detail-modern {
    background-color: #fff; color: var(--primary); border-radius: 50px;
    padding: 8px 25px; font-weight: 700; display: inline-block;
    text-decoration: none; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.btn-detail-modern:hover { background-color: var(--secondary); color: #fff; text-decoration: none; }

/* =========================================
   7. KONTAK SECTION
   ========================================= */
#kontak { padding: 100px 0; background-color: #fff; }

.contact-card {
    background: #fff; padding: 40px; border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08); border: 1px solid #f0f0f0;
}
.contact-item { display: flex; align-items: flex-start; margin-bottom: 30px; }
.contact-icon {
    width: 50px; height: 50px; background-color: var(--accent); color: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-right: 20px; flex-shrink: 0;
}
.contact-text h6 { margin-bottom: 5px; font-weight: 700; color: var(--primary); }
.contact-text p { margin: 0; color: #666; font-size: 0.95rem; }

.form-control-custom {
    background-color: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 15px; height: auto;
}
.form-control-custom:focus {
    background-color: #fff; border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    background-color: #022c22; color: #e5e7eb;
    padding: 70px 0 30px; font-size: 0.95rem;
}
footer h5 { color: #fff; margin-bottom: 25px; font-size: 1.3rem; }
footer a { color: #9ca3af; transition: 0.3s; text-decoration: none; }
footer a:hover { color: var(--secondary); padding-left: 5px; }
.footer-bottom {
    margin-top: 50px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center; font-size: 0.85rem; color: #6b7280;
}

/* =========================================
   9. MOBILE RESPONSIVE (HP)
   ========================================= */
@media (max-width: 991px) {
    /* Navbar HP lebih tipis */
    .navbar { min-height: 60px; padding: 5px 0 !important; }
    
    /* Logo HP lebih kecil */
    .navbar-brand-logo { height: 35px; }
    .navbar-brand-text { font-size: 1rem; }

    /* Dropdown Menu */
    .navbar-collapse {
        background-color: var(--primary);
        position: absolute; top: 100%; left: 0; width: 100%;
        padding: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .navbar-nav .nav-item { margin-bottom: 10px; text-align: center; }
    .btn-donasi { display: block; width: 100%; max-width: 250px; margin: 10px auto; text-align: center; }

    /* Fix Hero Section HP */
    #beranda {
        /* Padding atas disesuaikan dengan navbar HP (60px) + Jarak Aman */
        padding-top: 90px; 
        padding-bottom: 50px;
        min-height: auto;
    }
    
    .hero-cards-wrapper { width: 95%; margin-top: 10px; }
    .hero-kop-card { padding: 1.2rem; margin-bottom: 15px; }
    .hero-main-card { padding: 2rem 1.5rem; }
    
    .hero-desc-text { font-size: 0.95rem; }
    .btn-hero-green, .btn-hero-outline { width: 100%; display: block; margin: 5px 0 !important; }

    /* Stats di HP jadi vertical */
    .border-right { border-right: none; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 15px; }
    .col-4 { flex: 0 0 100%; max-width: 100%; }

    /* Profil di HP */
    .profile-content h2 { font-size: 2rem; text-align: center; display: block; }
    .profile-content h2::after { left: 50%; transform: translateX(-50%); }
    .profile-text { text-align: center; }
    
    /* Buku 2 Kolom di HP */
    .book-card-modern { height: 260px !important; }
    .book-title-overlay { font-size: 0.9rem; transform: translateY(0); margin-bottom: 3px; }
    .book-author-overlay { font-size: 0.75rem; transform: translateY(0); margin-bottom: 10px; }
    .book-btn-wrapper { max-height: 40px; opacity: 1; transform: translateY(0); }
    .btn-detail-modern { padding: 4px 15px; font-size: 0.75rem; width: 100%; text-align: center; box-shadow: none; }
}