/* =========================================================
   NAVBAR DESA - MODERN
   ========================================================= */

/* =========================================================
   NAVBAR UTAMA
   ========================================================= */

.navbar {
    position: sticky;

    top: 0;

    z-index: 9999;

    width: 100%;

    height: 82px;

    background: linear-gradient(135deg, #064e3b 0%, #047857 45%, #059669 100%);

    box-shadow: 0 8px 30px rgba(6, 78, 59, 0.18);

    overflow: visible;

    transition: height 0.35s ease, background 0.35s ease, box-shadow 0.35s ease,
        backdrop-filter 0.35s ease;
}

/* =========================================================
   NAVBAR SAAT SCROLL
   ========================================================= */

.navbar.scrolled {
    height: 70px;

    background: rgba(3, 65, 48, 0.94);

    backdrop-filter: blur(18px);

    -webkit-backdrop-filter: blur(18px);

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

/* =========================================================
   CONTAINER
   ========================================================= */

.nav-container {
    position: relative;

    z-index: 10;

    height: 82px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    transition: height 0.35s ease;
}

.navbar.scrolled .nav-container {
    height: 70px;
}

/* =========================================================
   CORAK BACKGROUND
   ========================================================= */

.navbar-pattern {
    position: absolute;

    inset: 0;

    z-index: 0;

    pointer-events: none;

    opacity: 0.13;

    background-image: radial-gradient(
            circle at 10% 20%,
            rgba(255, 255, 255, 0.65) 0,
            rgba(255, 255, 255, 0.65) 2px,
            transparent 3px
        ),
        radial-gradient(
            circle at 80% 70%,
            rgba(255, 255, 255, 0.5) 0,
            rgba(255, 255, 255, 0.5) 2px,
            transparent 3px
        );

    background-size: 55px 55px, 75px 75px;

    animation: patternMove 18s linear infinite;
}

@keyframes patternMove {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 100px 50px, -80px 80px;
    }
}

/* =========================================================
   GLOW KIRI
   ========================================================= */

.navbar-glow {
    position: absolute;

    border-radius: 50%;

    pointer-events: none;

    filter: blur(10px);

    opacity: 0.5;

    z-index: 0;
}

.navbar-glow-left {
    width: 220px;
    height: 220px;

    left: -120px;
    top: -150px;

    background: rgba(52, 211, 153, 0.15);
}

.navbar-glow-right {
    width: 280px;
    height: 280px;

    right: -160px;
    bottom: -220px;

    background: rgba(110, 231, 183, 0.12);
}

/* =========================================================
   ORNAMEN LENGKUNG
   ========================================================= */

.navbar::before {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    left: -140px;
    top: -210px;

    border-radius: 50%;

    border: 45px solid rgba(255, 255, 255, 0.05);

    pointer-events: none;
}

.navbar::after {
    content: "";

    position: absolute;

    width: 330px;
    height: 330px;

    right: -180px;
    bottom: -260px;

    border-radius: 50%;

    border: 55px solid rgba(255, 255, 255, 0.06);

    pointer-events: none;
}

/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;

    align-items: center;

    gap: 13px;

    color: white;

    text-decoration: none;

    transition: transform 0.3s ease;
}

.brand:hover {
    transform: translateY(-2px);
}

/* =========================================================
   LOGO
   ========================================================= */

.brand-logo {
    width: 52px;
    height: 52px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 5px;

    background: transparent;

    border-radius: 15px;

    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.16);

    transition: width 0.35s ease, height 0.35s ease, border-radius 0.35s ease,
        transform 0.35s ease, box-shadow 0.35s ease;
}

.brand:hover .brand-logo {
    transform: rotate(-3deg) scale(1.04);

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
}

/* Logo ketika scroll */

.navbar.scrolled .brand-logo {
    width: 45px;
    height: 45px;

    border-radius: 12px;
}

/* =========================================================
   GAMBAR LOGO
   ========================================================= */

.brand-logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

