@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;700;800&display=swap');

:root {
    --school-red: #DC2626; /* Warna Khas SD */
    --school-dark: #991B1B;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
}

/* --- OVERRIDE BOOTSTRAP --- */
.text-primary { color: var(--school-red) !important; }
.bg-primary { background-color: var(--school-red) !important; }
.btn-primary { 
    background-color: var(--school-red); 
    border-color: var(--school-red); 
}
.btn-primary:hover { 
    background-color: var(--school-dark);
    border-color: var(--school-dark);
}
.btn-outline-primary {
    color: var(--school-red);
    border-color: var(--school-red);
}
.btn-outline-primary:hover {
    background-color: var(--school-red);
    border-color: var(--school-red);
}

/* --- NAVBAR --- */
.navbar {
    background: rgba(220, 38, 38, 0.95); /* Merah transparan */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.navbar-brand img { height: 45px; }

/* --- HERO SECTION --- */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('https://lh3.googleusercontent.com/d/1rVGztFi_ZH9yQwTYDqGOYDXMCkN_fnAF');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    margin-top: -76px; /* Menarik ke atas di balik navbar */
    padding-top: 76px;
}

/* --- CARDS & UTILS --- */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.175);
}

.rounded-4 { border-radius: 1rem !important; }
.rounded-5 { border-radius: 2rem !important; }

/* Section Title Style */
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--school-red);
    margin-top: 10px;
    border-radius: 2px;
}

/* --- ADMIN SIDEBAR --- */
#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -15rem;
    transition: margin .25s ease-out;
    background: white;
    border-right: 1px solid #dee2e6;
}
#sidebar-wrapper .list-group { width: 15rem; }
#page-content-wrapper { min-width: 100vw; }
body.sb-sidenav-toggled #sidebar-wrapper { margin-left: 0; }
@media (min-width: 768px) {
    #sidebar-wrapper { margin-left: 0; }
    #page-content-wrapper { min-width: 0; width: 100%; }
    body.sb-sidenav-toggled #sidebar-wrapper { margin-left: -15rem; }
}

/* Efek Hover Link di Footer */
.hover-primary:hover {
    color: var(--school-red) !important; /* Mengambil warna merah dari variabel root */
    padding-left: 5px; /* Efek geser sedikit agar interaktif */
}
.transition-all {
    transition: all 0.3s ease;
}

/* --- PENGATURAN LAYAR LOADING (PRELOADER) --- */
body.no-scroll {
    overflow: hidden; /* Mengunci layar agar tidak bisa di-scroll saat loading */
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #ffffff;
    z-index: 999999; /* Memastikan loading screen berada paling depan */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

/* Class ini akan ditambahkan oleh JS untuk menghilangkan layar loading */
#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Animasi Buku Melayang */
.loader-book i {
    font-size: 5rem;
    animation: float-book 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 10px rgba(13, 110, 253, 0.3));
}

@keyframes float-book {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.1); color: #0b5ed7; }
    100% { transform: translateY(0) scale(1); }
}

@keyframes pulse-text {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* --- CUSTOM SIDEBAR ACTIVE HIGHLIGHT --- */
#sidebar-wrapper .list-group-item.active {
    background-color: #e9ecef !important; /* Warna latar highlight (abu-abu sangat muda/biru muda) */
    color: #0d6efd !important; /* Warna teks menjadi biru primary */
    border-left: 4px solid #0d6efd !important; /* Garis penanda di kiri */
    border-radius: 0 !important; /* Menghilangkan lengkungan agar garis kirinya menempel pas */
}

/* Mengembalikan warna ikon agar senada */
#sidebar-wrapper .list-group-item.active i {
    color: #0d6efd !important;
}