/* ==========================================================================
   MODERN HEADER DESIGN
   ========================================================================== */

/* Modern Header Container */
.modern-header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 80px;
    background: var(--surface-overlay, rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Content Area - Adjust for fixed header */
.main-wrapper {
    margin-left: 280px;
    padding-top: 100px;
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-sidebar.collapsed + .main-wrapper .modern-header {
    left: 80px;
}

.modern-sidebar.collapsed + .main-wrapper {
    margin-left: 80px;
}

@media (max-width: 768px) {
    .modern-header {
        left: 0;
        padding: 0 1rem;
    }
    
    .main-wrapper {
        margin-left: 0;
        padding-top: 100px;
    }
}

/* Header Left Section */
.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.mobile-menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--gray-600);
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Modern Search Bar */
.modern-search {
    position: relative;
    width: 400px;
    max-width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

.modern-search-input {
    width: 100%;
    height: 48px;
    padding: 0 1rem 0 3rem;
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    transition: all 0.2s ease;
    outline: none;
}

.modern-search-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.modern-search-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-ultra-light);
    transform: translateY(-1px);
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.search-suggestions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.suggestion-item:hover {
    background: var(--primary-ultra-light);
    color: var(--primary-color);
}

.suggestion-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.suggestion-content {
    flex: 1;
}

.suggestion-title {
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.suggestion-type {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Notification Button */
.notification-wrapper {
    position: relative;
}

.notification-btn {
    position: relative;
    width: 48px;
    height: 48px;
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--gray-600);
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    display: flex;
}

.notification-btn:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 380px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.notification-dropdown.open {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
}

.notification-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mark-all-read:hover {
    background: var(--primary-ultra-light);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
    background: var(--bg-card);
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: var(--primary-ultra-light);
    border-left-color: var(--primary-color);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1rem;
}

.notification-info .notification-icon {
    background: var(--info-light);
    color: var(--info-color);
}

.notification-warning .notification-icon {
    background: var(--warning-light);
    color: var(--warning-color);
}

.notification-success .notification-icon {
    background: var(--success-light);
    color: var(--success-color);
}

.notification-danger .notification-icon {
    background: var(--danger-light);
    color: var(--danger-color);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notification-type {
    font-weight: 500;
    text-transform: capitalize;
}

.notification-requestor {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.notification-loading,
.notification-empty,
.notification-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    background: var(--bg-card);
}

.notification-loading i,
.notification-empty i,
.notification-error i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.notification-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--gray-50);
}

.view-all-notifications {
    display: block;
    text-align: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.view-all-notifications:hover {
    background: var(--primary-ultra-light);
    color: var(--primary-color);
}

/* Modern User Menu */
.modern-user-menu-wrapper {
    position: relative;
}

/* Favorites in Header */
.favorites-wrapper {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.favorites-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorite-item {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.25));
    border: 2px solid rgba(245, 158, 11, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.favorite-item:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.35));
    transform: translateY(-3px) scale(1.05);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* Dark Mode */
[data-theme="dark"] .favorite-item {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
    color: #fbbf24;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .favorite-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modern-user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.modern-user-menu:hover {
    background: var(--primary-ultra-light);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.modern-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.modern-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.modern-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.modern-user-role {
    font-size: 0.75rem;
    color: #64748b;
}

.modern-user-icon {
    color: #94a3b8;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.modern-user-menu:hover .modern-user-icon {
    transform: translateX(2px);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 280px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

.user-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(59, 130, 246, 0.05);
}

.user-dropdown-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.user-dropdown-email {
    font-size: 0.875rem;
    color: #64748b;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.user-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1e293b;
}

.user-dropdown-item i {
    width: 16px;
    text-align: center;
    color: #94a3b8;
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 0.5rem 0;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .modern-header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .mobile-menu-toggle,
[data-theme="dark"] .notification-btn,
[data-theme="dark"] .modern-user-menu {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

[data-theme="dark"] .mobile-menu-toggle:hover,
[data-theme="dark"] .notification-btn:hover,
[data-theme="dark"] .modern-user-menu:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modern-search-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

[data-theme="dark"] .modern-search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: #3b82f6;
}

[data-theme="dark"] .modern-search-input::placeholder {
    color: #94a3b8;
}

[data-theme="dark"] .search-icon {
    color: #94a3b8;
}

[data-theme="dark"] .search-suggestions,
[data-theme="dark"] .user-dropdown {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .suggestion-item,
[data-theme="dark"] .user-dropdown-item {
    color: #cbd5e1;
}

[data-theme="dark"] .suggestion-item:hover,
[data-theme="dark"] .user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}

[data-theme="dark"] .suggestion-icon,
[data-theme="dark"] .user-dropdown-item i {
    color: #94a3b8;
}

[data-theme="dark"] .suggestion-type,
[data-theme="dark"] .modern-user-role {
    color: #94a3b8;
}

[data-theme="dark"] .user-dropdown-header {
    background: rgba(59, 130, 246, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .user-dropdown-name {
    color: #f1f5f9;
}

[data-theme="dark"] .user-dropdown-email {
    color: #94a3b8;
}

[data-theme="dark"] .user-dropdown-divider {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .notification-badge {
    border-color: #1e293b;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .modern-search {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .modern-header {
        left: 0;
        padding: 0 1rem;
        width: 100%;
    }
    
    .header-left {
        gap: 0.5rem;
    }
    
    .modern-search {
        display: none;
    }
    
    .modern-user-info {
        display: none;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .notification-btn {
        width: 36px;
        height: 36px;
    }
    
    .modern-user-menu {
        width: 36px;
        height: 36px;
    }
    
    .favorites-list {
        display: none;
    }
}
