/* ============================================
   NewsCockpit - Navigation Styles
   2-level navigation with dropdown menus
   ============================================ */

/* Force sans-serif fonts for all navigation elements */
.header,
.header *,
.mobile-menu,
.mobile-menu *,
.dropdown-menu,
.dropdown-menu * {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Header user menu */
.header-user {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 16px;
}

/* Dropdown container */
.nav-dropdown {
    position: relative;
}

/* Dropdown toggle button */
.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* User button (with avatar) */
.user-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px !important;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-email-short {
    font-size: 13px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Primary button (Sign up) */
.nav-button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: transparent !important;
}

.nav-button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Dropdown menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 3000;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown menu right-aligned (for user menu) */
.dropdown-menu-right {
    left: auto;
    right: 0;
}

/* Dropdown header (for user email) */
.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-email-full {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* Dropdown items */
.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.dropdown-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.dropdown-item.logout-item {
    color: rgba(239, 68, 68, 0.9);
}

.dropdown-item.logout-item:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Dropdown divider */
.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Mobile menu toggle (hamburger) */
.mobile-menu-toggle {
    display: none;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 12px;
}

.mobile-menu-toggle:hover {
    background: rgba(59, 130, 246, 0.25);
}

.hamburger {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: currentColor;
    left: 0;
    transition: all 0.3s;
}

.hamburger::before {
    top: -6px;
}

.hamburger::after {
    bottom: -6px;
}

/* Mobile menu overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-header {
    background: rgba(26, 26, 26, 0.98);
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header span {
    font-size: 18px;
    font-weight: 600;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-content {
    background: rgba(26, 26, 26, 0.98);
    padding: 20px;
    max-width: 400px;
    height: calc(100vh - 73px);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-item {
    display: block;
    width: 100%;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.15s;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
}

.mobile-menu-item:hover {
    background: rgba(59, 130, 246, 0.15);
}

.mobile-menu-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.mobile-menu-item.logout-item {
    color: rgba(239, 68, 68, 0.9);
}

.mobile-menu-item.logout-item:hover {
    background: rgba(239, 68, 68, 0.15);
}

.mobile-menu-item-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mobile-menu-item-primary:hover {
    opacity: 0.9;
}

.mobile-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

/* === RESPONSIVE / MOBILE === */
@media (max-width: 968px) {
    /* Hide flagship nav items, show only More button */
    .header-nav > a.nav-button {
        display: none;
    }

    .header-user a.nav-button {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }

    .header-logo img {
        height: 28px;
    }

    .header-subtitle {
        font-size: 9px;
    }

    /* Hide user email on very small screens */
    .user-email-short {
        display: none;
    }

    .user-button {
        padding: 6px 8px !important;
    }
}
