/* ==========================================================================
   1. VARIABEL WARNA (SMART THEME SYSTEM)
   ========================================================================== */
:root {
    /* Light Mode: Biru & Orange */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-footer: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary: #4a90e2; /* Biru Utama */
    --accent: #ff8c00; /* Orange untuk Aksi */
    --border: #e2e8f0;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --transition: 0.3s ease;
}

[data-theme="dark"] {
    /* Dark Mode: Hitam Navy & Biru Cyan */
    --bg-body: #020617; /* Hitam Navy */
    --bg-card: #0f172a; /* Latar Kartu */
    --bg-header: #0f172a;
    --bg-footer: #000000;
    --text-main: #f8fafc; /* Putih Bersih */
    --text-muted: #94a3b8;
    --primary: #38bdf8; /* Biru Cerah */
    --accent: #38bdf8; /* Aksi Biru di Dark Mode */
    --border: #1e293b;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2. RESET & GLOBAL
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-body); 
    color: var(--text-main); 
    line-height: 1.7;
    display: flex; flex-direction: column; min-height: 100vh;
    transition: background-color var(--transition), color var(--transition);
}

main { flex: 1; }
.container { max-width: 1150px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4, h5 { color: var(--text-main) !important; transition: var(--transition); }
a { text-decoration: none; color: inherit; transition: var(--transition); }

/* ==========================================================================
   3. HEADER CUSTOM & MOBILE MENU (BURGER ICON)
   ========================================================================== */
.main-header-custom {
    background-color: var(--bg-header);
    box-shadow: var(--shadow);
    position: sticky; 
    top: 0; 
    z-index: 1000;
    padding: 15px 0; 
    transition: var(--transition);
}

.header-flex-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img-custom {
    width: 45px;
    height: auto;
}

.logo-text-custom {
    display: flex;
    flex-direction: column;
}

.logo-title-custom {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.logo-slogan-custom {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Navigasi Desktop */
.nav-main-custom {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-main-custom a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s;
}

.nav-main-custom a:hover, 
.nav-main-custom a.active {
    color: var(--primary);
}

/* Submenu Dropdown Desktop */
.nav-has-submenu-custom {
    position: relative;
}

.nav-submenu-box {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.nav-has-submenu-custom:hover .nav-submenu-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-submenu-box a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.nav-submenu-box a:last-child { border-bottom: none; }

/* Tombol Burger (Sembunyi di Desktop) */
.btn-mobile-custom {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--text-main);
    cursor: pointer;
}

/* Overlay Gelap saat menu mobile terbuka */
.nav-overlay-custom {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 998;
    backdrop-filter: blur(3px);
}

/* ==========================================================================
   RESPONSIVE MOBILE (Layar di bawah 992px)
   ========================================================================== */
@media (max-width: 992px) {
    .btn-mobile-custom {
        display: block; /* Munculkan di HP */
        order: 2; /* Pindah ke Kanan */
    }

    .nav-main-custom {
        position: fixed;
        top: 0;
        right: -100%; /* Sembunyikan di luar layar kanan */
        width: 280px;
        height: 100vh;
        background-color: var(--bg-card);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 25px 30px 25px;
        box-shadow: -5px 0 20px rgba(0,0,0,0.15);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }

    /* Meluncur dari kanan saat aktif */
    .nav-main-custom.show-mobile {
        right: 0; 
    }

    .nav-main-custom a {
        width: 100%;
        padding: 15px 0;
        border-bottom: 1px solid var(--border);
        font-size: 16px;
    }

    .nav-has-submenu-custom {
        width: 100%;
    }
    
    .nav-submenu-box {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding: 0 0 0 15px;
        display: none;
    }
    
    .nav-has-submenu-custom.open-submenu .nav-submenu-box {
        display: block;
    }

    /* Tombol Login Full Width di Mobile */
    .btn-login {
        margin-left: 0 !important;
        margin-top: 20px;
        text-align: center;
        justify-content: center;
        width: 100%;
    }
}

/* ==========================================================================
   4. KARTU, ARTIKEL, FORM & FOOTER
   ========================================================================== */
.page-section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 50px; font-size: 32px; }

/* Halaman Detail Artikel */
.article-wrapper { max-width: 900px; margin: -50px auto 0 auto; position: relative; z-index: 10; padding-bottom: 40px; }
.article-header-bg { background: var(--bg-footer); padding: 100px 0 120px 0; text-align: center; }
.article-body { padding: 40px; color: var(--text-main); background-color: var(--bg-card) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; border-radius: 15px;}
.article-body p { margin-bottom: 20px; line-height: 1.8; color: var(--text-main) !important; }
.article-main-image { width: 100%; max-height: 500px; object-fit: cover; }

/* Form Global */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--text-main); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 15px;
    background-color: var(--bg-body); color: var(--text-main);
    border: 1px solid var(--border); border-radius: 8px;
    font-family: inherit; transition: var(--transition); 
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* Footer Global */
footer {
    background-color: var(--bg-footer);
    color: #cbd5e1;
    padding: 60px 0 20px 0; margin-top: auto;
    border-top: 1px solid var(--border);
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: white !important; font-size: 18px; margin-bottom: 20px; border-bottom: 2px solid var(--primary); display: inline-block; padding-bottom: 10px; }
.footer-col p { color: rgba(255,255,255,0.8) !important; font-size: 14px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { color: rgba(255,255,255,0.7); transition: 0.3s; }
.footer-col ul li a:hover { color: var(--primary); padding-left: 5px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 13px; color: rgba(255,255,255,0.6) !important; }

/* ==========================================================================
   5. SAPU JAGAT (ANTI TEKS HITAM DI DARK MODE)
   ========================================================================== */
[data-theme="dark"] [style*="color: #2c3e50"], 
[data-theme="dark"] [style*="color: #333"], 
[data-theme="dark"] [style*="color: #334155"] {
    color: var(--text-main) !important;
}