:root {
    --brand-primary: #2563eb;
    --brand-primary-soft: #eff6ff;
    --brand-accent: #0ea5e9;
    --brand-dark: #0f172a;
    --brand-muted: #64748b;
    --brand-bg: #f8fafc;
    --brand-card-bg: #ffffff;
    --brand-border: #f1f5f9;
    --radius-soft: 14px;
    --shadow-subtle: 0 4px 18px -2px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 16px 26px -8px rgba(37, 99, 235, 0.10);
}

/* ============================================================
   CUSTOM SCROLLBAR (BRAND PRIMARY #2563eb)
   ============================================================ */
html {
    font-size: 14.5px;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-primary) #f1f5f9;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background-color: var(--brand-primary);
    border-radius: 8px;
    border: 2px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #1d4ed8;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--brand-bg);
    color: #334155;
    letter-spacing: -0.01em;
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

h1, .h1 { font-size: 1.75rem; font-weight: 700; }
h2, .h2 { font-size: 1.5rem; font-weight: 700; }
h3, .h3 { font-size: 1.25rem; font-weight: 700; }
h4, .h4 { font-size: 1.1rem; font-weight: 600; }
h5, .h5 { font-size: 0.98rem; font-weight: 600; }
h6, .h6 { font-size: 0.88rem; font-weight: 600; }

/* ============================================================
   HEADER & NAVIGASI (FIXED STICKY HEADER & Z-INDEX TINGGI)
   ============================================================ */
.glass-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    z-index: 1030 !important;
}

.navbar, .navbar-collapse {
    overflow: visible !important;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: #475569 !important;
    padding: 0.45rem 0.8rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover, 
.nav-link.active {
    color: var(--brand-primary) !important;
    background-color: var(--brand-primary-soft);
}

/* Dropdown Tingkat 1 */
.dropdown-menu {
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    box-shadow: 0 14px 30px -5px rgba(15, 23, 42, 0.12);
    padding: 0.45rem;
    font-size: 0.95rem;
    z-index: 1050 !important;
}

.dropdown-item {
    font-weight: 500;
    padding: 0.45rem 0.8rem;
    border-radius: 6px;
    color: #475569;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--brand-primary-soft);
    color: var(--brand-primary);
}

/* Sub-Menu Tingkat 2 & 3 */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-submenu-menu {
    top: 0;
    left: 100%;
    margin-top: -4px;
    margin-left: 2px;
    display: none;
    z-index: 1060 !important;
}

.dropdown-submenu > .dropdown-submenu-menu.show {
    display: block;
}

/* Responsivitas Desktop (>= 992px) */
@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
        animation: menuFadeIn 0.2s ease-in-out;
    }

    .dropdown-submenu:hover > .dropdown-submenu-menu {
        display: block;
        animation: menuFadeIn 0.2s ease-in-out;
    }

    .dropdown-submenu:hover > a > .sub-arrow {
        transform: translateX(3px);
        transition: transform 0.2s ease;
        color: var(--brand-primary) !important;
    }

    /* Proteksi Overflow Layar Kanan */
    .navbar-nav > .nav-item:nth-last-child(-n+2) .dropdown-submenu > .dropdown-submenu-menu {
        left: auto !important;
        right: 100% !important;
        margin-left: 0 !important;
        margin-right: 2px !important;
    }

    .navbar-nav > .nav-item:nth-last-child(-n+2) .dropdown-submenu .sub-arrow {
        transform: rotate(180deg);
    }
    
    .navbar-nav > .nav-item:nth-last-child(-n+2) .dropdown-submenu:hover > a > .sub-arrow {
        transform: rotate(180deg) translateX(3px);
    }
}

/* Responsivitas Mobile (< 992px) */
@media (max-width: 991.98px) {
    .dropdown-submenu > .dropdown-submenu-menu {
        position: static !important;
        margin-left: 1rem !important;
        margin-right: 0 !important;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        box-shadow: none;
    }
}

/* ============================================================
   KOMPONEN CARD & ELEMEN UI
   ============================================================ */
.card-soft {
    background: var(--brand-card-bg);
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-soft);
    box-shadow: var(--shadow-subtle);
    position: relative;
    isolation: isolate;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-soft:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.badge-soft {
    background-color: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

/* Direktori Ekstrakurikuler Item */
.ekskul-card-item {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.ekskul-card-item:hover {
    background-color: var(--brand-primary-soft);
    border-color: rgba(37, 99, 235, 0.25);
    transform: translateX(3px);
}

/* Floating Button Arrow Up */
.btn-back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
    background-color: var(--brand-primary);
    color: #ffffff;
    border-radius: 50%;
    border: none;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1040;
}

.btn-back-to-top:hover {
    background-color: #1d4ed8;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.38);
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Penanganan Tabel border="0" */
.konten-artikel table[border="0"],
.konten-artikel table[border="0"] th,
.konten-artikel table[border="0"] td {
    border: none !important;
}

.konten-artikel table[border="0"] tr:hover {
    background-color: transparent !important;
}

/* ============================================================
   HERO CAROUSEL MODERN & GLASSMORPHISM
   ============================================================ */
.hero-carousel-wrapper {
    background-color: #0f172a;
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
}

.hero-slide-item {
    height: 480px;
}

.hero-image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hero-banner-img {
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform 7s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-item.active .hero-banner-img {
    transform: scale(1.08);
}

.hero-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.15) 0%,
        rgba(15, 23, 42, 0.45) 50%,
        rgba(15, 23, 42, 0.88) 100%
    );
}

