/* ===== VARIABLES ===== */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-light: #e7f1ff;
    --secondary: #64748b;
    --light: #f8fafc;
    --dark: #0f172a;
    --white: #ffffff;
    
    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
    --shadow-hover: 0 15px 35px rgba(13, 110, 253, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GLOBAL STYLES ===== */
html {
    scroll-behavior: smooth;
    overflow-y: scroll; /* Mengunci scrollbar agar tidak hilang-timbul & bergetar */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--dark);
    line-height: 1.7;
    background-color: #fafbfc;
    /* overflow-x: hidden; ---> TELAH DIHAPUS AGAR FITUR STICKY BERITA BERFUNGSI NORMAL */
}

.tracking-wider {
    letter-spacing: 0.1em;
}

/* ===== NAVBAR GLASSMORPHISM (ELEGAN & TERANG) ===== */
.glass-navbar {
    background: rgba(255, 255, 255, 0.85); /* Putih Semi-Transparan */
    backdrop-filter: blur(12px); /* Efek Kaca Blur */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 0;
    transition: all 0.4s ease;
}

/* State Saat Layar Di-Scroll Ke Bawah */
.glass-navbar.scrolled {
    background: rgba(255, 255, 255, 0.98); /* Lebih solid saat discroll */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 10px 0; /* Mengecil sedikit agar rapi */
}

/* Pengaturan Logo & Teks Sekolah */
.navbar-logo {
    max-height: 45px;
    max-width: 45px;
    object-fit: contain;
}

.school-name {
    color: #0f172a; /* Warna gelap agar kontras dan sangat jelas */
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

/* Pengaturan Teks Menu */
.glass-navbar .nav-link {
    color: #475569 !important; /* Abu-abu gelap elegan */
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.glass-navbar .nav-link:hover,
.glass-navbar .nav-link.active {
    color: var(--primary) !important; /* Warna biru saat aktif */
    background: rgba(13, 110, 253, 0.05); /* Highlight kotak tipis di belakang teks */
}

/* Animasi Garis Bawah Biru (Underline) */
.glass-navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--primary);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.glass-navbar .nav-link:hover::after,
.glass-navbar .nav-link.active::after {
    width: 60%;
}

/* Dropdown Menu Gaya Kaca */
.glass-dropdown {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    padding: 10px;
    margin-top: 15px !important;
}

.glass-dropdown .dropdown-item {
    border-radius: 8px;
    font-weight: 500;
    color: #475569;
    padding: 8px 15px;
    transition: all 0.2s;
}

.glass-dropdown .dropdown-item:hover {
    background-color: var(--primary);
    color: white;
    transform: translateX(5px);
}

/* Responsive di HP */
@media (max-width: 991px) {
    .glass-navbar .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        padding: 15px;
        border-radius: 12px;
        margin-top: 15px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }
    .glass-navbar .nav-link::after {
        display: none; /* Matikan garis bawah di HP */
    }
}

/* ===== HERO SLIDER ===== */
.hero-slider {
    height: 80vh;
    min-height: 600px;
    background-color: var(--dark);
}

.carousel-indicators button {
    width: 30px !important;
    height: 4px !important;
    border-radius: 4px !important;
    background-color: rgba(255,255,255,0.4) !important;
    border: none !important;
    transition: var(--transition) !important;
}

.carousel-indicators button.active {
    background-color: var(--primary) !important;
    width: 50px !important;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.1); 
    transition: transform 7s linear;
}

.carousel-item.active .hero-bg {
    transform: scale(1); 
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.4) 100%);
    z-index: 2;
}

.hero-content {
    padding-top: 60px;
}

/* Animasi untuk elemen di luar slider (Langsung Muncul) */
.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Menyembunyikan elemen di dalam slider jika slide belum aktif */
.carousel-item .animate-fade-up {
    animation: none;
    opacity: 0;
}

/* Memunculkan elemen saat slide aktif */
.carousel-item.active .animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hover-glass {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}
.hover-glass:hover {
    background: white;
    color: var(--dark);
}

/* ===== OVERLAPPING STATS ===== */
.stats-overlap-section {
    position: relative;
    z-index: 20;
    margin-top: -60px;
    margin-bottom: 40px;
}

.stats-box {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
    opacity: 0.8;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--secondary);
    font-weight: 500;
}

@media (min-width: 768px) {
    .stat-item::after {
        content: '';
        position: absolute;
        right: -15px;
        top: 20%;
        height: 60%;
        width: 1px;
        background-color: #e2e8f0;
    }
    .col-md-3:last-child .stat-item::after {
        display: none;
    }
}

/* ===== WELCOME SECTION ===== */
.section-padding {
    padding: 40px 0;
}

.welcome-image-wrapper {
    position: relative;
    padding: 20px;
}

.img-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    height: 90%;
    border: 3px solid var(--primary-light);
    border-radius: 24px;
    z-index: 1;
}

.floating-badge {
    position: absolute;
    bottom: 30px;
    right: -20px;
    background: white;
    padding: 15px 25px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 3;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-box-small {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.feature-card {
    background: white;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

/* ===== NEWS CARDS ===== */
.news-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.news-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.08);
}

.news-date {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: var(--primary);
    padding: 10px 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.news-date .day {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    display: block;
}

.news-date .month {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
}

.news-content {
    padding: 25px;
}

.news-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.news-meta i {
    color: var(--primary);
}

.news-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.news-title a {
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

.news-title a:hover {
    color: var(--primary);
}

.news-excerpt {
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    transition: var(--transition);
}

.read-more:hover {
    gap: 5px; 
}

/* ===== ANNOUNCEMENTS ===== */
.announcement-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.announcement-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.announcement-item.important {
    border-left-color: #dc3545;
    background: #fffafa;
}

.announcement-title {
    font-weight: 700;
    color: var(--dark);
}

.announcement-meta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
}

/* ===== UTILITIES ===== */
.transition-hover {
    transition: var(--transition);
}
.transition-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md) !important;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 991px) {
    .floating-badge {
        right: 0;
        bottom: 10px;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 70vh;
        min-height: 500px;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .section-padding {
        padding: 50px 0;
    }
    
    .stats-overlap-section {
        margin-top: -30px;
    }
}
