﻿/* Modern Header Styles - Green Theme */
:root {
    --header-height: 80px;
    --header-bg: #2d6760;        /* Main header background */
    --header-bg-hover: #3e8a7f;   /* Hover state */
    --header-bg-light: #4a9b8e;   /* Light variant */
    --header-text: #ffffff;
    --header-text-muted: rgba(255, 255, 255, 0.8);
    --header-border: rgba(255, 255, 255, 0.1);
    --header-shadow: 0 2px 20px rgba(45, 103, 96, 0.3);
    --header-dropdown-bg: #ffffff;
    --header-dropdown-shadow: 0 8px 32px rgba(45, 103, 96, 0.12);
    --header-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-success: #198754;
}

/* Main Header */
.modern-header {
    background: linear-gradient(135deg, var(--header-bg) 0%, var(--header-bg-hover) 100%) !important;
    box-shadow: var(--header-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: var(--header-transition);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--header-border);
}

.modern-header.scrolled {
    background: rgba(45, 103, 96, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(45, 103, 96, 0.4);
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo Section */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--header-transition);
    position: relative;
}

.header-logo:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.header-logo img {
    height: 50px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--header-transition);
    background: white;
    padding: 4px;
}

.header-logo:hover img {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.header-brand-text {
    color: var(--header-text);
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 1rem;
    letter-spacing: -0.025em;
    display: none;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

/* Navigation Buttons */
.nav-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    color: var(--header-text);
    text-decoration: none;
    transition: var(--header-transition);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.nav-dropdown::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;
}

.nav-dropdown:hover::before {
    left: 100%;
}

.nav-dropdown:hover,
.nav-dropdown.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--header-text);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-dropdown i {
    font-size: 1.125rem;
}

.nav-dropdown .dropdown-arrow {
    transition: transform 0.3s ease;
    margin-left: 0.25rem;
}

.nav-dropdown[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menus */
.nav-dropdown-menu {
    background: var(--header-dropdown-bg);
    border: none;
    border-radius: 16px;
    box-shadow: var(--header-dropdown-shadow);
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    min-width: 220px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-dropdown-item {
    padding: 0.75rem 1.5rem;
    color: #374151;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--header-transition);
    font-weight: 500;
    position: relative;
}

.nav-dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--header-bg);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-dropdown-item:hover {
    background: rgba(45, 103, 96, 0.05);
    color: var(--header-bg);
    text-decoration: none;
    padding-left: 2rem;
}

.nav-dropdown-item:hover::before {
    transform: scaleY(1);
}

.nav-dropdown-item i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.7;
    color: var(--header-bg);
}

/* User Menu Special Styling */
.user-menu .nav-dropdown {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.user-menu .nav-dropdown:hover {
    background: rgba(255, 255, 255, 0.25);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    color: var(--header-text);
    cursor: pointer;
    transition: var(--header-transition);
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.mobile-toggle i {
    font-size: 1.5rem;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(45, 103, 96, 0.98);
    backdrop-filter: blur(20px);
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.mobile-nav.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-nav-item {
    margin-bottom: 0.5rem;
}

.mobile-nav-item .nav-dropdown {
    width: 100%;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.mobile-nav-submenu {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    display: none;
}

.mobile-nav-submenu.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav-submenu .nav-dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
}

.mobile-nav-submenu .nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 1rem;
}

.mobile-nav-submenu .nav-dropdown-item::before {
    display: none;
}

.mobile-nav-submenu .nav-dropdown-item i {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .header-container {
        padding: 0 1.5rem;
    }
    
    .header-brand-text {
        display: none;
    }
}

@media (max-width: 992px) {
    .header-nav {
        display: none;
    }
    
    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-container {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .header-logo img {
        height: 40px;
    }
    
    .header-container {
        padding: 0 0.75rem;
    }
}

/* Loading Animation */
.header-loading {
    position: relative;
    overflow: hidden;
}

.header-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid var(--header-bg);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.nav-dropdown:focus,
.nav-dropdown-item:focus,
.mobile-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .nav-dropdown-menu {
        background: #1f2937;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-dropdown-item {
        color: #e5e7eb;
    }
    
    .nav-dropdown-item:hover {
        background: rgba(45, 103, 96, 0.1);
        color: white;
    }
    
    .nav-dropdown-item i {
        color: var(--header-bg);
    }
}
