/* FONT */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* VARIABLE COLOR - Sesuaikan dengan login.css */
:root {
    --primary-color: #7952b3; /* Ungu terang/terong */
    --dark-blue: #1e1b4b; /* Violet gelap (untuk background utama) */
    --light-violet: #a0a0ff; /* Violet sangat terang (untuk highlight) */
    --text-color: #333;
    --background-light: #f7f7f7;
    --white: #ffffff;
    --footer-bg: #151336; /* Warna dasar footer yang gelap dan elegan */
    --footer-text: #e0e0e0;
}

/* --- Global Reset & Smooth Scroll --- */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: var(--background-light); 
    color: var(--text-color);
    /* Transisi untuk fade-out saat pindah halaman */
    transition: opacity 0.5s ease, background 0.5s ease;
}

body.page-transition-out {
    /* Membuat seluruh halaman memudar (fade-out) */
    opacity: 0; 
}

a {
    text-decoration: none;
}
/* ------------------------------------ */

/* ------------------------------
    PRELOADER (WEBSITE ENTRY ANIMATION)
--------------------------------*/
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-blue);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

#preloader.hide {
    opacity: 0;
}

.loader-content {
    text-align: center;
    color: var(--white);
    animation: contentFadeIn 1s ease forwards;
}

/* Animasi Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--light-violet);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Body state saat preloader aktif, mencegah scroll */
body.loading {
    overflow: hidden; 
    opacity: 0; /* Konten utama disembunyikan saat loading */
}
body.page-transition-out {
    /* Saat kelas ini ditambahkan, body akan fade out */
    opacity: 0; 
    transition: opacity 0.5s ease;
}

a {
    text-decoration: none;
}
/* ------------------------------------ */

/* ------------------------------
    NAVBAR (Modern & Glassy)
--------------------------------*/
.navbar { 
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 1000; 
    padding: 0 40px; 

    background-color: rgba(30, 27, 75, 0.95); 
    backdrop-filter: blur(8px); /* Mengurangi blur agar lebih halus */
    -webkit-backdrop-filter: blur(8px); 
    
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.3); 
    display: flex; 
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease; /* Tambahkan transisi pada navbar */
}

.navbar.active {
    /* Saat di-scroll, warna jadi sedikit lebih solid */
    background: var(--dark-blue); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--white) !important; 
    letter-spacing: 0.5px;
    transition: 0.4s ease;
    cursor: pointer;
}

.logo:hover {
    color: var(--light-violet) !important;
}

/* Menu Navigasi */
.nav-links {
    display: flex;
    gap: 40px; 
}

.nav-links a {
    color: var(--white) !important; 
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    padding: 5px 0;
    position: relative;
    transition: 0.3s ease-in-out;
}

.nav-links a:hover {
    color: var(--light-violet) !important; 
}

/* Tombol Login */
.btn-login {
    padding: 10px 25px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 30px;
    transition: 0.3s;
    
    color: var(--white); 
    background: none;
    border: 2px solid var(--white);
}

.btn-login:hover {
    background: var(--light-violet); 
    color: var(--dark-blue); 
    border-color: var(--light-violet);
    box-shadow: 0 0 15px rgba(160, 160, 255, 0.6); 
}

/* ------------------------------
    HERO SECTION
--------------------------------*/

.hero {
    /* PENTING: Gunakan calc(100vh - tinggi_navbar) agar konten tidak di bawah navbar */
    height: calc(100vh - 60px); /* Asumsi navbar setinggi 60px */
    background: url('../img/bg-sekolah3.png') center/cover no-repeat; 
    position: relative;
    margin-top: 60px; /* Dorong konten ke bawah navbar */
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* Nilai seimbang (gelap cukup, detail terlihat) */
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.75), rgba(0, 0, 0, 0.65)); 
}

.hero-content {
    /* Gunakan Flexbox untuk sentrasi sempurna */
    position: absolute;
    top: 50%; /* Tarik ke tengah vertikal dari area hero */
    left: 50%;
    transform: translate(-50%, -50%); /* Sentrasi sempurna */
    
    text-align: center;
    color: var(--white);
    z-index: 10;
    width: 90%; /* Batasi lebar agar teks tidak terlalu melebar */
    
    /* Hapus animation: fadeIn 1.4s ease forwards; jika belum didefinisikan */
}

.hero-content h1 {
    font-size: 64px; /* Perbesar H1 untuk dampak */
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 1px;
    text-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 24px; 
    font-weight: 400;
    margin-bottom: 40px;
    color: var(--text-muted); /* Warna sedikit abu agar tidak mencolok */
}

.btn-primary {
    background: var(--light-violet);
    color: var(--dark-blue);
    padding: 16px 40px; 
    border-radius: 50px; /* Lebih bulat */
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3); 
}

.btn-primary:hover {
    background: var(--dark-blue);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* ------------------------------
    SECTION UMUM
--------------------------------*/
section {
    width: 90%;
    max-width: 1200px; 
    margin: 100px auto 120px auto; /* Margin lebih besar antar section */
    padding: 20px 0; 
}

section h2 {
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 35px;
    text-align: left; 
    color: var(--dark-blue); 
    border-bottom: 3px solid #d9d7e6;
    padding-bottom: 15px;
}

/* ------------------------------
    ANIMASI ON SCROLL (Untuk Section dan Boxes)
--------------------------------*/
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    /* Tambahkan transition-delay pada beberapa elemen di index.php */
}

