/* Header and Navigation Styles */
.main-header {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo:hover {
    color: rgba(255, 255, 255, 0.9);
}

.nav-menu {
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item .nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item .nav-link:hover,
.nav-item .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background: rgba(255, 255, 255, 0.1);
}

.user-info i {
    font-size: 1.25rem;
}

.user-info span {
    color: white;
    font-weight: 500;
}

.logout-btn {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.2);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

.logout-link {
    background: rgba(239, 68, 68, 0.2) !important;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    color: white !important;
}

/* Desktop/Mobile visibility classes */
.mobile-only {
    display: none;
}

.desktop-only {
    display: flex;
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

/* Force mobile button visibility on small screens */
@media (max-width: 767.98px) {
    .mobile-menu-btn {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .main-header .container {
        position: relative !important;
    }
    
    .mobile-menu-btn {
        display: block !important;
    }

    .main-header {
        position: relative;
    }

    .nav-wrapper {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap;
        position: relative !important;
    }

    .brand-section {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-shrink: 0;
    }

    .nav-menu {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #4338ca !important;
        padding: 1rem !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
        z-index: 1001 !important;
        width: 100% !important;
        border: none !important;
        margin: 0 !important;
    }

    .nav-menu.show {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .nav-item {
        display: block !important;
        width: 100% !important;
    }

    .nav-item .nav-link {
        padding: 0.75rem 1rem !important;
        border-radius: 0.375rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
        color: rgba(255, 255, 255, 0.9) !important;
        text-decoration: none !important;
    }

    .nav-item .nav-link:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        color: white !important;
    }

    /* Show logout in mobile menu */
    .mobile-only {
        display: block;
    }

    /* Hide desktop logout button on mobile */
    .desktop-only {
        display: none !important;
    }

    /* Force user section to be visible on mobile */
    .user-section {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        flex-shrink: 0 !important;
        min-width: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .user-info {
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
        color: white !important;
        padding: 0.4rem 0.8rem !important;
        border-radius: 0.375rem !important;
        background: rgba(255, 255, 255, 0.15) !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .user-info i {
        font-size: 1.1rem !important;
        color: white !important;
    }

    .user-info span {
        display: inline-block !important;
        max-width: 120px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: white !important;
        font-weight: 500 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Content Spacing */
.main-content {
    margin-top: 4.5rem; /* Header height + some spacing */
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .main-content {
        margin-top: 4rem; /* Slightly less spacing on mobile */
    }
    
    /* Overlay for mobile menu */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .mobile-menu-overlay.show {
        display: block;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .brand-logo {
        font-size: 1.2rem;
    }
    
    .user-info {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.75rem !important;
        gap: 0.3rem !important;
    }
    
    .user-info span {
        max-width: 80px !important;
    }
    
    .user-info i {
        font-size: 1rem !important;
    }
    
    .mobile-menu-btn {
        padding: 0.4rem !important;
    }
    
    .nav-wrapper {
        gap: 0.5rem !important;
    }
}