/* =========================================================
   BRAND TEXT
   ========================================================= */

.brand-text {
    display: flex;

    flex-direction: column;

    line-height: 1.25;
}

.brand-text span {
    font-size: 10px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 1.2px;

    color: rgba(255, 255, 255, 0.75);

    margin-bottom: 3px;

    transition: opacity 0.3s ease;
}

.brand-text strong {
    font-size: 19px;

    font-weight: 750;

    color: white;

    white-space: nowrap;

    transition: font-size 0.35s ease;
}

/* Saat scroll */

.navbar.scrolled .brand-text strong {
    font-size: 17px;
}

/* =========================================================
   MENU
   ========================================================= */

.nav-menu {
    display: flex;

    align-items: center;

    gap: 5px;
}

/* =========================================================
   LINK MENU
   ========================================================= */

.nav-link {
    position: relative;

    display: flex;

    align-items: center;

    padding: 10px 15px;

    border-radius: 10px;

    color: rgba(255, 255, 255, 0.82);

    text-decoration: none;

    font-size: 14px;

    font-weight: 600;

    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

/* =========================================================
   HOVER
   ========================================================= */

.nav-link:hover {
    color: white;

    background: rgba(255, 255, 255, 0.12);

    transform: translateY(-2px);
}

/* =========================================================
   MENU AKTIF
   ========================================================= */

.nav-link.active {
    color: #065f46;

    background: white;

    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.nav-link.active:hover {
    color: #047857;

    background: #f0fdf4;

    transform: translateY(-2px);
}

/* =========================================================
   UNDERLINE ANIMASI
   ========================================================= */

.nav-link:not(.active)::after {
    content: "";

    position: absolute;

    left: 15px;
    right: 15px;

    bottom: 5px;

    height: 2px;

    border-radius: 20px;

    background: #ffffff;

    transform: scaleX(0);

    transform-origin: center;

    transition: transform 0.3s ease;
}

.nav-link:not(.active):hover::after {
    transform: scaleX(1);
}

/* =========================================================
   TOMBOL HAMBURGER
   ========================================================= */

.menu-toggle {
    display: none;

    position: relative;

    z-index: 10001;

    width: 45px;
    height: 45px;

    padding: 10px;

    border: 1px solid rgba(255, 255, 255, 0.25);

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.1);

    cursor: pointer;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 5px;

    transition: background 0.25s ease, transform 0.25s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.18);

    transform: translateY(-1px);
}

/* =========================================================
   GARIS HAMBURGER
   ========================================================= */

.menu-toggle span {
    display: block;

    width: 21px;
    height: 2px;

    border-radius: 10px;

    background: white;

    transition: transform 0.3s ease, opacity 0.25s ease;
}

/* =========================================================
   HAMBURGER → X
   ========================================================= */

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   GARIS BAWAH
   ========================================================= */

