﻿/* ============================================================
   navbar.css  –  Opsigo Topnav
   Letakkan di: wwwroot/css/navbar.css
   Load di App.razor: <link rel="stylesheet" href="/css/navbar.css" />
   JANGAN buat NavMenu.razor.css — gunakan file ini saja (global)
   ============================================================ */

/*@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');*/

/* ================================================================
   SHELL
   ================================================================ */
.topnav {
    position: relative;
    width: 100%;
    background: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /*margin-bottom: 82px;*/
}

/* 3-column: logo | links (center) | right */
.topnav-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: 64px;
    padding: 0 20rem;
    gap: 1rem;
}

/* ================================================================
   LOGO
   ================================================================ */
.topnav-brand {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    flex-shrink: 0;
}

    .topnav-brand img {
        height: 50px;
        width: auto;
        object-fit: contain;
        display: block;
        transition: opacity 0.2s;
    }

    .topnav-brand:hover img {
        opacity: 0.8;
    }

/* ================================================================
   CENTER NAV LINKS
   Semua selector pakai !important supaya override Bootstrap/global
   ================================================================ */
.topnav-links {
    display: flex;
    align-items: stretch; /* link bisa full height */
    justify-content: flex-end;
    gap: 10px;
    height: 64px;
}

    /* Target <a> yang Blazor NavLink hasilkan */
    .topnav-links a,
    .topnav-links a.tnav-link {
        position: relative;
        display: inline-flex !important;
        align-items: center !important;
        padding: 0 18px !important;
        height: 64px !important;
        line-height: 1 !important;
        /* Reset semua kemungkinan Bootstrap override */
        color: #4b5563 !important;
        text-decoration: none !important;
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        outline: none !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
        white-space: nowrap !important;
        /* Bottom border indicator */
        border-bottom: 2.5px solid transparent !important;
        border-top: 2.5px solid transparent !important; /* balance supaya text tetap center */

        transition: color 0.18s, border-color 0.18s;
    }

        .topnav-links a:hover,
        .topnav-links a.tnav-link:hover {
            color: #0d47a1 !important;
            text-decoration: none !important;
            background: none !important;
        }

        /* Blazor NavLink adds "active" when route matches */
        .topnav-links a.active,
        .topnav-links a.tnav-link.active {
            color: #0d47a1 !important;
            font-weight: 700 !important;
            border-bottom-color: #0d47a1 !important;
            text-decoration: none !important;
        }

/* ================================================================
   RIGHT CLUSTER
   ================================================================ */
.topnav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

/* Bell icon button */
.topnav-icon-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: none !important;
    background: none !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    transition: background 0.18s, color 0.18s;
    flex-shrink: 0;
    padding: 0 !important;
    box-shadow: none !important;
}

    .topnav-icon-btn:hover {
        background: #f3f4f6 !important;
        color: #0d47a1 !important;
    }

/* Sign-in button */
.topnav-signin {
    display: inline-flex !important;
    align-items: center !important;
    padding: 7px 18px !important;
    background: #0d47a1 !important;
    color: #fff !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    border-radius: 7px !important;
    text-decoration: none !important;
    transition: background 0.2s;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    border: none !important;
}

    .topnav-signin:hover {
        background: #1565c0 !important;
        color: #fff !important;
        text-decoration: none !important;
    }

/* ================================================================
   USER TOGGLE
   ================================================================ */
.topnav-user-menu {
    position: relative;
}

.topnav-user-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    padding: 4px 10px 4px 4px !important;
    background: none !important;
    border: none !important;
    border-radius: 40px !important;
    cursor: pointer !important;
    transition: background 0.18s;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    box-shadow: none !important;
}

    .topnav-user-toggle:hover {
        background: #f3f4f6 !important;
    }

.topnav-user-menu.open .topnav-user-toggle {
    background: #f0f5ff !important;
}

.topnav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    user-select: none;
}

.topnav-user-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.25;
}

.topnav-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topnav-user-role {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.topnav-chevron {
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.2s;
    pointer-events: none;
}

.topnav-user-menu.open .topnav-chevron {
    transform: rotate(180deg);
}

/* ================================================================
   DROPDOWN PANEL
   ================================================================ */
.topnav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f0f2f6;
    box-shadow: 0 8px 28px rgba(0,0,0,0.11), 0 1px 3px rgba(0,0,0,0.05);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    z-index: 1100;
}

    .topnav-dropdown.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.topnav-dd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 12px;
}

.topnav-dd-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    user-select: none;
}

.topnav-dd-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.3;
}

.topnav-dd-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topnav-dd-role {
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 500;
}

.topnav-dd-sep {
    height: 1px;
    background: #f3f4f6;
    margin: 4px 0;
}

