/* ================= HEADER ================= */
header{
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* NAVBAR */
.navbar{
    width: 90%;
    margin: auto;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* LOGO */
.logo img{
    width: 200px;
    height: 70px;
}

.overlay{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1500;
}

.overlay.active{
    opacity: 1;
    visibility: visible;
}

/* ================= DESKTOP MENU ================= */
.nav-links{
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links li a{
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: 0.3s;
    font-family: 'Segoe UI', sans-serif;
    color: inherit; /* FIX: ikut theme */
}

/* hover underline animation */
.nav-links li a::after{
    content: "";
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0%;
    height: 2px;
    background: currentColor; /* FIX */
    transition: 0.3s;
}

.nav-links li a:hover::after{
    width: 100%;
}

/* ================= NAV AUTH ================= */
.nav-btn{
    display: flex;
    align-items: center;
}

/* ================= DROPDOWN ================= */
.dropdown{
    position: relative;
}

/* MAIN BUTTON */
.dropdown-btn{
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
    color: inherit; /* FIX */
}

/* ICON ikut warna button */
.dropdown-btn i{
    color: inherit;
}

/* dropdown menu */
.dropdown-menu{
    position: absolute;
    top: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);

    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    min-width: 220px;
    border-radius: 14px;
    padding: 10px;

    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* show dropdown */
.dropdown:hover .dropdown-menu{
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* dropdown items */
.dropdown-menu li{
    list-style: none;
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.dropdown-menu li a{
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: #000; /* FIX: ALWAYS BLACK */
    width: 100%;
}

/* hover item */
.dropdown-menu li:hover{
    background: rgba(255,90,95,0.08);
}

/* ================= THEME CONTROL ================= */

/* NAV LINKS */
.navbar-light{
    color: #fff;
}

.navbar-dark{
    color: #000;
}

/* force semua link & button ikut theme */
.navbar-light a{
    color: #fff;
}

.navbar-dark a{
    color: #000;
}

/* ================= SUB DROPDOWN ================= */
.sub-dropdown{
    position: relative;
}

/* button ikut theme */
.sub-dropdown-btn{
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}

.sub-dropdown-btn i{
    color: inherit;
}

/* sub dropdown menu */
.sub-dropdown-menu{
    position: absolute;
    left: 105%;
    top: 0;
    background: rgba(255,255,255,0.95);
    min-width: 190px;
    border-radius: 12px;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: 0.25s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* show */
.sub-dropdown:hover .sub-dropdown-menu{
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* sub dropdown items ALWAYS BLACK */
.sub-dropdown-menu li{
    list-style: none;
    padding: 8px;
}

.sub-dropdown-menu li a{
    text-decoration: none;
    color: #000; /* FIX: ALWAYS BLACK */
    display: block;
}

/* ================= MOBILE ================= */
.menu-toggle{
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;

    font-size: 18px;
    color: #333;

    transition: 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.mobile-sidebar{
    position: fixed;
    top: 0;
    right: -100%;   /* tukar dari left ke right */
    left: auto;     /* reset left */

    width: 320px;
    height: 100vh;

    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    padding: 28px;
    z-index: 2000;

    box-shadow: -15px 0 40px rgba(0,0,0,0.12); /* arah shadow tukar */
    
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    border-top-left-radius: 20px;   /* tukar corner */
    border-bottom-left-radius: 20px;
}

.mobile-sidebar.active{
    right: 0;
}

.sidebar-profile-top{
    padding-top: 30px;
    margin-bottom: 10px;
    list-style: none;
}

.sidebar-profile-top a{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.06);
    text-decoration: none;
}

.avatar{
    width:40px;
    height:40px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#ddd;
}
.name{
    font-weight:600;
}

.profile-link{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
}

.profile-text{
    display:flex;
    flex-direction:column;
    line-height:1.2;
}

.mobile-dropdown-btn,
.mobile-sub-btn{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #222;
    transition: 0.25s;
    list-style: none;
}

.mobile-dropdown-btn:hover,
.mobile-sub-btn:hover{
    background: rgba(255, 90, 95, 0.08);
    transform: translateX(4px);
}

.mobile-sidebar a,
.mobile-sidebar button{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 12px;
    text-decoration: none;
    color: #222;
    font-weight: 500;
    transition: 0.25s;
    list-style: none;
}

.mobile-sidebar a:hover,
.mobile-sidebar button:hover{
    background: rgba(255, 90, 95, 0.08);
    transform: translateX(4px);
}

.mobile-sidebar ul{
    list-style: none;
}

/* MOBILE DROPDOWN */
.mobile-dropdown-menu,
.mobile-sub-menu{
    display: none;
    margin-left: 12px;
    padding-left: 10px;
    border-left: 2px solid rgba(255, 90, 95, 0.2);
    list-style: none;
}

.mobile-dropdown.active .mobile-dropdown-menu,
.mobile-sub-dropdown.active .mobile-sub-menu{
    display: block;
    animation: slideFade 0.3s ease;
}

.mobile-dropdown.active i,
.mobile-sub-dropdown.active i{
    transform: rotate(90deg);
    transition: 0.3s;
}

/* animation */
@keyframes slideFade{
    from{
        opacity: 0;
        transform: translateY(-8px);
    }
    to{
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-btn {
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: 'Segoe UI', sans-serif;
}

.btn {
    padding: 8px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.3s ease;
}

/* HOME PAGE (putih) */
.home .login-btn {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}

/* OTHER PAGES (hitam) */
.other .login-btn {
    background: transparent;
    border: 2px solid #000;
    color: #000;
}

/* =========================
   PROFILE DROPDOWN
========================= */

.profile-dropdown {
    position: relative;
    display: inline-block;
    font-family: Arial, sans-serif;
}

/* BUTTON */
.profile-btn {
    background: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: 0.3s ease;
}

.profile-btn i {
    font-size: 16px;
    color: #333;
}

.profile-btn span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* hover button */
.profile-btn:hover {
    background: #f5f5f5;
}

/* DROPDOWN MENU */
.profile-dropdown-menu {
    position: absolute;
    right: 0;
    top: 120%;
    width: 180px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    overflow: hidden;

    /* hidden default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: 0.25s ease;
    z-index: 999;
}

/* show dropdown on hover */
.profile-dropdown:hover .profile-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* MENU ITEMS */
.profile-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: 0.2s ease;
}

/* hover item */
.profile-dropdown-menu a:hover {
    background: #f2f2f2;
    color: #000;
}

/* ICON */
.profile-dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: #555;
}

/* =========================
   MOBILE (max 768px)
========================= */
@media (max-width: 768px) {

    /* HEADER */
    header {
        padding: 0 15px;
    }

    .navbar {
        width: 100%;
        height: 70px;
        padding: 0 10px;
    }

    /* LOGO */
    .logo img {
        width: 200px;
        height: auto;
    }

    .nav-links{
        display: none;
    }

    /* show hamburger */
    .menu-toggle{
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* hide profile/auth dekat navbar */
    .nav-btn{
        display:none;
    }

    /* OVERLAY FIX */
    .overlay {
        z-index: 1999;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* PROFILE BUTTON */
    .profile-btn {
        width: 100%;
        justify-content: space-between;
        padding: 12px 15px;
    }
}