/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary: #145038;   /* Hijau Zamrud */
    --gold: #c5a059;      /* Emas Kerajaan */
    --wood: #5d4037;      /* Coklat Kayu */
    --cream: #fbf7f0;     /* Krem Kertas */
    --sidebar-width: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--cream);
    color: #333;
    overflow-x: hidden;
    /* Batik Pattern untuk Halaman Depan */
    background-image: radial-gradient(var(--gold) 1px, transparent 1px), radial-gradient(var(--gold) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
}

/* TYPOGRAPHY */
h1, h2, h3, h4 { font-family: 'Cinzel', serif; color: var(--primary); }
.arabic { font-family: 'Amiri', serif; line-height: 1.8; }
a { text-decoration: none; transition: 0.3s; }

/* =========================================
   2. ADMIN DASHBOARD STYLES (PRIORITAS PERBAIKAN)
   ========================================= */

/* Body khusus admin: Reset background batik, pakai flexbox */
body.admin-body { 
    background: #f4f6f9; 
    background-image: none; /* Hapus batik di admin */
    display: flex; 
    flex-direction: row; 
    min-height: 100vh;
    margin: 0;
}

/* Sidebar Hijau Kiri */
.sidebar {
    width: var(--sidebar-width); 
    background: var(--primary); 
    color: white;
    position: fixed; 
    height: 100%; 
    left: 0; top: 0; 
    padding-top: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1); 
    z-index: 1000;
}

.sidebar-header { 
    text-align: center; padding-bottom: 20px; 
    border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; 
}
.sidebar-header h3 { color: var(--gold); margin: 0; font-size: 1.5em; }

.menu-item { 
    display: block; padding: 15px 25px; color: #ccc; text-decoration: none; 
    border-left: 4px solid transparent; font-size: 1em;
}
.menu-item:hover, .menu-item.active { 
    background: rgba(0,0,0,0.2); color: white; border-left-color: var(--gold); 
}

/* Konten Kanan Admin */
.main-content { 
    margin-left: var(--sidebar-width); 
    flex: 1; 
    padding: 30px; 
    width: 100%; 
}

.admin-card { 
    background: white; border-radius: 10px; padding: 25px; 
    box-shadow: 0 2px 15px rgba(0,0,0,0.05); margin-bottom: 30px; 
}

/* Form Admin */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; color: var(--wood); }
.form-control { 
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; display: block; 
}

.btn-submit { 
    background: var(--primary); color: white; border: none; padding: 10px 20px; 
    border-radius: 5px; cursor: pointer; width: 100%; font-weight: bold; margin-top: 10px;
}
.btn-submit:hover { background: var(--wood); }