/* Dropdown items – reset Bootstrap link style aggressively */
.topnav-dropdown a.topnav-dd-item,
.topnav-dropdown button.topnav-dd-item {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 9px 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    border-radius: 7px !important;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
    cursor: pointer !important;
    border: none !important;
    background: none !important;
    width: 100% !important;
    text-align: left !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    box-shadow: none !important;
}

    .topnav-dropdown a.topnav-dd-item svg,
    .topnav-dropdown button.topnav-dd-item svg {
        opacity: 0.5;
        flex-shrink: 0;
        transition: opacity 0.15s;
    }

    .topnav-dropdown a.topnav-dd-item:hover,
    .topnav-dropdown button.topnav-dd-item:hover {
        background: #f0f5ff !important;
        color: #0d47a1 !important;
        text-decoration: none !important;
    }

        .topnav-dropdown a.topnav-dd-item:hover svg,
        .topnav-dropdown button.topnav-dd-item:hover svg {
            opacity: 1;
        }

.topnav-dropdown button.topnav-dd-logout:hover {
    background: #fff1f1 !important;
    color: #dc2626 !important;
}

/* ================================================================
   HAMBURGER
   ================================================================ */
.topnav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 8px !important;
    cursor: pointer;
    padding: 0 !important;
    transition: border-color 0.18s;
    flex-shrink: 0;
    box-shadow: none !important;
}

    .topnav-hamburger:hover {
        border-color: #0d47a1 !important;
    }

    .topnav-hamburger span {
        display: block;
        width: 16px;
        height: 2px;
        background: #374151;
        border-radius: 2px;
        transition: transform 0.25s, opacity 0.2s, width 0.2s;
        pointer-events: none;
    }

    .topnav-hamburger.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .topnav-hamburger.open span:nth-child(2) {
        opacity: 0;
        width: 0;
    }

    .topnav-hamburger.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

/* ================================================================
   MOBILE DRAWER
   ================================================================ */
.topnav-mobile-drawer {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #f0f2f6;
    box-shadow: 0 12px 32px rgba(0,0,0,0.09);
    z-index: 999;
    padding: 8px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}

    .topnav-mobile-drawer.open {
        display: block;
        animation: topnavDrawerIn 0.2s ease-out;
    }

@keyframes topnavDrawerIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mob-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 14px;
}

.mob-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    user-select: none;
}

.mob-user-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
}

.mob-user-role {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.mob-sep {
    height: 1px;
    background: #f3f4f6;
    margin: 6px 0;
}

/* Mobile nav links */
.topnav-mobile-drawer a.mob-nav-link,
.topnav-mobile-drawer button.mob-nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 11px 12px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    border: none !important;
    background: none !important;
    width: 100% !important;
    text-align: left !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    cursor: pointer !important;
    transition: background 0.15s, color 0.15s;
    box-shadow: none !important;
}

    .topnav-mobile-drawer a.mob-nav-link svg,
    .topnav-mobile-drawer button.mob-nav-link svg {
        opacity: 0.5;
        flex-shrink: 0;
        transition: opacity 0.15s;
    }

    .topnav-mobile-drawer a.mob-nav-link:hover,
    .topnav-mobile-drawer a.mob-nav-link.active,
    .topnav-mobile-drawer button.mob-nav-link:hover {
        background: #f0f5ff !important;
        color: #0d47a1 !important;
        text-decoration: none !important;
    }

    .topnav-mobile-drawer a.mob-nav-link.active {
        font-weight: 700 !important;
    }

        .topnav-mobile-drawer a.mob-nav-link:hover svg,
        .topnav-mobile-drawer a.mob-nav-link.active svg,
        .topnav-mobile-drawer button.mob-nav-link:hover svg {
            opacity: 1;
        }

.topnav-mobile-drawer a.mob-nav-request {
    background: #f0f5ff !important;
    color: #0d47a1 !important;
    font-weight: 700 !important;
    margin: 4px 0;
}

    .topnav-mobile-drawer a.mob-nav-request:hover {
        background: #0d47a1 !important;
        color: #fff !important;
    }

.topnav-mobile-drawer button.mob-nav-logout {
    color: #dc2626 !important;
}

    .topnav-mobile-drawer button.mob-nav-logout:hover {
        background: #fff1f1 !important;
        color: #dc2626 !important;
    }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Desktop >= 1024px */
@media (min-width: 1024px) {
    .topnav-hamburger {
        display: none !important;
    }

    .topnav-mobile-drawer {
        display: none !important;
    }
}

/* Tablet 768–1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .topnav-inner {
        padding: 0 1.25rem;
    }

    .topnav-links a,
    .topnav-links a.tnav-link {
        padding: 0 12px !important;
        font-size: 13.5px !important;
    }

    .topnav-user-name {
        max-width: 80px;
    }

    .topnav-hamburger {
        display: none !important;
    }

    .topnav-mobile-drawer {
        display: none !important;
    }
}

/* Mobile < 768px */
@media (max-width: 767px) {
    .topnav-inner {
        padding: 0 1rem;
        height: 56px;
    }

    .topnav-links {
        display: none !important;
    }

    .topnav-icon-btn {
        display: none !important;
    }

    .topnav-user-menu {
        display: none !important;
    }

    .topnav-signin {
        display: none !important;
    }

    .topnav-hamburger {
        display: flex !important;
    }

    .topnav-brand img {
        height: 36px;
    }

    .topnav-mobile-drawer {
        top: 56px;
        max-height: calc(100vh - 56px);
    }
}