/* ==========================================================
   1. CSS VARIABLES & GLOBAL RESET (INTI TEMA)
   ========================================================== */
:root {
    /* --- Color Palette --- */
    --primary-navy: #0a2647;     
    --primary-navy-dark: #051426;
    --accent-gold: #d4af37;      
    --accent-gold-hover: #b5952f;
    --bg-body: #f4f6f9;           
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --text-light: #e2e8f0;

    /* --- Dimensions --- */
    --header-height: 60px;
    --footer-height: 45px;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 70px;
    
    /* --- Transitions --- */
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 0.9rem;
    overflow-x: hidden;
}

a { text-decoration: none; transition: 0.3s; }


/* ==========================================================
   2. GLOBAL COMPONENTS (TOMBOL & KARTU UMUM)
   Digunakan oleh Admin, Web Profile, & Mobile App
   ========================================================== */

/* --- BUTTONS --- */
.btn-gold {
    background-color: var(--accent-gold);
    color: white;
    font-weight: 600;
    border: 1px solid var(--accent-gold);
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    transition: 0.3s;
}
.btn-gold:hover {
    background-color: var(--accent-gold-hover);
    color: white;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

/* Tombol Outline Putih (untuk Web/Mobile) */
.btn-outline-navy {
    border: 1px solid white;
    color: white;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    background: transparent;
}
.btn-outline-navy:hover {
    background-color: white;
    color: var(--primary-navy);
}

/* Tombol Outline Navy (untuk Web) */
.btn-outline-navy-dark {
    border: 1px solid var(--primary-navy);
    color: var(--primary-navy);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    background: transparent;
}
.btn-outline-navy-dark:hover {
    background-color: var(--primary-navy);
    color: white;
}

/* --- PREMIUM CARDS --- */
.card-premium {
    background: var(--bg-card);
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    transition: all 0.3s;
    border-top: 3px solid transparent;
    height: 100%;
    overflow: hidden;
}

.card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-top-color: var(--accent-gold);
}

.card-header-premium {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem;
    font-weight: 700;
    color: var(--primary-navy);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- FOOTER --- */
.main-footer {
    height: var(--footer-height);
    background: var(--primary-navy);
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}
footer {
    background-color: var(--primary-navy);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 20px;
}
footer h5 { color: white; font-weight: 700; margin-bottom: 1.5rem; }
footer ul li { margin-bottom: 0.8rem; list-style: none; }
footer a { color: rgba(255,255,255,0.7); text-decoration: none; transition: 0.2s; }
footer a:hover { color: var(--accent-gold); }


/* ==========================================================
   3. ADMIN DASHBOARD STYLES (Sidebar, Tabel, Form)
   ========================================================== */

/* --- SIDEBAR --- */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--primary-navy);
    color: var(--text-light);
    transition: all var(--transition-speed);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#sidebar.active { margin-left: calc(var(--sidebar-width) * -1); }

/* Sidebar Scrollbar */
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

.sidebar-brand {
    height: var(--header-height);
    display: flex; align-items: center; padding: 0 1.25rem;
    background-color: var(--primary-navy-dark);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: var(--accent-gold);
    font-weight: 700; font-size: 1.1rem; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden;
}
.sidebar-brand i { font-size: 1.5rem; margin-right: 10px; }

.sidebar-menu { padding: 1rem 0; list-style: none; margin-bottom: 0; }
.sidebar-menu li a {
    display: flex; align-items: center; padding: 0.6rem 1.25rem;
    color: var(--text-light); font-size: 0.9rem; transition: 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    color: #fff; background: rgba(255,255,255,0.05); border-left-color: var(--accent-gold);
}
.sidebar-menu li a i {
    font-size: 1.1rem; margin-right: 12px; width: 20px; text-align: center; color: var(--accent-gold);
}

/* Submenu (Level 2) */
.sidebar-submenu {
    background: var(--primary-navy-dark); padding-left: 0; list-style: none;
    display: none; font-size: 0.85rem;
}
.sidebar-submenu.show { display: block; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.sidebar-submenu li a {
    padding: 0.5rem 1.25rem 0.5rem 3.5rem; border-left: none; opacity: 0.8;
    display: flex; justify-content: space-between; align-items: center;
}
.sidebar-submenu li a:hover { opacity: 1; color: var(--accent-gold); }
.sidebar-submenu li a i.bi-chevron-right { font-size: 0.7rem; margin-left: 10px; }

/* Dropdown Arrow Animation Level 1 */
.has-dropdown .arrow { margin-left: auto; transition: 0.3s; font-size: 0.8rem; }
.has-dropdown.open .arrow { transform: rotate(180deg); }

/* --- ADMIN MAIN CONTENT --- */
#content {
    width: 100%; margin-left: var(--sidebar-width); transition: all var(--transition-speed);
    display: flex; flex-direction: column; min-height: 100vh;
}
#content.active { margin-left: 0; }

