/* Modern Header Styles */
.modern-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Brand Section */
.brand-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s ease;
}

.logo-link:hover {
    transform: translateY(-2px);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
    transition: all 0.3s ease;
}

.logo-icon:hover {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.logo-icon i {
    font-size: 20px;
    color: #fff;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tagline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

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

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link i {
    font-size: 16px;
    transition: all 0.3s ease;
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* Language Selector */
.language-selector {
    position: relative;
    margin-right: 1rem;
}

.language-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.language-toggle i:first-child {
    color: #00d4ff;
    font-size: 14px;
}

.current-lang {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-toggle i:last-child {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.language-toggle:hover i:last-child {
    transform: rotate(180deg);
}

/* Language Modal */
.language-modal {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: #1a1a2e;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 8px;
}

.language-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.language-modal-header h3 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-modal-header h3 i {
    color: #00d4ff;
    font-size: 14px;
}

.language-options {
    padding: 8px 0;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.language-option:hover {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    transform: translateX(4px);
}

.language-option.active {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    font-weight: 600;
}

.language-option.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #00d4ff;
    border-radius: 0 2px 2px 0;
}

.language-option .flag {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.language-option .name {
    flex: 1;
    font-weight: 500;
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-avatar-container {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    border-color: #00d4ff;
    transform: scale(1.05);
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #1a1a2e;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-role {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-weight: 400;
}

.dropdown-icon {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    transition: all 0.3s ease;
}

.user-profile:hover .dropdown-icon {
    transform: rotate(180deg);
}

/* User Modal */
.user-modal {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-top: 8px;
}

.user-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.modal-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-user-info h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.modal-user-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
}

.user-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.stat-item i {
    color: #00d4ff;
    font-size: 16px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    transform: translateX(4px);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-outline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 1.5rem;
    }
    
    .nav-list {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        height: 60px;
    }
    
    .brand-name {
        font-size: 1.2rem;
    }
    
    .brand-tagline {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-navigation {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 280px;
        height: calc(100vh - 60px);
        background: #1a1a2e;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .main-navigation.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        width: 100%;
        padding: 16px 24px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-link:hover {
        background: rgba(0, 212, 255, 0.1);
        transform: none;
    }
    
    .user-actions {
        gap: 8px;
    }
    
    .user-profile {
        padding: 6px 12px;
    }
    
    .user-info {
        display: none;
    }
    
    .user-modal {
        width: 280px;
        right: -10px;
    }
    
    .auth-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .language-selector {
        margin-right: 8px;
    }

    .language-toggle {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .language-modal {
        width: 180px;
        right: -10px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 0.75rem;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        margin-right: 8px;
    }
    
    .logo-icon i {
        font-size: 16px;
    }
    
    .brand-name {
        font-size: 1rem;
    }
    
    .user-profile {
        padding: 4px 8px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .language-toggle {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .language-toggle .current-lang {
        display: none;
    }

    .language-modal {
        width: 160px;
        right: -15px;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .modern-header {
        background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    }
}

/* Animation for page load */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modern-header {
    animation: slideDown 0.6s ease-out;
}

/* Scroll effect */
.modern-header.scrolled {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* Focus states for accessibility */
.nav-link:focus,
.btn:focus,
.user-profile:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modern-header {
        border-bottom: 2px solid #fff;
    }
    
    .nav-link {
        color: #fff;
    }
    
    .nav-link:hover {
        background: #00d4ff;
        color: #000;
    }
}
