:root {
    --nav-height: 85px;
}

/* Premium Navbar Styling */
.premium-nav {
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(15px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
}

.premium-nav .container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-brand-container {
    display: flex;
    align-items: center;
    padding: 0.35rem 0;
}

.nav-logo {
    max-height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-brand-container .navbar-brand {
    padding: 0.35rem 0.5rem;
    margin-top: 0 !important;
}

.gradient-text {
    color: color-mix(in srgb, var(--primary-color) 84%, #111827);
    font-weight: 900;
}

.nav-link {
    color: #475569 !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.5rem !important;
    border-radius: var(--nav-radius);
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.08);
}

.nav-icon {
    opacity: 0.7;
    transition: transform 0.3s;
}

.nav-link:hover .nav-icon {
    transform: translateY(-2px);
}

.user-profile-static {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 6px 14px;
    border-radius: var(--nav-radius);
    box-shadow: 0 4px 12px -10px rgba(15, 23, 42, 0.2);
}

.main-site-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: var(--nav-radius);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #1e293b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 12px -10px rgba(15, 23, 42, 0.2);
    white-space: nowrap;
}

.main-site-link:hover,
.main-site-link:focus,
.main-site-link:active {
    color: #1e293b;
    text-decoration: none;
    background: #fff;
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 12px -10px rgba(15, 23, 42, 0.2);
}

.user-avatar-nav {
    width: auto;
    height: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: none;
}

.user-avatar-icon {
    color: var(--primary-color);
    line-height: 1;
    font-size: 1.45rem !important;
}

.user-name-text {
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

/* Logo label under the logo */
.logo-label {
    font-size: 2rem;
    font-weight: 900;
    color: #000;
    line-height: 1;
    margin-bottom: 3px;
    text-transform: none;
}

.user-role-text {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 2px;
}

/* Visitor Mode & Login */
.visitor-mode-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: var(--nav-radius);
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.btn-login-gradient {
    background: var(--primary-color);
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.16), 0 10px 20px -6px rgba(15, 23, 42, 0.24);
    color: white !important;
    border: none;
    padding: 10px 28px;
    border-radius: var(--nav-radius);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login-gradient:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.2), 0 12px 24px -8px rgba(15, 23, 42, 0.28);
}

/* Mobile Hamburger */
.hamburger-icon {
    width: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hamburger-icon span {
    height: 2px;
    width: 100%;
    background: var(--primary-color);
    border-radius: 2px;
}

@media (max-width: 991.98px) {
    .premium-nav {
        height: auto;
        min-height: var(--nav-height);
    }

    .premium-nav .container {
        flex-wrap: wrap;
        justify-content: space-between;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .nav-brand-container {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.2rem 0;
    }

    .navbar-toggler {
        order: 2;
        margin-left: auto;
        padding: 0.35rem 0.55rem;
    }

    .navbar-collapse {
        order: 3;
        flex-basis: 100%;
        margin-top: 0.75rem;
        padding: 0.9rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: var(--nav-radius);
        box-shadow: 0 14px 28px -18px rgba(15, 23, 42, 0.22);
    }

    .navbar-collapse .d-flex.align-items-center.gap-3,
    .navbar-collapse .d-flex.align-items-center.gap-2 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
        width: 100%;
    }

    .navbar-collapse .main-site-link,
    .navbar-collapse .btn-login-gradient,
    .navbar-collapse .user-profile-static,
    .navbar-collapse .visitor-mode-pill {
        width: 100%;
        justify-content: center;
    }

    .navbar-collapse .user-profile-static {
        justify-content: flex-start;
    }

    .nav-logo {
        max-height: 30px;
    }

    .logo-label {
        font-size: 1.35rem;
    }

    .visitor-mode-pill {
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .premium-nav .container {
        gap: 0.75rem;
    }

    .nav-brand-container {
        margin-left: 0;
        display: flex;
        justify-content: flex-start;
        margin-left: 4px;
        padding-left: 0.25rem;
    }

    .nav-logo {
        margin-right: auto;
        max-height: 28px;
    }

    .navbar-collapse {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .main-site-link,
    .btn-login-gradient {
        padding-left: 14px;
        padding-right: 14px;
        font-size: 0.82rem;
    }

    .user-name-text {
        font-size: 0.8rem;
    }

    .user-role-text {
        font-size: 0.68rem;
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(148, 163, 184, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(148, 163, 184, 0);
    }
}
