/* ========================================
   Main Navigation
   ======================================== */

.main-nav {
    background: var(--HM-card-bg);
    border-bottom: 1px solid var(--HM-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.main-nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    gap: 2rem;
}

/* Brand/Logo */
.main-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--HM-primary);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.main-nav-brand:hover {
    color: var(--HM-primary-hover);
}

.main-nav-brand i {
    font-size: 1.5rem;
}

/* Main Links */
.main-nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.main-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    color: var(--HM-text);
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.main-nav-link:hover {
    background: transparent;
    color: var(--HM-primary);
    border-bottom-color: var(--HM-primary);
}

.main-nav-link i {
    font-size: 1rem;
}

.main-nav-link.club-nav-active {
    color: var(--HM-primary);
    border-bottom-color: var(--HM-primary);
}

/* Actions (Right Side) */
.main-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    margin-right: -0.625rem;
}

/* User Menu */
.main-nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0;
    margin-right: 0.625rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    position: relative;
}

.main-nav-user:hover {
    background: transparent;
}

/* Show dropdown on hover */
.main-nav-user:hover + .main-nav-dropdown,
.main-nav-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--HM-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
}

.main-nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-nav-user-name {
    color: var(--HM-text);
    font-weight: 600;
}

/* Settings Toggle */
.main-nav-setting {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--HM-text);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.main-nav-setting:hover {
    background: transparent;
    color: var(--HM-primary);
}

.main-nav-setting i {
    font-size: 1.125rem;
}

/* Login Button */
.main-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--HM-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.main-nav-btn:hover {
    background: var(--HM-primary-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: white;
}

/* Dropdown Menu */
.main-nav-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--HM-card-bg);
    border: 1px solid var(--HM-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
}

.main-nav-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav-dropdown-small {
    min-width: 160px;
}

.main-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--HM-text);
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
}

.main-nav-dropdown-item:hover {
    background: transparent;
    color: var(--HM-primary);
}

.main-nav-dropdown-item.active {
    color: var(--HM-primary);
    font-weight: 700;
}

.main-nav-dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.main-nav-dropdown-item .fi {
    font-size: 1.25rem;
    width: 20px;
    text-align: center;
}

.main-nav-dropdown-item.active {
    color: var(--HM-primary);
    font-weight: 700;
}

.main-nav-dropdown-divider {
    height: 1px;
    background: var(--HM-border);
    margin: 0.5rem 0;
}

/* Mobile Menu Toggle */
.main-nav-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--HM-bg);
    border: none;
    border-radius: 8px;
    color: var(--HM-text);
    cursor: pointer;
    transition: all 0.2s;
}

.main-nav-mobile-toggle:hover {
    background: var(--HM-border);
}

/* Mobile Menu Overlay */
.main-nav-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.main-nav-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.main-nav-mobile-overlay.active .main-nav-mobile-content {
    transform: translateX(0);
}

.main-nav-mobile-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: var(--HM-card-bg);
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--HM-border);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--HM-text);
    flex-shrink: 0;
}

.main-nav-mobile-brand {
    color: var(--HM-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.main-nav-mobile-brand:hover {
    color: var(--HM-primary-hover);
}

.main-nav-mobile-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--HM-bg);
    border: none;
    border-radius: 8px;
    color: var(--HM-text);
    cursor: pointer;
    transition: all 0.2s;
}

.main-nav-mobile-close:hover {
    background: var(--HM-border);
}

.main-nav-mobile-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--HM-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    flex-shrink: 0;
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.main-nav-mobile-item:hover {
    background: transparent;
    border-left-color: var(--HM-primary);
    color: var(--HM-primary);
}

.main-nav-mobile-item i {
    width: 24px;
    text-align: center;
    font-size: 1.125rem;
}

.main-nav-mobile-divider {
    height: 1px;
    min-height: 1px;
    flex-shrink: 0;
    background: var(--HM-border);
    margin: 0.25rem 0;
}

.main-nav-mobile-item-label {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--HM-text-muted);
    letter-spacing: 0.5px;
}

/* Mobile Dropdown Toggle */
.main-nav-mobile-dropdown-toggle {
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--HM-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    text-align: left;
}

.main-nav-mobile-dropdown-toggle:hover {
    background: transparent;
    border-left-color: var(--HM-primary);
    color: var(--HM-primary);
}