.navbar-bottom-line {
    position: absolute;

    left: 0;
    right: 0;

    bottom: 0;

    height: 2px;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.35),
        transparent
    );

    opacity: 0.8;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 950px) {
    .nav-menu {
        gap: 2px;
    }

    .nav-link {
        padding: 9px 11px;

        font-size: 13px;
    }

    .brand-text strong {
        font-size: 17px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 800px) {
    /* -----------------------------------------
       NAVBAR
    ----------------------------------------- */

    .navbar {
        height: 72px;

        overflow: visible;
    }

    .navbar.scrolled {
        height: 65px;
    }

    /* -----------------------------------------
       CONTAINER
    ----------------------------------------- */

    .nav-container {
        height: 72px;
    }

    .navbar.scrolled .nav-container {
        height: 65px;
    }

    /* -----------------------------------------
       LOGO
    ----------------------------------------- */

    .brand-logo {
        width: 45px;
        height: 45px;

        border-radius: 12px;
    }

    .navbar.scrolled .brand-logo {
        width: 40px;
        height: 40px;

        border-radius: 10px;
    }

    /* -----------------------------------------
       TEXT
    ----------------------------------------- */

    .brand-text span {
        font-size: 8px;

        letter-spacing: 0.8px;
    }

    .brand-text strong {
        font-size: 16px;
    }

    .navbar.scrolled .brand-text strong {
        font-size: 15px;
    }

    /* -----------------------------------------
       HAMBURGER
    ----------------------------------------- */

    .menu-toggle {
        display: flex;
    }

    /* -----------------------------------------
       MENU MOBILE
    ----------------------------------------- */

    .nav-menu {
        position: absolute;

        top: calc(100% + 10px);

        left: 0;
        right: 0;

        z-index: 10000;

        display: flex;

        flex-direction: column;

        align-items: stretch;

        gap: 5px;

        padding: 12px;

        background: linear-gradient(145deg, #064e3b, #047857);

        border: 1px solid rgba(255, 255, 255, 0.12);

        border-radius: 18px;

        box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);

        /* Kondisi tertutup */

        opacity: 0;

        visibility: hidden;

        pointer-events: none;

        transform: translateY(-12px) scale(0.98);

        transform-origin: top center;

        transition: opacity 0.25s ease, transform 0.25s ease,
            visibility 0.25s ease;
    }

    /* -----------------------------------------
       MENU TERBUKA
    ----------------------------------------- */

    .nav-menu.show {
        opacity: 1;

        visibility: visible;

        pointer-events: auto;

        transform: translateY(0) scale(1);
    }

    /* -----------------------------------------
       LINK MOBILE
    ----------------------------------------- */

    .nav-link {
        width: 100%;

        display: flex;

        align-items: center;

        padding: 13px 15px;

        border-radius: 10px;

        color: rgba(255, 255, 255, 0.9);

        font-size: 14px;

        transform: none;

        transition: background 0.25s ease, color 0.25s ease,
            padding-left 0.25s ease;
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.12);

        color: white;

        transform: none;

        padding-left: 20px;
    }

    /* -----------------------------------------
       AKTIF MOBILE
    ----------------------------------------- */

    .nav-link.active {
        color: #065f46;

        background: white;

        box-shadow: none;
    }

    .nav-link.active:hover {
        background: #f0fdf4;

        color: #047857;

        padding-left: 20px;
    }

    /* -----------------------------------------
       HILANGKAN UNDERLINE
    ----------------------------------------- */

    .nav-link:not(.active)::after {
        display: none;
    }

    /* -----------------------------------------
       ANIMASI LINK
    ----------------------------------------- */

    .nav-menu.show .nav-link {
        animation: mobileMenuItem 0.35s ease both;
    }

    .nav-menu.show .nav-link:nth-child(1) {
        animation-delay: 0.03s;
    }

    .nav-menu.show .nav-link:nth-child(2) {
        animation-delay: 0.06s;
    }

    .nav-menu.show .nav-link:nth-child(3) {
        animation-delay: 0.09s;
    }

    .nav-menu.show .nav-link:nth-child(4) {
        animation-delay: 0.12s;
    }

    .nav-menu.show .nav-link:nth-child(5) {
        animation-delay: 0.15s;
    }

    .nav-menu.show .nav-link:nth-child(6) {
        animation-delay: 0.18s;
    }
}

/* =========================================================
   ANIMASI MENU MOBILE
   ========================================================= */

@keyframes mobileMenuItem {
    from {
        opacity: 0;

        transform: translateY(-8px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }
}

/* =========================================================
   MOBILE KECIL
   ========================================================= */

@media (max-width: 450px) {
    .brand-logo {
        width: 42px;
        height: 42px;

        border-radius: 11px;
    }

    .navbar.scrolled .brand-logo {
        width: 38px;
        height: 38px;
    }

    .brand-text span {
        display: none;
    }

    .brand-text strong {
        font-size: 15px;
    }

    .navbar.scrolled .brand-text strong {
        font-size: 14px;
    }

    .menu-toggle {
        width: 43px;
        height: 43px;
    }
}