.hero-carousel-wrapper .carousel-caption {
    z-index: 2;
    pointer-events: none;
}

/* Glass Card Deskripsi Hero (Latar Transparan) */
.hero-glass-card {
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    max-width: 580px;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

.hero-title {
    font-size: 1.45rem;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }
}

.hero-desc {
    line-height: 1.6;
    color: rgba(241, 245, 249, 0.9) !important;
}

.hero-carousel-wrapper .carousel-indicators {
    gap: 6px;
}

.hero-carousel-wrapper .carousel-indicators [data-bs-target] {
    width: 18px;
    height: 4px;
    border-radius: 4px;
    border: none;
    background-color: rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.hero-carousel-wrapper .carousel-indicators .active {
    width: 38px;
    background-color: #ffffff;
}

.hero-control-btn {
    width: 60px;
    opacity: 0.7;
    pointer-events: auto;
    transition: opacity 0.25s ease;
}

.hero-control-btn:hover {
    opacity: 1;
}

.hero-nav-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.25s ease;
}

.hero-control-btn:hover .hero-nav-circle {
    background: rgba(37, 99, 235, 0.9);
    border-color: rgba(37, 99, 235, 1);
    transform: scale(1.08);
}

/* ============================================================
   TOMBOL CLOSE & RESTORE HERO GLASS CARD
   ============================================================ */
/* Tombol Desktop */
.btn-close-glass {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.btn-close-glass:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: scale(1.1);
}

/* Tombol Mobile Touch-Friendly */
.btn-close-mobile-glass {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-close-mobile-glass:active {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(0.92);
}

/* Tombol Restore Teks */
.btn-restore-glass {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    animation: fadeInUp 0.3s ease forwards;
    z-index: 5;
}

.btn-restore-glass:hover,
.btn-restore-glass:active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
}

/* ============================================================
   RESPONSIF HERO CAROUSEL FULL WIDTH (MOBILE < 768px)
   ============================================================ */
@media (max-width: 767.98px) {
    #hero-section {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    #hero-section .container,
    #heroModernCarousel,
    .hero-slide-item,
    .hero-banner-img {
        border-radius: 0 !important;
    }

    .hero-slide-item,
    .hero-image-wrap {
        height: 340px !important;
    }

    .hero-carousel-wrapper .carousel-caption {
        padding-left: 14px !important;
        padding-right: 14px !important;
        padding-bottom: 24px !important;
    }

    .hero-glass-card {
        background: rgba(15, 23, 42, 0.15) !important;
        backdrop-filter: blur(3px) !important;
        -webkit-backdrop-filter: blur(3px) !important;
        padding: 12px 14px !important;
        border-radius: 12px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .hero-title {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
    }

    .hero-desc {
        display: block !important;
        font-size: 0.76rem !important;
        line-height: 1.4 !important;
        margin-bottom: 8px !important;
        color: rgba(255, 255, 255, 0.88) !important;
    }

    .hero-glass-card .btn {
        font-size: 0.75rem !important;
        padding: 3px 12px !important;
    }

    .hero-carousel-wrapper .carousel-indicators {
        margin-bottom: 6px !important;
    }

    .hero-control-btn {
        width: 36px;
    }

    .hero-nav-circle {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .btn-restore-glass {
        font-size: 0.75rem;
        padding: 5px 12px !important;
        margin-bottom: 6px;
    }
}

/* ============================================================
   PAGE PRELOADER / LOADING SPINNER
   ============================================================ */
#page-preloader {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#page-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.custom-spinner {
    width: 48px;
    height: 48px;
    border: 3.5px solid var(--brand-primary-soft);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   STYLING MOBILE OFFCANVAS DRAWER
   ============================================================ */
.mobile-offcanvas-menu {
    width: 310px !important;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
}

.mobile-menu-list {
    margin: 0;
    padding: 0;
}

.mobile-menu-item {
    margin-bottom: 3px;
}

.mobile-menu-link {
    display: block;
    padding: 0.55rem 0.75rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    background-color: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.mobile-menu-parent {
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.mobile-menu-parent:hover {
    background-color: #f8fafc;
}

.btn-mobile-expand {
    color: #64748b;
    border: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, color 0.2s ease;
}

.btn-mobile-expand:hover {
    color: var(--brand-primary);
}

.btn-mobile-expand[aria-expanded="true"] .mobile-expand-icon {
    transform: rotate(180deg);
}

.mobile-expand-icon {
    font-size: 0.72rem;
    transition: transform 0.25s ease;
}

.mobile-sub-tree {
    border-color: #e2e8f0 !important;
    position: relative;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   FLOATING SECTION INDICATOR ANIMATION
   ============================================================ */
.section-indicator-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1050;
    gap: 16px;
}

.indicator-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    padding: 4px 0;
}

.indicator-label {
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(37, 99, 235, 0.35);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.indicator-item:hover .indicator-label {
    opacity: 1;
    transform: translateX(0);
}

.indicator-item:hover .indicator-dot {
    background-color: var(--brand-primary);
    transform: scale(1.3);
}

.indicator-item.active .indicator-dot {
    background-color: var(--brand-primary);
    transform: scale(1.5);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.indicator-item.active .indicator-label {
    opacity: 1;
    transform: translateX(0);
    background: var(--brand-primary);
}