.main-nav-mobile-dropdown-toggle i:first-child {
    width: 24px;
    text-align: center;
    font-size: 1.125rem;
}

.main-nav-mobile-chevron {
    margin-left: auto;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.main-nav-mobile-dropdown-toggle.active .main-nav-mobile-chevron {
    transform: rotate(180deg);
}

/* Mobile Dropdown */
.main-nav-mobile-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: transparent;
}

.main-nav-mobile-dropdown.active {
    max-height: 300px;
}

.main-nav-mobile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem 0.875rem 3.25rem;
    color: var(--HM-text);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
}

.main-nav-mobile-dropdown-item:hover {
    background: transparent;
    border-left-color: var(--HM-primary);
    color: var(--HM-primary);
}

.main-nav-mobile-dropdown-item .fi {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.main-nav-mobile-dropdown-item.active {
    color: var(--HM-primary);
    font-weight: 700;
}

/* Hide desktop-only elements on mobile */
.main-nav-desktop-only {
    display: flex;
}

/* Responsive */
@media (max-width: 992px) {
    .main-nav-links {
        display: none;
    }

    .main-nav-mobile-toggle {
        display: flex;
    }

    .main-nav-desktop-only {
        display: none !important;
    }

    .main-nav-link span {
        display: none;
    }

    .main-nav-btn span {
        display: none;
    }

    /* Disable user dropdown on mobile */
    .main-nav-user {
        cursor: default;
        pointer-events: none;
    }

    #userDropdown {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .main-nav-content {
        gap: 0.75rem;
    }

    .main-nav-actions {
        gap: 0.5rem;
    }

    .main-nav-mobile-content {
        width: 100%;
        max-width: 300px;
    }
}

/* ========================================
   Rollup Navigation
   ======================================== */

.rollup-nav-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    pointer-events: none;
}

.rollup-nav-wrapper > * {
    pointer-events: auto;
}

.rollup-nav {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: auto;
    transition: top 0.15s ease;
}

.rollup-nav.expanded {
    top: 0;
}

/* Mobile Toggle Button */
.rollup-nav-mobile-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--HM-card-bg);
    color: var(--HM-text);
    border: 1px solid var(--HM-border);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.rollup-nav-mobile-toggle:hover {
    background: var(--HM-bg);
    border-color: var(--HM-primary);
    color: var(--HM-primary);
}

.rollup-nav-mobile-toggle i {
    font-size: 1.125rem;
}

/* Trigger Area */
.rollup-nav-trigger {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 10px;
    background: var(--HM-primary);
    border: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(249,115,22,0.4);
    transition: height 0.2s, opacity 0.2s;
    z-index: 2001;
    opacity: 1;
}

.rollup-nav.expanded .rollup-nav-trigger {
    opacity: 0;
    pointer-events: none;
}

.rollup-nav-trigger::before {
    display: none;
}

.rollup-nav-trigger:hover {
    height: 12px;
}

/* Content Panel */
.rollup-nav-content {
    width: 100%;
    height: auto;
    background: var(--HM-card-bg);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-bottom: 1px solid var(--HM-border);
}

.rollup-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    gap: 2rem;
}

/* Brand */
.rollup-nav-brand {
    color: var(--HM-primary);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.rollup-nav-brand:hover {
    color: var(--HM-primary-hover);
}

/* Links Section */
.rollup-nav-links {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.rollup-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--HM-text);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    background: none;
    border-top: none;
    border-right: none;
    border-left: none;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
}

.rollup-nav-link:hover {
    background: transparent;
    border-bottom-color: var(--HM-primary);
    color: var(--HM-primary);
}

.rollup-nav-link i {
    font-size: 1rem;
}

/* Actions (Right Side) */
.rollup-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    margin-right: -0.625rem;
}

/* User Menu */
.rollup-nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0;
    margin-right: 0.625rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    position: relative;
}

.rollup-nav-user:hover {
    background: transparent;
}

/* Show dropdown on hover */
.rollup-nav-user:hover + .rollup-nav-dropdown,
.rollup-nav-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rollup-nav-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--HM-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
}

.rollup-nav-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rollup-nav-user-name {
    color: var(--HM-text);
    font-weight: 600;
}

/* User mobile wrapper */
.rollup-nav-user-mobile {
    display: none;
}

