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

/* Modern Header Container */
.modern-header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    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: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: #475569;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    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: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    z-index: 2;
}

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

.modern-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.modern-search-input:focus {
    background: white;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    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;
}

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

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

.suggestion-item:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
}

.suggestion-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

.suggestion-content {
    flex: 1;
}

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

.suggestion-type {
    font-size: 0.75rem;
    color: #94a3b8;
}

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

/* Notification Button */
.notification-btn {
    position: relative;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: #475569;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    display: flex;
}

.notification-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    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: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
    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 rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.notification-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.mark-all-read {
    background: none;
    border: none;
    color: #3b82f6;
    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: rgba(59, 130, 246, 0.1);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

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

.notification-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

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

.notification-item:hover {
    background: #f8fafc;
    border-left-color: #3b82f6;
}

.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: #dbeafe;
    color: #3b82f6;
}

.notification-warning .notification-icon {
    background: #fef3c7;
    color: #d97706;
}

.notification-success .notification-icon {
    background: #d1fae5;
    color: #059669;
}

.notification-danger .notification-icon {
    background: #fee2e2;
    color: #dc2626;
}

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

.notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
    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: #64748b;
}

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

.notification-requestor {
    font-size: 0.75rem;
    color: #94a3b8;
    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: #94a3b8;
    font-size: 0.875rem;
}

.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 rgba(0, 0, 0, 0.08);
    background: #f8fafc;
}

.view-all-notifications {
    display: block;
    text-align: center;
    color: #3b82f6;
    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: rgba(59, 130, 246, 0.1);
}

/* 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: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.favorite-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px) scale(1.05);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 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: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.modern-user-menu:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.modern-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    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(59, 130, 246, 0.3);
}

.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) {
    .header-left {
        gap: 1rem;
    }
    
    .modern-search {
        width: 200px;
    }
    
    .modern-user-info {
        display: none;
    }
    
    .header-right {
        gap: 0.75rem;
    }
}