/* --- ADMIN TABLES & DATATABLES --- */
.table-custom thead { background-color: var(--primary-navy); color: white; }
.table-custom th { font-weight: 500; color: white; border: none; padding: 1rem; font-size: 0.85rem; }
.table-custom td { vertical-align: middle; padding: 0.75rem 1rem; color: #555; font-size: 0.85rem; }
.avatar-xs { width: 30px; height: 30px; border-radius: 50%; margin-right: 8px; }

/* DataTables Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--primary-navy) !important; border: 1px solid #dee2e6; border-radius: 4px; margin: 0 2px;
    font-size: 0.85rem !important; padding: 0.35rem 0.65rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: white !important; background: var(--accent-gold); border-color: var(--accent-gold); font-weight: bold;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: white !important; background: var(--primary-navy); border-color: var(--primary-navy);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.ellipsis { border: none; color: #999 !important; }

/* DataTables Consistency */
.dataTables_wrapper { font-family: 'Inter', sans-serif !important; font-size: 0.85rem !important; }
.dataTables_wrapper .dataTables_length label, .dataTables_filter label {
    font-weight: 500 !important; color: var(--text-main) !important; font-size: 0.85rem !important;
}
div.dataTables_wrapper div.dataTables_length select {
    border: 1px solid #e2e8f0; padding: 0.2rem 0.5rem; border-radius: 4px; width: 70px !important;
}

/* --- ADMIN FORMS --- */
.form-label { font-weight: 500; font-size: 0.85rem; color: var(--text-main); margin-bottom: 0.4rem; }
.form-control, .form-select {
    padding: 0.65rem 0.9rem; font-size: 0.9rem; border-color: #e2e8f0;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-navy); box-shadow: 0 0 0 3px rgba(10, 38, 71, 0.1);
}

/* Select2 Custom */
.select2-container--bootstrap-5 .select2-selection {
    min-height: calc(1.5em + 1.3rem + 2px) !important; padding: 0.35rem 0.5rem !important;
    font-size: 0.9rem !important; border-color: #e2e8f0 !important; border-radius: 6px !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: var(--primary-navy) !important; box-shadow: 0 0 0 3px rgba(10, 38, 71, 0.1) !important;
}
.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #e2e8f0 !important; border-radius: 6px !important; box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}
.select2-results__option { font-size: 0.9rem !important; padding: 8px 15px !important; }
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--primary-navy) !important; color: #ffffff !important;
}


/* ==========================================================
   4. WEB PROFILE STYLES (Navbar, Hero, Artikel)
   ========================================================== */

/* --- NAVBAR --- */
.navbar {
    background-color: var(--primary-navy); padding: 1rem 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-brand { font-weight: 700; font-size: 1.4rem; color: var(--accent-gold) !important; letter-spacing: 0.5px; }
.nav-link { color: rgba(255,255,255,0.8) !important; font-weight: 500; margin: 0 10px; }
.nav-link:hover { color: var(--accent-gold) !important; }

/* --- DROPDOWN MENU WEB --- */
.nav-item .dropdown-menu {
    border: 1px solid #e2e8f0; border-top: 3px solid var(--accent-gold); border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); padding: 0.5rem 0; font-family: 'Inter', sans-serif;
}
.dropdown-item { font-weight: 500; padding: 0.6rem 1.5rem; color: var(--text-main); transition: 0.2s; }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--primary-navy); color: #ffffff; }

/* --- HERO SECTION --- */
.hero-section {
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-navy-dark) 100%);
    color: white; padding: 100px 0 80px; position: relative; overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: 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='%23d4af37' 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");
    opacity: 0.6;
}
.hero-title { font-weight: 800; font-size: 3.5rem; line-height: 1.2; margin-bottom: 1.5rem; }
.hero-subtitle { font-size: 1.2rem; color: rgba(255,255,255,0.8); margin-bottom: 2rem; font-weight: 300; }

/* --- SECTIONS WEB --- */
.section-padding { padding: 80px 0; }
.section-title { font-weight: 700; color: var(--primary-navy); margin-bottom: 1rem; }
.section-divider { width: 60px; height: 4px; background: var(--accent-gold); margin: 0 auto 3rem; border-radius: 2px; }
.section-header-icon { font-size: 2rem; color: var(--accent-gold); margin-bottom: 1rem; }

