/**
 * LightSkai Unified Navbar Styles
 * 
 * These styles are shared across all authenticated pages to ensure
 * consistent navigation experience.
 */

/* CSS Variable Defaults - can be overridden by branding-colors.js */
:root {
    --brand-primary: #0EA5E9;
    --brand-primary-rgb: 14, 165, 233;
    --brand-secondary: #0EA5E9;
    --brand-secondary-rgb: 14, 165, 233;
}

/* ===================================== */
/* NAVBAR BASE                           */
/* ===================================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

/* ===================================== */
/* LOGO SECTION                          */
/* ===================================== */
.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

/* Image logo styling - primary logo display */
.navbar .nav-logo-img,
.logo-section .nav-logo-img {
    max-height: 52px;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Text logo fallback - hidden by default when image is used */
.navbar .logo,
.logo-section .logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary)) !important;
    display: none; /* Hidden by default - image takes priority */
    align-items: center;
    justify-content: center;
    color: white !important;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.navbar .brand-name,
.logo-section .brand-name {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ===================================== */
/* RIGHT SECTION                         */
/* ===================================== */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.dashboard-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: rgba(var(--brand-primary-rgb), 0.08);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
}

.dashboard-link:hover {
    background: rgba(var(--brand-primary-rgb), 0.15);
    color: var(--brand-primary);
    border-color: rgba(var(--brand-primary-rgb), 0.4);
}

/* ===================================== */
/* USER MENU DROPDOWN                    */
/* ===================================== */
.user-menu-container {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.08) 0%, rgba(var(--brand-primary-rgb), 0.08) 100%);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-trigger:hover {
    background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.15) 0%, rgba(var(--brand-primary-rgb), 0.15) 100%);
    border-color: rgba(var(--brand-primary-rgb), 0.4);
    transform: translateY(-1px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.user-menu-chevron {
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.user-menu-container.open .user-menu-chevron {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.user-menu-container.open .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-menu-header {
    padding: 16px;
    background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.05) 0%, rgba(var(--brand-primary-rgb), 0.05) 100%);
    border-bottom: 1px solid rgba(var(--brand-primary-rgb), 0.1);
}

.user-menu-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Insights Available Display */
.user-menu-insights {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(var(--brand-primary-rgb), 0.1);
}

.user-menu-insights .insights-icon {
    font-size: 16px;
}

.user-menu-insights .insights-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-primary);
}

.user-menu-insights .insights-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.user-menu-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-menu-user-info {
    flex: 1;
    min-width: 0;
}

.user-menu-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* Role Badge Styles */
.user-menu-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--brand-primary-rgb), 0.15), rgba(var(--brand-primary-rgb), 0.15));
    color: var(--brand-primary);
}

/* Section Labels */
.user-menu-section-label {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.user-menu-items {
    padding: 8px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-menu-item:hover {
    background: #f1f5f9;
    color: var(--brand-primary);
}

.user-menu-item.current-page {
    background: rgba(var(--brand-primary-rgb), 0.1);
    color: var(--brand-primary);
}

.user-menu-item-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.user-menu-item-text {
    flex: 1;
}

/* Menu Pill Tags (Pro/Free) for Standard Users */
.menu-pill-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.menu-pill-tag.pro {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.menu-pill-tag.free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.user-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 8px;
}

.user-menu-item.logout {
    color: #DC2626;
}

.user-menu-item.logout:hover {
    background: #FEF2F2;
    color: #DC2626;
}

/* Theme Toggle in Menu */
.user-menu-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
}

.user-menu-theme-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
}

.theme-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e2e8f0;
    transition: 0.3s;
    border-radius: 26px;
}

.theme-slider:before {
    position: absolute;
    content: "☀️";
    font-size: 12px;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.theme-switch input:checked + .theme-slider {
    background: #1e293b;
}

.theme-switch input:checked + .theme-slider:before {
    transform: translateX(22px);
    content: "🌙";
}

/* ===================================== */
/* DARK THEME                            */
/* ===================================== */
.dark-theme .navbar {
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-theme .navbar .brand-name,
.dark-theme .logo-section .brand-name {
    background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.dark-theme .dashboard-link {
    color: #94a3b8;
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.2);
}

.dark-theme .dashboard-link:hover {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.dark-theme .user-menu-trigger {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-color: rgba(56, 189, 248, 0.3);
}

.dark-theme .user-menu-trigger:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(96, 165, 250, 0.2) 100%);
    border-color: rgba(56, 189, 248, 0.5);
}

.dark-theme .user-menu-chevron {
    color: #94a3b8;
}

.dark-theme .user-menu-dropdown {
    background: #1e293b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.dark-theme .user-menu-header {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(96, 165, 250, 0.08) 100%);
    border-bottom-color: rgba(56, 189, 248, 0.15);
}

.dark-theme .user-menu-name {
    color: #f1f5f9;
}

.dark-theme .user-menu-role-badge {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(96, 165, 250, 0.2));
    color: #7dd3fc;
}

.dark-theme .user-menu-insights {
    border-top-color: rgba(56, 189, 248, 0.15);
}

.dark-theme .user-menu-insights .insights-value {
    color: #38bdf8;
}

.dark-theme .user-menu-insights .insights-label {
    color: #94a3b8;
}

.dark-theme .user-menu-section-label {
    color: #64748b;
}

.dark-theme .user-menu-item {
    color: #cbd5e1;
}

.dark-theme .user-menu-item:hover {
    background: rgba(51, 65, 85, 0.6);
    color: #38bdf8;
}

.dark-theme .user-menu-item.current-page {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.dark-theme .user-menu-divider {
    background: rgba(148, 163, 184, 0.15);
}

/* Dark theme pill tags - slightly adjusted for dark backgrounds */
.dark-theme .menu-pill-tag.pro {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

.dark-theme .menu-pill-tag.free {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.dark-theme .user-menu-item.logout {
    color: #fca5a5;
}

.dark-theme .user-menu-item.logout:hover {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
}

.dark-theme .user-menu-theme-left {
    color: #cbd5e1;
}

.dark-theme .theme-slider {
    background: #334155;
}

/* ===================================== */
/* MOBILE RESPONSIVE                     */
/* ===================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 10px 16px;
    }
    
    .navbar .brand-name,
    .logo-section .brand-name {
        display: none;
    }
    
    .dashboard-link {
        padding: 6px 10px;
        font-size: 16px;
    }
    
    .user-menu-chevron {
        display: none;
    }
    
    .user-menu-dropdown {
        width: calc(100vw - 24px);
        right: -8px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 8px 12px;
    }
    
    .navbar .nav-logo-img,
    .logo-section .nav-logo-img {
        max-height: 32px;
        max-width: 80px;
    }
    
    .navbar .logo,
    .logo-section .logo {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}