/* Tabel Admin */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.admin-table th { background: #f8f9fa; padding: 12px; text-align: left; color: #555; border-bottom: 2px solid var(--gold); }
.admin-table td { padding: 12px; border-bottom: 1px solid #eee; }
.badge { padding: 5px 10px; border-radius: 15px; font-size: 0.8em; color: white; }
.bg-l { background: var(--primary); } .bg-p { background: #d63384; }

/* Login Box */
.login-box { 
    background: white; padding: 30px; border-radius: 10px; width: 90%; max-width: 400px; 
    text-align: center; box-shadow: 0 10px 20px rgba(0,0,0,0.3); border-top: 5px solid var(--gold); margin: 50px auto;
}

/* =========================================
   3. HALAMAN DEPAN (WEBSITE UTAMA)
   ========================================= */

/* NAVBAR */
.navbar {
    background: var(--primary); padding: 15px 0;
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.nav-container {
    max-width: 1200px; margin: auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
}
.nav-logo { 
    color: var(--gold); font-weight: bold; font-size: 1.4em; 
    font-family: 'Cinzel', serif; text-shadow: 1px 1px 2px #000;
}
.nav-links a { color: #e0e0e0; margin-left: 20px; font-weight: 500; font-size: 0.95em; }
.nav-links a:hover { color: var(--gold); }

/* HERO SECTION */
.hero {
    min-height: 85vh;
    background: linear-gradient(rgba(20, 80, 56, 0.9), rgba(93, 64, 55, 0.85)), 
                url('https://www.transparenttextures.com/patterns/arabesque.png');
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: #fff; padding: 40px 20px;
    border-bottom: 5px solid var(--gold);
}
.hero-ornament { font-size: 2em; color: var(--gold); margin-bottom: 10px; }
.bismillah { font-size: 3.5em; color: var(--gold); margin-bottom: 15px; text-shadow: 2px 2px 5px rgba(0,0,0,0.5); }
.hero h2 { color: #fff; font-size: 2.5em; margin-bottom: 20px; letter-spacing: 2px; }

.quote-box {
    background: rgba(0,0,0,0.4); border-left: 4px solid var(--gold); border-right: 4px solid var(--gold);
    padding: 20px; max-width: 700px; margin: 20px auto; border-radius: 10px;
}
.quote-text { font-style: italic; font-size: 1.1em; line-height: 1.6; color: #f0f0f0; }

.btn-cta {
    background: var(--gold); color: var(--primary); padding: 12px 40px; border-radius: 50px;
    margin-top: 30px; font-weight: bold; font-family: 'Cinzel', serif;
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.5); border: 2px solid #fff; display: inline-block;
}
.btn-cta:hover { background: #fff; color: var(--wood); }

/* SECTION GLOBAL */
section { padding: 70px 20px; }
.section-title { text-align: center; margin-bottom: 50px; font-size: 2.2em; color: var(--wood); display: block; }
.title-decoration { display: block; width: 100px; height: 3px; background: var(--gold); margin: 10px auto; }
.center-wrap { text-align: center; max-width: 1200px; margin: auto; }
.history-content { max-width: 800px; margin: 0 auto; line-height: 1.8; color: #555; font-size: 1.1em; text-align: justify; }

/* TREE DIAGRAM */
.tree-section { 
    background: url('https://www.transparenttextures.com/patterns/wood-pattern.png'); 
    border-top: 5px solid var(--wood); overflow-x: auto; 
}
.tree { display: inline-block; min-width: 100%; padding: 20px; text-align: center; white-space: nowrap; }
.tree ul { padding-top: 20px; position: relative; display: flex; justify-content: center; }
.tree li { float: left; text-align: center; list-style-type: none; position: relative; padding: 20px 10px 0 10px; }

.tree li::before, .tree li::after { content: ''; position: absolute; top: 0; right: 50%; border-top: 2px solid var(--wood); width: 50%; height: 20px; }
.tree li::after { right: auto; left: 50%; border-left: 2px solid var(--wood); }
.tree li:only-child::after, .tree li:only-child::before { display: none; }
.tree li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 2px solid var(--wood); border-radius: 0 5px 0 0; }
.tree li:first-child::after { border-radius: 5px 0 0 0; }
.tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid var(--wood); width: 0; height: 20px; }

/* KARTU MEMBER */
.member-card {
    background: #fff; border: 2px solid var(--gold); padding: 10px; width: 140px; border-radius: 15px 15px 0 0;
    display: inline-block; position: relative; box-shadow: 0 5px 10px rgba(0,0,0,0.1); 
    white-space: normal; vertical-align: top;
}
.member-card.laki { border-bottom: 4px solid var(--primary); }
.member-card.perempuan { border-bottom: 4px solid #d63384; }
.member-card.wafat { filter: grayscale(1); opacity: 0.8; background: #eee; }

.img-wrapper {
    width: 65px; height: 65px; margin: 0 auto 5px; border-radius: 50%; 
    border: 3px solid var(--gold); overflow: hidden; background: #f4f4f4;
}
.img-wrapper img { width: 100%; height: 100%; object-fit: cover; }

/* BATIK STRIP */
.batik-strip {
    height: 10px;
    background: repeating-linear-gradient(45deg, var(--primary), var(--primary) 10px, var(--wood) 10px, var(--wood) 20px);
    border-bottom: 2px solid var(--gold);
}

/* AUDIO CONTROL */
.audio-control {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--primary); color: var(--gold); padding: 10px 15px; border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); cursor: pointer; z-index: 2000;
    display: flex; align-items: center; gap: 10px; border: 2px solid var(--gold);
}
.equalizer { display: flex; gap: 3px; height: 15px; align-items: flex-end; }
.bar { width: 3px; background: var(--gold); animation: bounce 1s infinite; }
@keyframes bounce { 0%, 100% { height: 5px; } 50% { height: 15px; } }

/* GALERI & FOOTER */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
.gallery-item { border: 4px solid var(--gold); border-radius: 10px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.2); aspect-ratio: 1/1;}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.gallery-item:hover img { transform: scale(1.1); }
footer { background: var(--wood); color: #e0e0e0; text-align: center; padding: 20px; border-top: 4px solid var(--gold); margin-top: auto;}

/* RESPONSIF HP */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; }
    .sidebar { width: 60px; }
    .sidebar-header h3, .menu-text { display: none; }
    .main-content { margin-left: 60px; padding: 15px; }
    .menu-item { text-align: center; font-size: 1.2em; padding: 15px 5px;}
}