/* 
   Unified Responsive Navbar - MusiEQ
*/

:root {
    --nav-height: 72px;
    --nav-bg: rgba(22, 17, 33, 0.85);
    /* MusiEQ Dark Surface */
    --nav-blur: 24px;
    --nav-border: rgba(255, 255, 255, 0.08);
    --nav-text: rgba(255, 255, 255, 0.7);
    --nav-text-hover: #ffffff;
    --nav-primary: #8b5cf6;
    /* MusiEQ Purple */
    --nav-primary-hover: #7c3aed;
    --drawer-bg: #1e1a25;
    /* MusiEQ Main BG */
    --drawer-width: 300px;
}

/* Glassmorphism Header */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1200px, calc(100% - 40px));
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(22, 17, 33, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--nav-border);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.drawer-open {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
}


.navbar.scrolled {
    background: var(--nav-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    height: 64px;
    top: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.navbar-container {
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-left,
.navbar-right {
    flex: 1;
    display: flex;
}

.navbar-right {
    justify-content: flex-end;
}

.navbar-center {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}


/* Branding */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.nav-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

.nav-brand-text {
    height: 24px;
    width: auto;
    opacity: 1;
}

/* Desktop Center Links */
.navbar-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-center a {
    position: relative;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Premium underline animation */
.navbar-center a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--nav-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
    opacity: 0;
    box-shadow: 0 0 10px var(--nav-primary);
}

.navbar-center a:hover {
    color: #fff;
    transform: translateY(-2px);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.navbar-center a:hover::after {
    width: 24px;
    opacity: 1;
}

.navbar-center a.active {
    color: #fff;
}

.navbar-center a.active::after {
    width: 28px;
    opacity: 1;
    background: var(--nav-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

/* Right Section */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-btn-primary {
    background: var(--nav-primary);
    color: white;
}

.nav-btn-primary:hover {
    background: var(--nav-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px #8a5cf662;

}

/* User Menu */
.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 99px;
    border: 1px solid var(--nav-border);
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.nav-username {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.nav-icon-btn {
    background: transparent;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: color 0.2s ease;
}

.nav-icon-btn:hover {
    color: #ef4444;
}

/* Mobile Toggle */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 3001;
}

.nav-mobile-toggle .bar {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Drawer (Sidebar) */
.nav-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--drawer-width);
    height: 100vh;
    height: 100dvh;
    background: var(--drawer-bg);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 0 24px;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.5);
}

.nav-drawer.open {
    left: 0;
}

.nav-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.nav-drawer-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

.nav-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

.nav-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--nav-text);
    transition: all 0.2s ease;
}

.nav-drawer-link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    color: var(--nav-primary);
}

.nav-drawer-link .link-text {
    display: flex;
    flex-direction: column;
}

.nav-drawer-link .link-text span {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.nav-drawer-link .link-text small {
    font-size: 12px;
    color: var(--nav-text);
}

.nav-drawer-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-drawer-footer {
    padding-top: 24px;
    border-top: 1px solid var(--nav-border);
    margin-top: auto;
    flex-shrink: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.drawer-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--nav-border);
}

.drawer-user-info .nav-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--nav-primary);
}

.drawer-user-info .user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-username-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.drawer-user-info .nav-username {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
}

.nav-user-info .plan-badge,
.drawer-user-info .plan-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.nav-user-info .plan-badge.user-free,
.drawer-user-info .plan-badge.user-free {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border: none;
}

.drawer-user-info .drawer-logout-link {
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 12px;
    padding: 0;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: underline;
}

.drawer-user-info .drawer-logout-link:hover {
    color: #ef4444;
}

.hidden {
    display: none !important;
}

.full-width {
    width: 100% !important;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 3999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsiveness */
@media (max-width: 992px) {
    .navbar-center {
        display: none;
    }

    .nav-mobile-toggle {
        display: flex;
    }

    #nav-login-btn {
        display: none;
    }

    .navbar-right .nav-user-menu {
        display: none;
    }
}

@media (max-width: 480px) {
    :root {
        --drawer-width: 85%;
    }

    .nav-brand-text {
        display: none;
    }
}

@media (max-width: 360px) {
    .navbar {
        width: calc(100% - 24px);
        top: 12px;
    }

    .navbar-container {
        padding: 0 12px;
    }

    .nav-logo {
        height: 32px;
        width: 32px;
    }
}