:root {
    --navy: #1E293B;
    --blue: #2563EB;
    --light-blue: #3B82F6;
    --white: #FFFFFF;
    --orange: #F97316;
    --bg-color: #F8FAFC;
    --text-color: #334155;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --danger-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

.admin-fire-text {
    background-image: linear-gradient(0deg, #ff0000 0%, #ff8a00 50%, #ffe800 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    text-shadow: 0 0 5px rgba(255, 100, 0, 0.4), 0 0 10px rgba(255, 50, 0, 0.2);
    animation: fire-flicker 1.5s infinite alternate;
}
@keyframes fire-flicker {
    0% { text-shadow: 0 0 4px rgba(255, 100, 0, 0.6), 0 -2px 6px rgba(255, 200, 0, 0.4); }
    50% { text-shadow: 0 0 8px rgba(255, 100, 0, 0.8), 0 -5px 12px rgba(255, 200, 0, 0.6); }
    100% { text-shadow: 0 0 5px rgba(255, 100, 0, 0.5), 0 -3px 8px rgba(255, 200, 0, 0.5); }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* Typography */
h1, h2, h3, h4, h5, h6 { color: var(--navy); font-weight: 600; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.875rem;
}

.btn-primary { background-color: var(--blue); color: var(--white); }
.btn-primary:hover { background-color: var(--navy); }

.btn-outline { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-color); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

.nav-menu a:hover, .nav-menu a.active {
    color: var(--blue);
}

/* Dropdown CSS */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.5rem;
    z-index: 100;
    border: 1px solid var(--gray-200);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}
.nav-dropdown:hover .nav-dropdown-content {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.nav-dropdown-content a {
    display: block;
    padding: 0.7rem 1rem;
    color: var(--text-color);
    font-weight: 500;
    border-radius: 8px;
    font-size: 0.9rem;
    text-decoration: none;
}
.nav-dropdown-content a:hover {
    background: var(--blue-50);
    color: var(--blue);
}

.btn-danger { background-color: var(--danger-color); color: var(--white); }
.btn-danger:hover { opacity: 0.9; }

.btn-orange { background-color: var(--orange); color: var(--white); }
.btn-orange:hover { opacity: 0.9; }

.btn-block { width: 100%; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* Cards */
.table-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}
.table-container table {
    min-width: 600px;
}
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
    border: 1px solid var(--border-color);
}
.card:hover { box-shadow: var(--shadow-md); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.bg-blue { background-color: #DBEAFE; color: var(--blue); }
.badge.bg-orange { background-color: #FFEDD5; color: var(--orange); }
.badge.bg-green { background-color: #D1FAE5; color: var(--success-color); }
.badge.bg-red { background-color: #FEE2E2; color: var(--danger-color); }
.badge.bg-gray { background-color: #F1F5F9; color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-color); font-size: 0.875rem;}
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--blue); }

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Modal */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal.active { opacity: 1; pointer-events: auto; }
.modal-content {
    background: var(--white);
    width: 90%; max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px); transition: transform 0.2s;
    max-height: 90vh; overflow-y: auto;
}
.modal.active .modal-content { transform: translateY(0); }
.modal-content.modal-lg { max-width: 800px; }
.modal-content.modal-xl { width: 65%; max-width: 900px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-content.modal-xl .modal-body { flex: 1; overflow-y: auto; }
.modal-content.modal-full { width: 98%; max-width: 1800px; height: 98vh; max-height: 98vh; display: flex; flex-direction: column; border-radius: 12px; }
.modal-content.modal-full .modal-body { flex: 1; overflow-y: auto; }
.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: 1.5rem; }
.close-modal { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-muted); }

/* Toast */
.toast-container { position: fixed; bottom: 1rem; right: 1rem; z-index: 1100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    background: var(--white); border-left: 4px solid var(--blue);
    padding: 1rem; border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    display: flex; align-items: center; gap: 0.75rem;
    animation: slideIn 0.3s ease-out forwards;
}
.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Helpers */
.hidden { display: none !important; }
.text-center { text-align: center; }
/* ===== PAGE FADE IN ===== */
body {
    animation: pageFadeIn 0.5s ease-out forwards;
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* ===== ELEMENT TRANSITIONS ===== */
.mag-page-header, .mag-container, .wbn-hero-inner, .wbn-page, .detail-header, .detail-cover-wrap, .detail-body {
    animation: elementSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(35px);
}
@keyframes elementSlideUp {
    to { opacity: 1; transform: translateY(0); }
}
/* Staggering */
.mag-container, .wbn-page, .detail-cover-wrap { animation-delay: 0.15s; }
.detail-body { animation-delay: 0.3s; }

@media (max-width: 768px) {
    .modal-content { width: 95%; padding: 0 !important; }
    .modal-body { padding: 1.25rem !important; }
    .modal-header { padding: 1.25rem !important; }
    .modal-content.modal-xl { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
}

/* =============================================
   NAVBAR (Global)
   ============================================= */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: box-shadow 0.3s;
}
body { padding-top: 56px; }
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-container {
    max-width: 1280px; margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.brand-icon { font-size: 1.75rem; color: var(--blue); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-weight: 800; color: var(--navy); font-size: 1.25rem; letter-spacing: -0.5px; }
.brand-subtitle { font-size: 0.65rem; color: var(--orange); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

.nav-menu { display: flex; gap: 0.25rem; align-items: center; }
.nav-menu a.nav-link {
    color: var(--text-color); font-weight: 500; font-size: 0.85rem;
    padding: 0.4rem 0.6rem; border-radius: var(--radius-md);
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.nav-menu a.nav-link:hover { background: #EFF6FF; color: var(--blue); }
.nav-menu a.nav-link.active { color: var(--blue); background: #EFF6FF; }

/* Navbar Dropdown */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-content {
    display: none; position: absolute; top: 100%; left: 0;
    background-color: white; min-width: 160px;
    box-shadow: var(--shadow-md); border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    z-index: 201; flex-direction: column; padding: 0.5rem; gap: 0.25rem;
}
.nav-dropdown:hover .nav-dropdown-content { display: flex; }
.nav-dropdown-content a {
    color: var(--text-color); font-weight: 500; font-size: 0.85rem;
    padding: 0.5rem 0.75rem; border-radius: var(--radius-md);
    text-decoration: none; display: flex; align-items: center; gap: 0.5rem; transition: background 0.2s;
}
.nav-dropdown-content a:hover { background: #EFF6FF; color: var(--blue); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.search-bar { position: relative; }
.search-bar input {
    padding: 0.4rem 1rem 0.4rem 2.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem; width: 160px;
    transition: all 0.3s; background: #F8FAFC;
}
.search-bar input:focus { width: 200px; outline: none; border-color: var(--blue); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-bar i { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.8rem; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; color: var(--navy); cursor: pointer; padding: 0.25rem; }

@media (max-width: 768px) {
    .nav-menu { 
        display: none; position: absolute; top: 100%; left: 0; width: 100%; 
        background: white; padding: 2rem 1rem; border-bottom: 1px solid var(--border-color); 
        box-shadow: var(--shadow-md); 
        grid-template-columns: repeat(3, 1fr); gap: 2rem 0.5rem; justify-items: center;
    }
    .nav-menu.open { display: grid; }
    
    .nav-dropdown, .nav-dropdown-content { display: contents; pointer-events: none; }
    .nav-dropdown-toggle { display: none !important; }
    
    .nav-menu a.nav-link {
        display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
        gap: 0.6rem; text-align: center; font-size: 0.8rem; font-weight: 500;
        padding: 0.5rem 0; border: none; background: transparent !important; color: var(--navy) !important;
        pointer-events: auto; position: relative; z-index: 10;
        width: 100%; height: 100%;
    }
    .nav-menu a.nav-link i {
        font-size: 2rem; color: var(--light-blue); margin: 0 !important;
    }
    .nav-menu a.nav-link .fa-chevron-down { display: none; }
    
    .mobile-menu-btn { display: block; }
    .search-bar { display: none; }
    
    .modal { padding: 0 !important; }
    .modal-content { width: 100% !important; max-width: 100% !important; height: 100vh; max-height: 100vh; border-radius: 0; transform: translateY(0) !important; margin: 0; display: flex; flex-direction: column; }
    .modal-content .modal-body { flex: 1; overflow-y: auto; }

    /* Sembunyikan tombol logout di navbar publik di HP – sudah ada di dalam menu burger */
    .navbar-logout-btn { display: none !important; }

    /* Tampilkan tombol logout tambahan di dalam menu burger khusus HP */
    .mobile-logout-link { display: flex !important; }
    .mobile-logout-link i { color: var(--danger-color) !important; }
    
    /* Kompresi Header di Layar Kecil agar tidak tertumpuk */
    .nav-container { padding: 0.4rem 0.75rem; gap: 0.25rem; }
    .brand { gap: 0.4rem; }
    .brand img { height: 26px !important; }
    .brand-title { font-size: 1.05rem; }
    .brand-subtitle { font-size: 0.55rem; }
    .nav-actions { gap: 0.35rem; }
    .nav-actions button[title="Layar Penuh"] { font-size: 1.05rem !important; padding: 0.35rem !important; margin-right: 0 !important; }
    #authNavWrapper .btn-primary { padding: 0.4rem 0.6rem; font-size: 0.75rem; white-space: nowrap; line-height: 1.2; }
    .mobile-menu-btn { padding: 0.15rem; font-size: 1.25rem; }
}

/* Sembunyikan tombol logout tambahan di desktop */
.mobile-logout-link { display: none !important; }
