/* navbar.css - Universal ExplainMe Global Header System */

/* Root configuration variables to ensure standalone compatibility */
:root {
    --nav-primary: #2563EB;
    --nav-primary-hover: #1D4ED8;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-border: #F1F5F9;
    --nav-text: #475569;
    --nav-text-hover: #1E293B;
    --nav-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Base Wrapper */
explainme-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.unified-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 6%; /* Increased from 8px for more breathing room */
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    transition: all 0.3s ease;
    box-shadow: var(--nav-shadow);
    font-family: 'Inter', sans-serif;
    height: 64px; /* Fixed height for consistency */
    box-sizing: border-box;
}

/* Brand Logo */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.nav-brand:hover {
    transform: translateY(-1px);
}
.nav-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nav-primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.nav-logo-icon .material-icons-round {
    font-size: 20px;
}
.nav-brand-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--nav-primary);
    letter-spacing: -0.5px;
}

/* Desktop Navigation Menu */
.nav-center-menu {
    display: flex;
    gap: 40px; /* Increased from 32px for better spacing */
    margin: 0;
    padding: 0;
    list-style: none;
}
.nav-center-menu a {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    position: relative;
    padding-bottom: 4px;
}
.nav-center-menu a:hover {
    color: var(--nav-primary);
}
/* Navigation Active State */
.nav-center-menu a.active {
    color: var(--nav-primary);
    font-weight: 700;
}
.nav-center-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--nav-primary);
    border-radius: 2px;
}

/* User Actions & Buttons */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-cta-btn {
    background: linear-gradient(135deg, #3B82F6, var(--nav-primary));
    color: #fff;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 99px; /* Pill */
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
    transition: all 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
    border: none;
    cursor: pointer;
}
.nav-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

/* User Dropdown (Floating Overlay) */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 99px;
    transition: background 0.2s;
}
.user-dropdown:hover {
    background: #F1F5F9;
}
.user-dropdown.active .saas-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.saas-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #E2E8F0;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.1, 0.7, 0.1, 1);
    overflow: hidden;
}

.dropdown-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8FAFC;
    border-bottom: 1px solid #F1F5F9;
}
.dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}
.dropdown-name {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    color: #1E293B;
}
.dropdown-email {
    margin: 0;
    font-size: 13px;
    color: #64748B;
}

.dropdown-section {
    padding: 8px 0;
    border-bottom: 1px solid #F1F5F9;
}
.dropdown-section:last-child {
    border-bottom: none;
}
.dropdown-section-title {
    padding: 10px 20px 4px;
    font-size: 11px;
    font-weight: 700;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.dropdown-item:hover {
    background: #EFF6FF;
    color: #2563EB;
}
.dropdown-item i {
    font-size: 18px;
    color: #94A3B8;
}
.dropdown-item:hover i {
    color: #2563EB;
}
.dropdown-item.text-danger { color: #EF4444; }
.dropdown-item.text-danger:hover { background: #FEF2F2; color: #DC2626; }
.dropdown-item.text-danger i { color: #FCA5A5; }
.dropdown-item.text-danger:hover i { color: #DC2626; }

.dropdown-footer {
    padding: 12px 20px;
}
.d-logout-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: #F1F5F9;
    color: #475569;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}
.d-logout-btn:hover {
    background: #E2E8F0;
    color: #1E293B;
}

/* Navigation Link Height Correction */
.nav-center-menu a {
    line-height: 1;
}

/* Mobile Hamburger Menu */
.nav-mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    padding: 8px;
}
.nav-mobile-toggle .material-icons-round {
    font-size: 28px;
}

/* Responsive Behavior */
@media (max-width: 900px) {
    .unified-navbar { padding: 16px 20px; }
    
    .nav-mobile-toggle { display: block; }

    .nav-center-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.05);
        border-top: 1px solid var(--nav-border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    .nav-center-menu.open {
        max-height: 400px;
        padding: 10px 0;
    }
    
    .nav-center-menu a {
        display: block;
        padding: 16px 24px;
        border-bottom: 1px solid #F8FAFC;
        font-size: 16px;
    }
    .nav-center-menu a.active::after { display: none; }
    .nav-center-menu a.active { background: #EFF6FF; border-left: 4px solid var(--nav-primary); }

    /* Hide standard CTA on mobile in favor of hamburger flow if needed, OR keep it next to hamburger */
    .nav-actions { margin-right: 16px; }
}
@media (max-width: 500px) {
    .nav-cta-btn { display: none; } /* Hide Sign Up on very small screens, let hamburger handle it */
}
