:root {
    /* Perubahan ke Tema Pastel RA/TK */
    --primary-color: #f43f5e;    /* Rose/Pink Ceria */
    --secondary-color: #f59e0b;  /* Amber/Kuning Hangat */
    --accent-color: #10b981;     /* Emerald/Hijau Alam */
    
    --text-main: #1e293b;
    --navbar-icon: #1e293b;
    --text-muted: #64748b;
    --surface-color: #fffafb;    /* Putih dengan sedikit rona pink */
    --light-soft: #fef2f4;       /* Background pink sangat muda */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --card-shadow: 0 15px 35px -5px rgba(244, 63, 94, 0.12);
    --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --letter-spacing-1: 0.1em;
}

/* --- RA Specific Styles --- */
.hero-ra {
    padding: 8rem 0 5rem;
    background: radial-gradient(circle at top right, rgba(244, 63, 94, 0.08), transparent 400px),
                radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.08), transparent 400px);
    position: relative;
    overflow: hidden;
}

.blob-shape {
    position: absolute;
    z-index: -1;
    filter: blur(40px);
    opacity: 0.4;
}

.blob-1 { top: 10%; right: -5%; width: 300px; height: 300px; background: var(--primary-color); border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; animation: morph 8s ease-in-out infinite; }
.blob-2 { bottom: 10%; left: -5%; width: 250px; height: 250px; background: var(--secondary-color); border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; animation: morph 8s ease-in-out infinite reverse; }

@keyframes morph {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
}

.card-ra {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(244, 63, 94, 0.1);
    border-radius: 30px;
    transition: 0.3s;
}

.card-ra:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(244, 63, 94, 0.15);
}
/* --- End RA Styles --- */

.bg-light-soft {
    background-color: var(--light-soft);
}

.letter-spacing-1 {
    letter-spacing: var(--letter-spacing-1);
}

.letter-spacing-2 {
    letter-spacing: var(--letter-spacing-2);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    background-color: #ffffff;
    line-height: 1.7;
    overflow-x: hidden;
}

.navbar {
    padding: 1.25rem 0;
    transition: var(--transition-base);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.75rem !important;
    font-weight: 700;
    color: #0f172a !important;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.25rem !important;
    }
}

.nav-link {
    font-weight: 600;
    color: #334155 !important;
    margin: 0 12px;
    position: relative;
    transition: 0.3s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Dropdown Animation (Desktop only) */
@media (min-width: 992px) {
    .dropdown-menu {
        display: block !important;
        visibility: hidden;
        opacity: 0;
        transform: translateY(15px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }

    .dropdown-menu.show {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.dropdown-item {
    transition: 0.2s;
}

.dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08);
    /* Indigo light tint */
    padding-left: 1.5rem;
}

.dropdown-item.active {
    background: var(--primary-color) !important;
    color: #ffffff !important;
}

.logo-sekolah {
    height: 40px;
    width: auto;
    object-fit: contain;
    background-color: #fff;
    border-radius: 10px;
    padding: 3px;
    transition: transform 0.35s ease;
}

@media (min-width: 992px) {
    .logo-sekolah {
        height: 50px;
        padding: 4px;
        border-radius: 12px;
    }
}

.logo-sekolah:hover {
    transform: translateY(-3px) scale(1.05);
}

.hero {
    padding: 80px 0 60px 0; /* Sedikit dikurangi untuk desktop (atas 80px, bawah 60px) */
    position: relative;
    background: radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
    overflow: hidden;
}

/* Tambahan: Khusus untuk layar HP (mobile), padding dikecilkan */
@media (max-width: 768px) {
    .hero {
        padding: 20px 0 40px 0; /* Jarak atas 20px, bawah 40px agar pas di HP */
    }
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 2rem;
    color: #0f172a;
}

.hero-text {
    font-size: 1.15rem;
    color: #475569;
    margin-bottom: 2.5rem;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid currentColor;
    border-radius: 12px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    background: var(--primary-color);
    left: 50%;
    transform: translateX(-50%);
    top: 6px;
    border-radius: 2px;
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        opacity: 1;
        top: 6px;
    }

    100% {
        opacity: 0;
        top: 22px;
    }
}

.hero-image {
    border-radius: 40px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.15);
    animation: float 6s ease-in-out infinite;
    max-width: 100%;
    height: auto;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.stat-icon {
    font-size: 1.75rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    content-visibility: auto;
    contain-intrinsic-size: 100px 300px;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.12);
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.12);
}

