/* === GLOBAL VARIABLES & TYPOGRAPHY === */
:root {
    /* Palet STIKES */
    --primary: #7E109C;       /* Ungu Sedang (Warna dominan logo) */
    --primary-hover: #320542; /* Ungu Gelap */
    --secondary: #C704F7;     /* Ungu Terang/Magenta */
    --accent: #F0EF0C;        /* Kuning (Untuk tombol/highlight) */
    --danger: #F80502;        /* Merah (Untuk alert/peringatan) */
    
    --bg: #f8fafc; 
    --surface: #ffffff;
    --text-main: #0f172a; 
    --text-muted: #64748b; 
    --text-light: #ffffff;
    --radius-lg: 24px; 
    --radius-md: 12px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6; letter-spacing: 0.2px;
    background: var(--bg); color: var(--text-main); overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
button { font: inherit; cursor: pointer; border: none; background: none; }
h1, h2, h3, h4, h5, h6 { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; line-height: 1.2; }

/* --- FIX: Memastikan atribut HTML 'hidden' tidak dikalahkan oleh display: flex --- */
[hidden] {
    display: none !important;
}

/* === FEATURE: MASTER HEADER === */
.master-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 1rem 2rem; background: transparent; transition: var(--transition); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 1rem; border-radius: var(--radius-md); transition: var(--transition); }
.header-right { display: flex; align-items: center; gap: 0.75rem; }

/* === TEMA HEADER SAAT SCROLL (UNGU & PUTIH) === */
.master-header.scrolled { 
    background: var(--primary); /* Ungu sesuai logo */
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 2rem;
}

/* Font putih saat scroll */
.master-header.scrolled .logo a,
.master-header.scrolled .main-nav > a,
.master-header.scrolled .dropbtn,
.master-header.scrolled .mobile-toggle,
.master-header.scrolled .logo-text { 
    color: var(--text-light) !important; 
}

/* Efek hover nav saat background ungu */
.master-header.scrolled .main-nav > a:hover, 
.master-header.scrolled .dropbtn:hover { 
    background: rgba(255, 255, 255, 0.15); 
}

/* === FIX: Teks tombol highlight (kuning) tetap gelap saat di-scroll === */
.master-header.scrolled .nav-highlight {
    color: var(--text-main) !important; 
}

/* Search bar saat scroll agar tetap terlihat elegan */
.master-header.scrolled #universalSearch {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}
.master-header.scrolled #universalSearch::placeholder { color: rgba(255,255,255,0.7); }
.master-header.scrolled .lang-toggle { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); color: white; }

/* === UPDATED: LOGO === */
.logo a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: var(--transition);
    text-decoration: none;
}

.logo img { 
    width: 45px;
    height: 45px; 
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: var(--transition);
    flex-shrink: 0;
}

.logo a:hover img { 
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
    transition: var(--transition);
}

/* === FEATURE: NAVIGATION & DROPDOWNS === */
.main-nav { display: flex; align-items: center; gap: 0.5rem; }
.main-nav > a, .dropbtn { padding: 0.5rem 1rem; border-radius: var(--radius-md); font-weight: 500; color: var(--text-light); transition: var(--transition); }
.main-nav > a:hover, .dropbtn:hover { background: rgba(255,255,255,0.15); }

.nav-highlight { background: var(--accent); color: #0f172a !important; box-shadow: 0 4px 14px rgba(240, 239, 12, 0.3); }

/* === FIX: Tombol Kuning jadi Putih saat disorot === */
.nav-highlight:hover { 
    background: #ffffff !important; /* Berubah putih */
    color: #0f172a !important; 
    transform: translateY(-2px); 
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.5); /* Shadow menyesuaikan jadi putih */
}