/* --- ARTICLES (WEB) --- */
.article-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.article-date-badge { background: var(--primary-navy); color: var(--accent-gold); padding: 5px 10px; font-weight: 700; font-size: 0.8rem; border-radius: 4px; display: inline-block; margin-bottom: 1rem; }
.article-img { width: 100%; height: 200px; object-fit: cover; border-radius: 6px 6px 0 0; }
.featured-article .article-img { height: 350px; }
.article-title { font-weight: 700; color: var(--primary-navy); line-height: 1.4; margin-bottom: 0.8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-title.featured { font-size: 2rem; -webkit-line-clamp: 3; }

/* --- PROGRAMS WEB --- */
.program-img { width: 100%; height: 200px; background-color: #eee; object-fit: cover; }
.program-content { padding: 1.5rem; }
.program-icon {
    width: 50px; height: 50px; background: rgba(212, 175, 55, 0.1); color: var(--accent-gold);
    display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 1.5rem; margin-bottom: 1rem;
}


/* ==========================================================
   5. MOBILE APP STYLES (Bottom Nav, Loader, FAB)
   ========================================================== */

/* --- MOBILE LAYOUT --- */
.mobile-app {
    max-width: 480px; margin: 0 auto; background-color: var(--bg-body); min-height: 100vh;
    position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* --- LOADER OVERLAY (Logo di dalam lingkaran) --- */
#loader-overlay {
    position: fixed; top: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; height: 100vh;
    background: rgba(255,255,255,0.8); backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000; display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.4s ease;
}
#loader-overlay.showing { opacity: 1; visibility: visible; }

.loader-wrapper {
    position: relative; width: 80px; height: 80px; margin-bottom: 15px;
}
.loader-circle {
    width: 100%; height: 100%; border: 4px solid rgba(212, 175, 55, 0.2);
    border-top: 4px solid var(--accent-gold); border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loader-logo-inside {
    position: absolute; top: 50%; left: 50%; width: 50px; height: 50px;
    transform: translate(-50%, -50%); object-fit: cover;
    animation: pulseLogo 1.5s infinite ease-in-out;
}
.loader-text {
    font-size: 0.8rem; color: var(--primary-navy); font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; margin-top: 10px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulseLogo { 0% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.05); } 100% { transform: translate(-50%, -50%) scale(1); } }

/* --- BOTTOM NAVIGATION --- */
.bottom-nav {
    position: fixed; bottom: 0; width: 100%; max-width: 480px; left: 50%; transform: translateX(-50%);
    background: white; border-top: 1px solid #eee; display: flex; justify-content: space-around;
    padding: 0.5rem 0; z-index: 9999; border-top-left-radius: 20px; border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}
.nav-link-mobile {
    text-decoration: none; color: #adb5bd; display: flex; flex-direction: column; align-items: center;
    font-size: 0.7rem; padding: 5px 15px; transition: 0.2s;
}
.nav-link-mobile i { font-size: 1.4rem; margin-bottom: 4px; transition: 0.3s; }
.nav-link-mobile.active { color: var(--primary-navy); }
.nav-link-mobile.active i { transform: translateY(-5px); color: var(--accent-gold); }

/* --- FAB (Floating Action Button) --- */
.fab {
    position: fixed; bottom: 85px; right: calc(50% - 225px + 20px);
    width: 56px; height: 56px; background: var(--accent-gold); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    border: none; z-index: 9998; transition: 0.3s; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}
.fab:hover { transform: scale(1.1); background: #b5952f; }

/* --- MOBILE SPECIFIC COMPONENTS --- */
.mobile-header {
    background: white; padding: 1rem 1.25rem; position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); display: flex; justify-content: space-between; align-items: center;
}
.welcome-card {
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-navy-dark) 100%);
    color: white; border-radius: 16px; padding: 1.5rem; margin: 1.25rem;
    box-shadow: 0 10px 20px rgba(10, 38, 71, 0.2); position: relative; overflow: hidden;
}
/* --- RESPONSIVE QUERIES --- */
@media (max-width: 992px) {
    #sidebar { margin-left: calc(var(--sidebar-width) * -1); }
    #sidebar.active { margin-left: 0; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    #content { margin-left: 0; }
    #content.active { /* Overlay effect */ }
    .overlay {
        display: none; position: fixed; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); z-index: 998;
    }
    .overlay.active { display: block; }
}