/**
 * Profile Navigation Components
 * 
 * Desktop: Avatar dropdown
 * Mobile: Slide-in sidebar
 * All classes prefixed with nvm- for namespace safety
 */

/* =========================================================================
   Desktop Avatar Dropdown
   ========================================================================= */

.nvm-profile-avatar-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nvm-profile-avatar-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    border-radius: 50px;
    transition: background 0.2s;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.nvm-profile-avatar-trigger:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.nvm-profile-avatar-trigger:focus,
.nvm-profile-avatar-trigger:active,
.nvm-profile-avatar-trigger:visited {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    color: inherit !important;
}

.nvm-profile-avatar-trigger:focus .nvm-profile-avatar-icon-default,
.nvm-profile-avatar-trigger:active .nvm-profile-avatar-icon-default,
.nvm-profile-avatar-trigger:visited .nvm-profile-avatar-icon-default {
    color: #888 !important;
}

.nvm-profile-avatar-img {
    width: 41px !important;
    height: 41px !important;
    border-radius: 50% !important;
    object-fit: cover;
}

.nvm-profile-avatar-icon-default {
    font-size: 36px !important;
    color: #888 !important;
    line-height: 1 !important;
}

.nvm-profile-avatar-caret {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.nvm-profile-avatar-trigger[aria-expanded="true"] .nvm-profile-avatar-caret {
    transform: rotate(180deg);
}

/* Mobile avatar link */
.nvm-profile-avatar-mobile .nvm-profile-avatar-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nvm-profile-avatar-mobile .nvm-profile-avatar-img {
    width: 32px;
    height: 32px;
}

.nvm-profile-avatar-mobile .nvm-profile-avatar-icon-default {
    font-size: 28px !important;
}

/* Avatar Dropdown Panel */
.nvm-profile-avatar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow: hidden;
    margin-top: 6px;
}

.nvm-profile-avatar-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
}

.nvm-profile-avatar-menu-item:hover {
    background: #f5f5f5;
}

.nvm-profile-avatar-menu-item i {
    width: 18px;
    text-align: center;
    color: #0073aa;
}

.nvm-profile-avatar-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.nvm-profile-avatar-logout {
    color: #c00;
}

.nvm-profile-avatar-logout i {
    color: #c00;
}

.nvm-profile-avatar-logout:hover {
    background: #fff5f5;
}


/* =========================================================================
   Mobile Sidebar - Hamburger Button
   ========================================================================= */

.nvm-sidebar-hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    outline: none !important;
    box-shadow: none !important;
}

.nvm-sidebar-hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger → X animation when open */
.nvm-sidebar-hamburger.nvm-sidebar-hamburger-active .nvm-sidebar-hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nvm-sidebar-hamburger.nvm-sidebar-hamburger-active .nvm-sidebar-hamburger-line:nth-child(2) {
    opacity: 0;
}

.nvm-sidebar-hamburger.nvm-sidebar-hamburger-active .nvm-sidebar-hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* =========================================================================
   Mobile Sidebar - Overlay
   ========================================================================= */

.nvm-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nvm-sidebar-overlay.nvm-sidebar-open {
    opacity: 1;
    visibility: visible;
}


/* =========================================================================
   Mobile Sidebar - Panel
   ========================================================================= */

.nvm-sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    /* iOS safe area */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-right: env(safe-area-inset-right);
}

.nvm-sidebar-panel.nvm-sidebar-open {
    transform: translateX(0);
}


/* =========================================================================
   Mobile Sidebar - Header
   ========================================================================= */

.nvm-sidebar-header {
    display: flex;
    justify-content: flex-start;
    padding: 16px 20px 8px;
}

.nvm-sidebar-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    outline: none !important;
    box-shadow: none !important;
}

.nvm-sidebar-close:hover,
.nvm-sidebar-close:focus {
    background: #f0f0f0 !important;
    color: #333;
}


/* =========================================================================
   Mobile Sidebar - Profile Section
   ========================================================================= */

.nvm-sidebar-profile {
    padding: 8px 20px 16px;
}

.nvm-sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.2s;
}

.nvm-sidebar-profile-link:hover {
    background: #f5f5f5;
}

.nvm-sidebar-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
}

.nvm-sidebar-avatar-icon {
    font-size: 48px !important;
    color: #bbb !important;
    line-height: 1 !important;
}

.nvm-sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.nvm-sidebar-user-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.nvm-sidebar-user-label {
    font-size: 13px;
    color: #888;
}

.nvm-sidebar-login-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 10px;
    font-size: 16px;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s;
}

.nvm-sidebar-login-link:hover {
    background: #f0f7fc;
}

.nvm-sidebar-login-link i {
    font-size: 20px;
}


/* =========================================================================
   Mobile Sidebar - Divider
   ========================================================================= */

.nvm-sidebar-divider {
    height: 1px;
    background: #eee;
    margin: 4px 20px;
}


/* =========================================================================
   Mobile Sidebar - Navigation Menu
   ========================================================================= */

.nvm-sidebar-nav {
    padding: 8px 0;
}

.nvm-sidebar-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nvm-sidebar-menu-list li {
    margin: 0;
}

.nvm-sidebar-menu-list li a {
    display: block;
    padding: 12px 24px;
    font-size: 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.nvm-sidebar-menu-list li a:hover {
    background: #f5f5f5;
    color: #0073aa;
}

/* Submenu items */
.nvm-sidebar-menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nvm-sidebar-menu-list .sub-menu li a {
    padding-right: 40px;
    font-size: 14px;
    color: #666;
}

/* Current page highlight */
.nvm-sidebar-menu-list .current-menu-item > a,
.nvm-sidebar-menu-list .current_page_item > a {
    color: #0073aa;
    font-weight: 600;
}


/* =========================================================================
   Mobile Sidebar - Profile Nav Links
   ========================================================================= */

.nvm-sidebar-profile-nav {
    padding: 8px 0;
}

.nvm-sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.nvm-sidebar-nav-item:hover {
    background: #f5f5f5;
    color: #0073aa;
}

.nvm-sidebar-nav-item i {
    width: 20px;
    text-align: center;
    color: #0073aa;
    font-size: 15px;
}


/* =========================================================================
   Mobile Sidebar - Footer / Logout
   ========================================================================= */

.nvm-sidebar-footer {
    padding: 8px 0;
    margin-top: auto;
}

.nvm-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    color: #c00;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    transition: background 0.15s;
}

.nvm-sidebar-logout:hover {
    background: #fff5f5;
}

.nvm-sidebar-logout i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}


/* =========================================================================
   Mobile Sidebar - Body scroll lock
   ========================================================================= */

html.nvm-sidebar-body-locked {
    overflow: hidden !important;
}


/* =========================================================================
   Responsive: Show on mobile only
   ========================================================================= */

@media (max-width: 767px) {
    .nvm-sidebar-hamburger {
        display: flex;
    }
}