.dropdown { position: relative; }
.dropdown-content {
    position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--surface);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 0.5rem 0;
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: var(--transition); z-index: 998;
}
.dropdown:hover .dropdown-content, .dropdown:focus-within .dropdown-content { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-content a { display: block; padding: 0.6rem 1.25rem; color: var(--text-main); font-size: 0.95rem; }
.dropdown-content a:hover { background: rgba(199, 4, 247, 0.08); color: var(--primary); padding-left: 1.5rem; }

/* === FEATURE: LANGUAGE TOGGLE (ID/EN) === */
.lang-container { position: relative; }
.lang-toggle {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
    color: white; font-style: italic; font-weight: 600; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition);
}
.lang-toggle:hover { background: rgba(255,255,255,0.3); }
.lang-dropdown {
    position: absolute; top: 110%; right: 0; background: var(--surface);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 0.25rem;
    opacity: 0; visibility: hidden; transform: translateY(-5px); transition: var(--transition);
    min-width: 60px; text-align: center; z-index: 1000;
}
.lang-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
    display: block; width: 100%; padding: 0.4rem; font-style: italic;
    color: var(--text-main); border-radius: 4px; font-size: 0.85rem;
}
.lang-option:hover { background: rgba(199, 4, 247, 0.1); }

/* === FEATURE: SEARCH (DESKTOP/TABLET) === */
.search-container { display: flex; align-items: center; }
.search-toggle { display: none; }
.search-form-wrapper { display: flex; align-items: center; position: relative; }
#universalSearch {
    width: 220px; padding: 0.65rem 1rem; border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50px; background: rgba(255,255,255,0.15); color: var(--text-light);
    font-size: 0.95rem; transition: var(--transition); backdrop-filter: blur(4px);
}
#universalSearch::placeholder { color: rgba(255,255,255,0.8); }
#universalSearch:focus { outline: none; background: rgba(255,255,255,0.25); border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(199, 4, 247, 0.2); }

.search-dropdown {
    position: absolute; top: 100%; right: 0; width: 100%; background: var(--surface);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg); margin-top: 0.5rem;
    max-height: 300px; overflow-y: auto; opacity: 0; visibility: hidden;
    transform: translateY(-10px); transition: var(--transition); z-index: 999;
}
.search-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.search-dropdown a { display: block; padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9; color: var(--text-main); }
.search-dropdown a:hover { background: rgba(199, 4, 247, 0.08); color: var(--primary); }

.mobile-toggle { display: none; font-size: 1.5rem; padding: 0.5rem; color: var(--text-light); transition: color 0.3s ease; }

@media (min-width: 1025px) {
    .close-nav { display: none; } 
}

/* === FEATURE: MOBILE MENU OVERLAY (UNGU SOLID) === */
@media (max-width: 1024px) {
    .mobile-toggle { display: block; }
    .lang-container { display: none; }
    
    .main-nav {
        position: fixed; inset: 0; width: 100%; height: 100vh;
        background: var(--primary); 
        flex-direction: column; justify-content: center; align-items: center; gap: 1.5rem;
        transform: translateY(-100%); transition: transform 0.4s ease-in-out;
        z-index: 1001; padding: 2rem;
    }
    .main-nav.active { transform: translateY(0); }

    .main-nav > a, .dropbtn { 
        color: var(--text-light) !important; 
        font-size: 1.4rem; 
        font-weight: 600;
        width: 100%; text-align: center;
    }
    .main-nav > a:hover, .dropbtn:hover { background: rgba(255, 255, 255, 0.15); }

    .close-nav {
        display: block;
        position: absolute;
        top: 20px;
        right: 25px;
        font-size: 3rem;
        color: white;
        line-height: 1;
        cursor: pointer;
        background: rgba(255,255,255,0.1);
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        border: 2px solid transparent;
    }
    .close-nav:hover { 
        background: rgba(255,255,255,0.2); 
        transform: rotate(90deg); 
        border-color: rgba(255,255,255,0.4);
    }

    .dropdown-content { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: transparent; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0; text-align: center; }
    .dropdown.open .dropdown-content { max-height: 400px; padding-top: 0.5rem; }
    .dropdown-content a { 
        color: rgba(255,255,255,0.8) !important; 
        font-size: 1.1rem;
        padding: 0.8rem;
    }
}