.fade-in-on-scroll.animated-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------
    ABOUT SECTION
--------------------------------*/
.about {
    text-align: center;
    padding: 0 50px;
}

.about h2 {
    text-align: center; 
    border-bottom: none;
}

.about p {
    font-size: 18px;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
}

/* ------------------------------
    TABLE SECTION (RIWAYAT)
--------------------------------*/
.table-container {
    background: var(--white);
    padding: 0; 
    border-radius: 18px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
    overflow: hidden; 
    border: 1px solid #e0e0e0; 
}

table {
    width: 100%;
    border-collapse: collapse; /* Mengubah ke collapse agar lebih rapi */
}

table th {
    background: var(--dark-blue); 
    color: var(--white);
    padding: 20px 15px; /* Padding lebih besar */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left; /* Teks rata kiri di header */
}
table th:last-child, table td:last-child {
    text-align: center; /* Kolom status/aksi di tengah */
}


table td {
    padding: 15px 15px; 
    border-bottom: 1px solid #f0f0f0; 
    text-align: left;
    color: #555;
    font-size: 15px;
}

table tr:hover {
    background-color: #f7f7ff; 
    cursor: default; /* Tidak perlu cursor pointer */
    transition: background-color 0.2s ease;
}

table tr:last-child td {
    border-bottom: none; 
}

/* Status Kosong */
.table-container .empty {
    text-align: center;
    padding: 30px !important;
    font-style: italic;
    color: #888;
}

/* Style Badge Status */
.status-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: capitalize;
    min-width: 100px;
    text-align: center;
}

/* Kombinasi Warna Status */
.status-badge.disetujui {
    background-color: #e6ffed;
    color: #008744; 
}
.status-badge.tertunda {
    background-color: #fff9e6;
    color: #ff9900; 
}
.status-badge.ditolak {
    background-color: #ffe6e6;
    color: #d82e2f; 
}

/* ------------------------------
    STATISTIK
--------------------------------*/
.statistik h2 {
    text-align: center;
}

.stats-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 30px; 
    margin-top: 50px;
}

.stat-box {
    background: var(--white);
    border-radius: 18px; 
    padding: 40px 20px; 
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid #eef; 
    transition: all 0.4s ease; 
}

.stat-box i {
    opacity: 0.8;
}

.stat-box:hover {
    transform: translateY(-8px) scale(1.02); 
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
    /* Animasi warna ikon saat hover */
    
    /* Ganti warna ikon saat hover */
    & i { 
        filter: brightness(1.2); 
    }
}

.stat-box h3 {
    font-size: 56px; 
    font-weight: 800; 
    color: var(--dark-blue); 
    margin-bottom: 10px;
}

.stat-box p {
    color: #666;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


.page-transition-out {
    /* Saat kelas ini ditambahkan, body akan fade out */
    opacity: 0; 
}

/* ------------------------------
    ANIMATION
--------------------------------*/
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------
    FOOTER MODERN & PROFESIONAL
--------------------------------*/

.main-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 0 0; /* Jarak atas lebih besar */
    font-size: 15px;
    border-top: 5px solid var(--primary-color); /* Garis pemisah yang berani */
}

.footer-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 40px;
}

.footer-column h4 {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    /* Garis bawah tipis di bawah judul */
    padding-bottom: 5px;
}

/* Logo Brand */
.footer-logo {
    color: var(--light-violet);
    font-size: 24px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 15px;
}
.footer-brand p {
    line-height: 1.6;
    color: #b0b0b0;
}

/* Navigasi Cepat */
.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links ul li {
    margin-bottom: 10px;
}
.footer-links ul li a {
    color: var(--footer-text);
    transition: color 0.3s;
    display: flex;
    align-items: center;
}
.footer-links ul li a:hover {
    color: var(--primary-color);
}
.footer-links ul li i {
    margin-right: 8px;
    font-size: 0.8em;
    color: var(--primary-color);
}

/* Kontak */
.footer-contact p {
    margin-bottom: 15px;
    color: var(--footer-text);
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
}
.footer-contact p i {
    margin-right: 10px;
    color: var(--primary-color);
    font-size: 1.1em;
    margin-top: 3px;
}


/* Media Sosial */
.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}
.social-icons a {
    color: var(--footer-text);
    font-size: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s, color 0.3s;
}
.social-icons a:hover {
    background: var(--primary-color);
    color: var(--white);
}


/* Bagian Bawah Footer (Copyright) */
.footer-bottom {
    background-color: #11102b; 
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer-bottom p {
    margin: 0;
    color: #a0a0a0;
}

/* Media Query untuk Responsif */
@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }
    .nav-links {
        display: none; /* Sembunyikan link di mobile */
    }
    .hero-content h1 {
        font-size: 40px;
    }
    .hero-content p {
        font-size: 18px;
    }
    .main-footer {
        padding-top: 40px;
    }
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .footer-column h4 {
        text-align: center;
    }
    .footer-contact p,
    .footer-links ul li a {
        justify-content: center;
    }
    .footer-social {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .social-icons {
        justify-content: center;
    }
}