/* Navigation Styles */
:root {
    --saffron: #FF9933;
    --saffron-light: #FFB366;
    --saffron-dark: #E68A00;
    --white: #FFFFFF;
    --yellow: #FFD700;
    --yellow-light: #FFE44D;
    --gray-light: #F5F5F5;
    --gray: #6c757d;
    --gray-dark: #343a40;
}

/* Header Styles */
header {
    background: var(--saffron);
    color: white;
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000; /* header base */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: 70px; /* match nav offsets to keep layout consistent */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    position: relative;
    width: 100%;
}

/* Logo Styling */
.logo {
    color: white !important;
    font-size: 2.2rem !important;
    font-weight: bold;
    text-decoration: none !important; /* Remove underline */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: auto;
    white-space: nowrap;
    margin: 0;
    padding: 0.5rem 1rem !important;
    z-index: 1;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    display: block !important;
    border: none !important;
    background: none !important;
}

/* Ensure header container properly contains the logo */
.header-container {
    position: relative;
    height: 100%;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
}

/* Menu Button */
.mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    color: white !important;
    padding: 1rem !important;
    margin: 0;
    cursor: pointer;
    z-index: 1003; /* above nav and overlay */
    font-size: 1.5rem;
    line-height: 1;
    position: absolute;
    left: 0;
}

.menu-text {
    display: none; /* Hide the word 'Menu' */
}

.mobile-menu-btn i {
    font-size: 1.2rem;
    display: inline-block;
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Nav Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001; /* below nav, above page */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    color: var(--white);
    text-decoration: none;
}

.user-profile:hover {
    background-color: var(--saffron-dark);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--saffron);
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-right: 4px;
    color: var(--white);
}

/* Removed duplicate/overriding .logo block to avoid conflicts with the centered logo */

.nav-links li a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: block;
    white-space: nowrap;
    font-size: 0.95rem;
}

.sign-out {
    color: var(--white);
    margin-left: auto;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.8;
}

.sign-out:hover {
    background-color: var(--saffron-dark);
    color: var(--white);
    opacity: 1;
}

/* Divider in Navigation */
.nav-links .divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 8px 0;
    list-style: none;
}

/* Responsive Navigation */
/* Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Styles - single source of truth */
@media (max-width: 991px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 70px; /* Below header */
        left: -280px; /* Slide in from left */
        width: 280px;
        height: calc(100vh - 70px);
        background: var(--saffron);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1002; /* above overlay */
        padding: 1rem 0;
        box-shadow: 2px 0 15px rgba(0,0,0,0.1);
        overflow-y: auto;
        display: block !important; /* ensure visible on mobile */
    }
    
    .main-nav.active {
        left: 0;
    }
    
    .nav-links {
        display: flex !important;
        flex-direction: column;
        padding: 1rem 0 !important;
        gap: 0.5rem;
    }
    
    .nav-links a {
        color: white !important;
        padding: 0.75rem 1.5rem !important;
        border-left: 4px solid transparent;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(255,255,255,0.1) !important;
        border-left: 4px solid white;
    }
    
    .nav-links a i {
        width: 24px;
        text-align: center;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        margin-left: auto;
    }
    
    .nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Desktop styles */
@media (min-width: 992px) {
    .main-nav {
        position: fixed;
        top: 70px; /* Below header */
        left: -300px;
        width: 280px;
        height: calc(100vh - 70px);
        background: var(--saffron);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1002;
        padding: 1rem 0;
        box-shadow: 2px 0 15px rgba(0,0,0,0.1);
        overflow-y: auto;
        display: block !important;
    }
    
    .main-nav.active {
        left: 0;
    }
    
    .nav-links {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0 !important;
        margin: 0;
    }
    
    .nav-links li {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .nav-links a {
        color: white !important;
        padding: 0.75rem 1.5rem !important;
        border-radius: 0;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        font-size: 1.05rem;
        border-left: 4px solid transparent;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(255,255,255,0.1) !important;
        color: white !important;
        border-left: 4px solid white;
    }
    
    .nav-links a i {
        width: 24px;
        text-align: center;
    }
    
    .nav-links a i {
        font-size: 1rem;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        background: rgba(255,255,255,0.2);
        border: 2px solid white;
        color: white;
        border-radius: 4px;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        cursor: pointer;
        transition: all 0.2s;
        margin-left: auto;
        font-weight: 500;
    }
    
    .mobile-menu-btn:hover {
        background: rgba(0,0,0,0.2);
    }
    
    .nav-overlay {
        display: block !important;
        background: rgba(0,0,0,0.5);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* Remove duplicate mobile block (consolidated above) */
    
/* Hover and active states for navigation links */
.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,0.2) !important;
    color: white !important;
}

/* Auth state specific styles */
.auth-state[data-auth="guest"] .btn-outline {
    border: 1px solid white;
    color: white;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
    transition: all 0.2s;
}

.auth-state[data-auth="guest"] .btn-outline:hover {
    background: white;
    color: var(--saffron) !important;
}

/* User profile in navigation */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.user-avatar {
    font-size: 1.25rem;
    color: white;
}

.user-name {
    color: white;
    font-weight: 500;
}

.sign-out {
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.8;
}

.sign-out:hover {
    background-color: var(--saffron-dark);
    color: var(--white);
    opacity: 1;
}
    
/* Auth state specific styles */
.auth-state[data-auth="guest"] .btn-outline {
    color: white !important;
    border-color: white;
    background: transparent;
    margin: 0;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
    transition: all 0.2s;
}

.auth-state[data-auth="guest"] .btn-outline:hover {
    background: white;
    color: var(--saffron) !important;
}

.auth-state[data-auth="authenticated"] .user-profile {
    color: white;
}

/* General styles */
.header-container {
    padding: 0.75rem 1rem;
    position: relative;
}

.logo-container {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-container {
    display: flex;
    align-items: center;
}

.nav-links li {
    width: auto;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    z-index: 1001;
    transition: all 0.3s ease;
    gap: 8px;
    margin-left: auto;
}

.mobile-menu-btn:hover {
    background: var(--saffron-dark);
    transform: scale(1.05);
}

/* User profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

/* Auth State Specific Styles */
[data-auth="guest"] {
    display: block;
}

[data-auth="authenticated"] {
    display: none;
}

/* When user is authenticated */
body.authenticated [data-auth="guest"] {
    display: none;
}

body.authenticated [data-auth="authenticated"] {
    display: block;
}
