/* ===================================
   NAVIGATION STYLES - CLARWIZ
   Common navigation styles for all layouts
   =================================== */

/* Navigation for all layouts - Override default navbar */
.jh-navbar {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    border-bottom: 1px solid var(--gray-700);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
}

.jh-navbar .jh-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
}

.jh-navbar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.jh-navbar-brand i {
    color: var(--primary-400);
    font-size: 1.5rem;
}

.jh-navbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Right-aligned actions (e.g., user menu) that should always stay visible */
.jh-navbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.jh-nav-link {
    color: var(--gray-300);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    white-space: nowrap;
}

.jh-nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.jh-nav-link.active {
    color: white;
    background-color: var(--primary-600);
}

/* User menu dropdown styles */
.jh-user-menu {
    position: relative;
}

.jh-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    background: none;
    border: none;
    color: white;
}

.jh-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.jh-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.jh-user-avatar-placeholder {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.jh-dropdown-arrow {
    font-size: 0.75rem;
    color: var(--gray-300);
    transition: transform var(--transition-normal);
}

.jh-dropdown.show .jh-dropdown-arrow {
    transform: rotate(180deg);
}

.jh-dropdown-menu {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-sm) 0;
    margin-top: calc(var(--spacing-sm) + var(--spacing-xs));
    min-width: 220px;
    overflow: hidden;
    z-index: 1100;
    position: absolute;
    display: none;
    list-style: none;
}

.jh-dropdown-menu.show {
    display: block;
}

.jh-dropdown-menu-end {
    right: 0;
    left: auto;
}

.jh-dropdown-header {
    padding: calc(var(--spacing-sm) + var(--spacing-xs)) var(--spacing-md);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.jh-dropdown-header .jh-user-info {
    text-align: left;
}

.jh-dropdown-header .jh-user-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

.jh-dropdown-header .jh-user-email {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.jh-dropdown-item {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-sm) + var(--spacing-xs));
    padding: calc(var(--spacing-sm) + var(--spacing-xs)) var(--spacing-md);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.jh-dropdown-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.jh-dropdown-item:focus {
    outline: none;
    background: var(--gray-100);
    color: var(--gray-900);
}

.jh-dropdown-item i {
    width: 1.25rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Normalize LI in dropdown to remove UA list spacing/markers (but keep header padding) */
.jh-dropdown-menu>li:not(.jh-dropdown-header) {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

.jh-dropdown-menu hr.jh-dropdown-divider {
    border: 0;
    border-top: 1px solid var(--gray-200);
    margin: var(--spacing-sm) 0;
    opacity: 1;
    background: transparent;
    width: 100%;
}

/* Mobile menu toggle button */
.jh-mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.jh-hamburger-line {
    width: 24px;
    height: 2px;
    background-color: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.jh-mobile-menu-toggle.jh-mobile-menu-open .jh-hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.jh-mobile-menu-toggle.jh-mobile-menu-open .jh-hamburger-line:nth-child(2) {
    opacity: 0;
}

.jh-mobile-menu-toggle.jh-mobile-menu-open .jh-hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu overlay */
.jh-mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.jh-mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive design for navigation */
@media (max-width: 768px) {
    .jh-navbar .jh-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 0 calc(var(--spacing-sm) + var(--spacing-xs));
    }

    /* Show mobile menu button */
    .jh-mobile-menu-toggle {
        display: flex;
    }

    .jh-navbar-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--gray-900);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px var(--spacing-lg) var(--spacing-lg);
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .jh-navbar-nav.jh-mobile-nav-open {
        right: 0;
    }

    .jh-nav-link:last-child {
        border-bottom: none;
        margin-top: var(--spacing-lg);
    }

    .jh-nav-link.btn {
        justify-content: center;
        background: var(--primary-600);
        border-radius: var(--radius-md);
        margin-top: var(--spacing-lg);
    }

    /* Keep actions (e.g., user avatar) visible on mobile */
    .jh-navbar-actions {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .jh-navbar-nav {
        width: 100%;
        right: -100%;
    }

    .jh-navbar .jh-container {
        padding: 0 var(--spacing-sm);
    }
}