/* === FEATURE: MOBILE SEARCH (BOTTOM CENTER TOGGLE) === */
@media (max-width: 768px) {
    .master-header { background: rgba(0,0,0,0.2); backdrop-filter: blur(4px); padding: 0.8rem 1rem; }
    .header-inner { justify-content: center; position: relative; width: 100%; }
    .logo { margin: 0 auto; }
    .logo-text { display: inline; color: var(--text-light); font-weight: 700; letter-spacing: 0.5px; }
    .header-right { width: 100%; justify-content: flex-end; }
    
    /* === FIX: BUG POSISI NYANGKUT KARENA BACKDROP-FILTER === */
    .search-container {
        position: absolute !important; /* Gunakan absolute terhadap header */
        top: calc(100vh - 100px) !important; /* Fallback browser lama */
        top: calc(100dvh - 100px) !important; /* Dorong ke bawah layar menembus trap header */
        bottom: auto !important; 
        left: 50% !important;
        transform: translateX(-50%) !important; 
        right: auto !important;
        z-index: 1060 !important; 
        margin: 0 !important; 
        flex: none !important;
        
        /* FIX: Tumpuk elemen dari bawah ke atas agar input muncul di atas tombol */
        flex-direction: column-reverse !important; 
        align-items: center; 
        pointer-events: none;
    }
    .search-container.active { pointer-events: auto; }
    
    /* === FIX: TAMPILAN TOMBOL === */
    .search-toggle {
        display: flex; 
        width: 60px; 
        height: 60px; 
        border-radius: 50%;
        background: var(--primary); 
        border: 2px solid rgba(255, 255, 255, 0.2); 
        color: white; 
        justify-content: center; 
        align-items: center; 
        box-shadow: 0 10px 25px rgba(126, 16, 156, 0.5); 
        transition: var(--transition); 
        pointer-events: auto;
    }
    .search-toggle svg { transition: transform 0.3s ease; }
    .search-toggle:hover { background: var(--primary-hover); transform: scale(1.05) translateY(-3px); }
    .search-toggle:hover svg { transform: scale(1.1); }
    .search-container.active .search-toggle { opacity: 0; transform: scale(0.8); pointer-events: none; }
    
    /* === FIX: FORM INPUT MUNCUL DI ATAS TOMBOL === */
    .search-form-wrapper {
        width: 0; overflow: hidden; opacity: 0; transform: translateY(20px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); margin: 0; padding: 0;
    }
    .search-container.active .search-form-wrapper {
        width: 280px; opacity: 1; transform: translateY(0); 
        margin-bottom: 15px; /* Jarak antara form dan tombol di bawahnya */
        padding: 0.5rem;
        background: rgba(126, 16, 156, 0.9); backdrop-filter: blur(12px);
        border: 1px solid rgba(255,255,255,0.3); border-radius: 50px;
    }
    #universalSearch { width: 100%; border: none; background: transparent; color: white; padding: 0 0.5rem; }
    
    /* === FIX: DROPDOWN HASIL MUNCUL DI ATAS INPUT === */
    .search-dropdown {
        bottom: 100% !important; top: auto !important; 
        right: auto !important; left: 50% !important;
        transform: translateX(-50%) translateY(10px); /* Tetap rata tengah */
        width: 280px !important;
        background: rgba(50, 5, 66, 0.95) !important; backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,0.1); margin-bottom: 5px;
    }
    .search-dropdown.active {
        opacity: 1; visibility: visible; 
        transform: translateX(-50%) translateY(0); /* Animasi mulus ke atas */
    }
    .search-dropdown a { color: white !important; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .search-dropdown a:hover { background: rgba(255,255,255,0.1); }
    
    .main-container { padding: 1rem; margin-top: 20px; }
}

/* === FEATURE: CORE LAYOUT & BENTO === */
.main-container { 
    padding: 0 2rem; 
    max-width: 1400px; 
    margin: 0 auto; 
    margin-top: 0; 
    position: relative; 
    z-index: 10; 
}
.ajax-loader { 
    display: flex; 
    justify-content: center; 
    padding: 1rem 0; 
}

/* =========================================================
   FIX: RAK BUKU & IKON JUMBO
   ========================================================= */
.bookstore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.book-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 25px rgba(126, 16, 156, 0.15); 
    border-color: rgba(126, 16, 156, 0.4);
}