/* Settings Toggle */
.rollup-nav-setting {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--HM-text);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.rollup-nav-setting:hover {
    background: transparent;
    color: var(--HM-primary);
}

.rollup-nav-setting i {
    font-size: 1.125rem;
}

/* Login Button */
.rollup-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--HM-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.rollup-nav-btn:hover {
    background: var(--HM-primary-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: white;
}

/* Dropdown Menu */
.rollup-nav-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--HM-card-bg);
    border: 1px solid var(--HM-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
}

.rollup-nav-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rollup-nav-dropdown-small {
    min-width: 160px;
}

.rollup-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--HM-text);
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
}

.rollup-nav-dropdown-item:hover {
    background: transparent;
    color: var(--HM-primary);
}

.rollup-nav-dropdown-item.active {
    color: var(--HM-primary);
    font-weight: 700;
}

.rollup-nav-dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.rollup-nav-dropdown-divider {
    height: 1px;
    background: var(--HM-border);
    margin: 0.5rem 0;
}

/* Hide desktop-only elements on mobile */
.rollup-nav-desktop-only {
    display: flex;
}

/* Mobile adjustments */
@media (max-width: 992px) {
    .rollup-nav-wrapper {
        left: auto;
        right: 0;
    }

    .rollup-nav {
        left: auto;
        right: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        transition: right 0.15s ease;
    }

    .rollup-nav.expanded {
        left: auto;
        right: 0;
        top: 0;
    }

    .rollup-nav-content {
        height: 100%;
        overflow-y: auto;
        border-bottom: none;
        border-left: 1px solid var(--HM-border);
        box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    }

    .rollup-nav-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 0;
        gap: 0.5rem;
    }

    .rollup-nav-brand {
        padding: 0.75rem 1.5rem;
    }

    .rollup-nav-links {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem 0;
    }

    .rollup-nav-link {
        border-bottom: none;
        border-left: 3px solid transparent;
        border-radius: 0;
        padding: 0.875rem 1.5rem;
        gap: 1rem;
    }

    .rollup-nav-link:hover {
        border-left-color: var(--HM-primary);
        border-bottom-color: transparent;
        background: transparent;
    }

    .rollup-nav-link i {
        width: 24px;
        text-align: center;
        font-size: 1.125rem;
    }

    .rollup-nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        margin-right: 0;
        padding: 0.5rem 0;
    }

    /* Hide desktop user, show mobile user at the end */
    .rollup-nav-actions > .rollup-nav-user {
        display: none;
    }

    .rollup-nav-user-mobile {
        display: block;
    }

    .rollup-nav-user-mobile .rollup-nav-user {
        display: flex;
    }

    .rollup-nav-user {
        padding: 0.875rem 1.5rem;
        margin-right: 0;
        background: var(--HM-bg);
        border-radius: 0;
        cursor: default;
        pointer-events: none;
    }

    .rollup-nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .rollup-nav-dropdown-item {
        padding: 0.875rem 1.5rem;
        border-left: 3px solid transparent;
    }

    .rollup-nav-dropdown-item:hover {
        border-left-color: var(--HM-primary);
    }

    .rollup-nav-dropdown-item i {
        width: 24px;
        text-align: center;
        font-size: 1.125rem;
    }

    .rollup-nav-dropdown-divider {
        margin: 0.75rem 1.5rem;
    }

    .rollup-nav-setting {
        width: auto;
        height: auto;
        padding: 0.875rem 1.5rem;
        gap: 1rem;
        justify-content: flex-start;
        border-radius: 0;
        border-left: 3px solid transparent;
    }

    .rollup-nav-setting:hover {
        border-left-color: var(--HM-primary);
    }

    .rollup-nav-setting i {
        width: 24px;
        text-align: center;
    }

    .rollup-nav-btn {
        margin: 0 1.5rem;
        justify-content: center;
    }

    .rollup-nav-desktop-only {
        display: flex !important;
    }

    /* Show mobile toggle button */
    .rollup-nav-mobile-toggle {
        display: flex;
    }

    /* Hide desktop trigger */
    .rollup-nav-trigger {
        display: none;
    }
}

@media (max-width: 992px) {
    .rollup-nav-mobile-toggle {
        top: 0.5rem;
    }
}

@media (max-width: 768px) {
    .rollup-nav-mobile-toggle {
        top: 0.25rem;
    }
}