.section-padding {
    padding: 100px 0;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 10px 20px -5px rgba(244, 63, 94, 0.3);
    border: none;
    padding: 14px 32px;
    border-radius: 16px;
    font-weight: 700;
    color: white !important;
    transition: var(--transition-base);
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -8px rgba(99, 102, 241, 0.4);
}

.btn-outline-custom {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px 30px;
    border-radius: 16px;
    font-weight: 600;
    color: #475569;
    transition: var(--transition-base);
    text-decoration: none;
    display: inline-block;
}

.btn-outline-custom:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.text-main {
    color: var(--text-main) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.vision-box {
    border-radius: 40px;
    padding: 4rem 3rem !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.8));
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.vision-accent {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    z-index: 0;
}

.vision-box .lead {
    font-weight: 500;
}

.misi-item {
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    padding-top: 3.5rem !important;
}

.misi-number {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    letter-spacing: 0.1em;
}

.misi-item p {
    font-weight: 600;
    color: #475569;
    font-size: 0.95rem;
}

.misi-grid .misi-item:hover {
    border-color: var(--primary-color);
    background-color: #fff;
}

.news-card {
    transition: var(--transition-base);
}

.news-card .card-body {
    padding: 2rem;
}

.gallery-item {
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transition: 0.3s;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item img {
    transition: 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.advantage-card {
    background: white;
    border-radius: 28px;
    border: 1px solid transparent;
    transition: var(--transition-base);
    height: 100%;
}

.advantage-card:hover {
    background: #ffffff;
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.05);
}

.advantage-icon-box {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto;
    transition: 0.3s;
}

.advantage-card:hover .advantage-icon-box {
    background: var(--primary-color);
    color: white;
    transform: rotate(10deg);
}

.read-more-indicator {
    display: inline-flex;
    align-items: center;
    transition: 0.3s;
}

.news-card:hover .read-more-indicator {
    transform: translateX(5px);
}

.content-berita {
    color: var(--text-main);
    line-height: 1.8;
}

body.dark-mode .content-berita {
    color: var(--text-dark);
}

.breadcrumb-custom {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.breadcrumb-custom a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-custom a:hover {
    text-decoration: underline;
}

.section-subtitle {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

body.dark-mode .section-subtitle {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

/* Performance Optimizations */
@media (max-width: 768px) {

    .navbar {
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 0.25rem 0 !important;
        /* Ultra compact height */
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .navbar-brand {
        font-size: 1.1rem !important;
        /* Smaller brand text */
    }

    .logo-sekolah {
        height: 34px !important;
        /* Smaller logo */
        padding: 2px !important;
    }

    body.dark-mode .navbar {
        background: rgba(15, 23, 42, 0.98) !important;
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .navbar-collapse {
        background: rgba(255, 255, 255, 1);
        margin-top: 4px !important;
        /* Minimal gap */
        padding: 6px !important;
        /* Compact drawer */
        border-radius: 14px !important;
        /* Softer drawer look */
        box-shadow: 0 8px 20px -6px rgba(0, 0, 0, .15);
        border: 1px solid rgba(0, 0, 0, 0.06);
    }

    body.dark-mode .navbar-collapse {
        background: #1e293b;
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.5);
    }

    .navbar-nav {
        text-align: left !important;
        align-items: stretch !important;
        gap: 0;
        /* No gap between items */
    }

    .nav-item {
        width: 100%;
        margin: 0 !important;
    }

    .nav-link {
        padding: 8px 12px !important;
        /* Tighter padding */
        border-radius: 10px;
        margin: 1px 0 !important;
        font-size: 0.9rem;
        /* Slightly smaller font */
        font-weight: 500;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        color: #475569 !important;
        transition: 0.2s all ease;
        min-height: 40px;
        /* Still comfortable but more compact */
    }

    .nav-link.active {
        background: linear-gradient(to right,
                rgba(99, 102, 241, .12),
                rgba(99, 102, 241, .03)) !important;
        /* Cleaner gradient background */
        color: var(--primary-color) !important;
        font-weight: 700;
        border-left: none !important;
        /* Removed hard border */
    }

    .nav-link i {
        font-size: 1.05rem;
        /* Slightly smaller icons */
        margin-right: 8px !important;
        width: 20px;
        /* Narrower icon box */
        text-align: center;
        opacity: 0.7;
        color: var(--primary-color);
    }

    .nav-link.active i {
        opacity: 1;
    }

    .nav-link::after {
        content: '\F285';
        font-family: 'bootstrap-icons';
        font-size: 0.7rem;
        margin-left: auto;
        opacity: 0.15;
        transition: 0.3s;
    }

    .nav-link:hover::after,
    .nav-link.active::after {
        transform: translateX(2px);
        opacity: 0.4;
    }

    .dropdown-toggle::after {
        display: none;
    }

    .btn-primary-custom {
        width: 100%;
        margin-top: 6px;
        padding: 10px;
        border-radius: 10px;
        font-size: 0.95rem;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
    }

    .dropdown-menu {
        display: none !important;
        /* Hide by default on mobile to prevent gaps */
        text-align: left;
        background: rgba(0, 0, 0, 0.01) !important;
        border: 1px solid rgba(0, 0, 0, 0.03) !important;
        margin: 2px 0 4px 24px !important;
        /* Less indentation */
        padding: 2px !important;
        border-radius: 10px !important;
        box-shadow: none !important;
        position: static !important;
        width: calc(100% - 24px) !important;
    }

    .dropdown-menu.show {
        display: block !important;
        /* Show only when active */
    }

    body.dark-mode .dropdown-menu {
        background: rgba(255, 255, 255, 0.02) !important;
        border-color: rgba(255, 255, 255, 0.04) !important;
    }

    .dropdown-item {
        padding: 8px 12px !important;
        /* Compact dropdown items */
        border-radius: 8px !important;
        font-size: 0.875rem;
        margin-bottom: 2px;
        color: #64748b !important;
        min-height: 38px;
    }

    .dropdown-item.active,
    .dropdown-item:active {
        background: var(--primary-color) !important;
        color: white !important;
    }

    .dropdown-item:hover {
        background: rgba(99, 102, 241, 0.06) !important;
        padding-left: 15px !important;
        color: var(--primary-color) !important;
    }

    /* Style for Dark Mode Toggle in Mobile */
    #darkModeToggle {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 6px auto !important;
        padding: 0;
        background: var(--light-soft);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    body.dark-mode #darkModeToggle {
        background: #334155;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .glass-card,
    .vision-box {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }

    /* Force visibility for AOS elements on mobile to prevent "invisible" screen */
    body [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

.hero-image {
    will-change: transform;
    transform: translateZ(0);
    /* Force GPU */
}

/* =========================================
   1. PRELOADER FULLSCREEN
   ========================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Class yang akan ditambahkan oleh JS untuk menghilang */
#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

/* Desain animasi spinning ring modern */
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef; /* Warna ring dasar (abu terang) */
    border-bottom-color: var(--primary-color, #0b4d2c); /* Warna putaran (Ganti ke warna sekolah Anda) */
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   2. BACK TO TOP BUTTON
   ========================================= */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color, #0b4d2c);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 999;
    /* Disembunyikan secara default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Class saat tombol muncul */
#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    filter: brightness(1.1); /* Sedikit lebih terang saat di-hover */
}

/* Warna teks Darussalam di mode terang */
.brand-text-dark {
    color: #1e293b;
    transition: color 0.4s ease;
}