.book-cover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.book-cover svg {
    width: 60px !important;  
    height: 60px !important;
    opacity: 0.9;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover svg { transform: scale(1.15); }

.book-info { padding: 1.2rem; }

.book-info h3 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.read-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary); 
    display: inline-block;
}

#ajax-content:empty { display: none; }
.spinner { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bento-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.bento-card { background: var(--surface); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid #e2e8f0; }
.bento-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--secondary); }
.bento-card h3 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1.25rem; }
.bento-card p { color: var(--text-muted); font-size: 0.95rem; }

/* =========================================================
   === COMPACT CYBER-GLOW FOOTER (EXPANDED) === 
   ========================================================= */
.cyber-footer {
    background: #090e17; 
    padding: 3rem 2rem 1.5rem 2rem; 
    position: relative;
    z-index: 50;
    margin-top: 2rem;
    border-top: 1px solid rgba(126, 16, 156, 0.2);
}

/* --- FOOTER TOP (BRAND & CONTACT GRID) --- */
.footer-top {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dua Kolom */
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05); /* Garis pemisah halus */
}

.footer-brand .brand-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.cyber-logo-footer {
    width: 48px; 
    height: 48px;
    object-fit: contain;
    animation: hzt-micro-float 4s ease-in-out infinite;
}

@keyframes hzt-micro-float {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 2px rgba(126, 16, 156, 0.4)); }
    50% { transform: translateY(-5px); filter: drop-shadow(0 5px 12px rgba(199, 4, 247, 0.8)); }
}

.footer-tagline {
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
    max-width: 350px;
}

.footer-heading {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-family: 'Poppins', sans-serif;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Warna icon kontak menyesuaikan tema (Magenta) */
.contact-list svg {
    width: 18px;
    height: 18px;
    color: var(--secondary);
    flex-shrink: 0;
    margin-top: 3px;
}

/* --- FOOTER BOTTOM (COPYRIGHT & HZT) --- */
.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
}

.footer-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-tech-credits {
    text-align: center; 
    display: flex;
    flex-direction: column;
    align-items: center; 
}

/* === MICRO-ANIMATION [HZT] (TIDAK BERUBAH) === */
.hzt-badge {
    font-family: 'Orbitron', sans-serif; 
    font-weight: 900; 
    font-size: 1.4rem;
    font-style: normal;
    letter-spacing: 2px;
    padding: 4px 8px; 
    line-height: 1.2; 
    display: inline-block;
    
    background: linear-gradient(
        90deg, 
        #C704F7,  
        #00f3ff,  
        #ffffff,  
        #00f3ff,  
        #C704F7   
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    
    animation: hzt-color-flow 8s linear infinite; 
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.3)); 
    transition: all 0.5s ease;
}

@keyframes hzt-color-flow {
    to { background-position: 200% center; }
}

.footer-precision-text {
    font-family: 'Dancing Script', cursive; 
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: -3px; 
    padding-bottom: 5px; 
    opacity: 0.8;
    text-align: center; 
}

.hzt-link {
    text-decoration: none;
    transition: transform 0.3s ease;
    display: inline-block;
}

.hzt-link:hover { transform: scale(1.1); }
.hzt-link:hover .hzt-badge { filter: drop-shadow(0 0 12px rgba(0, 243, 255, 0.7)); }

/* --- RESPONSIVE MOBILE FOOTER --- */
@media (max-width: 768px) {
    .cyber-footer { padding: 2.5rem 1rem 6rem 1rem; } /* Jarak untuk tombol search jempol */
    
    .footer-top { 
        grid-template-columns: 1fr; /* Jadi satu kolom bertumpuk di HP */
        gap: 2rem; 
        text-align: center; 
    }
    
    .footer-brand .brand-title { justify-content: center; }
    .footer-tagline { margin: 0 auto; }
    
    .contact-list li { 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
        gap: 0.4rem; 
    }
    .contact-list svg { margin-top: 0; }
    
    .footer-bottom { 
        flex-direction: column; 
        gap: 1.5rem; 
        text-align: center; 
    }
}