/* 
 * Header-Komponente für CityChallenge Forms
 * Moderne Top-Navigation mit Benutzer-Menü
 */

/* Header Layout Komponenten */
.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Logo und Branding */
.app-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.app-logo:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.app-logo-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.app-title {
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.app-subtitle {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 0;
    line-height: 1;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: none; /* Standardmäßig versteckt auf Desktop */
    background: none;
    border: none;
    padding: 0.5rem;
    font-size: 1.25rem;
    color: var(--gray);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: #f3f4f6;
    color: var(--primary);
}

.sidebar-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Benutzer-Menü */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 0.5rem;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    margin: 0;
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray);
    margin: 0;
    line-height: 1.2;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: none;
}

.user-avatar:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* Dropdown Menü */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1040;
}

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

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background-color: #f3f4f6;
    color: var(--primary);
    text-decoration: none;
}

.user-dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--gray);
}

.user-dropdown-item:hover i {
    color: var(--primary);
}

.user-dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--gray);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.header-action-btn:hover {
    background-color: #f3f4f6;
    color: var(--primary);
}

.header-action-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Responsive Design */
@media (max-width: 991px) {
    .sidebar-toggle {
        display: flex;
    }
    
    .user-info {
        display: none; /* Verstecke Benutzer-Text auf kleineren Bildschirmen */
    }
    
    .app-title {
        font-size: 1.125rem;
    }
    
    .header-actions {
        gap: 0.25rem;
    }
}

@media (max-width: 767px) {
    .app-header {
        padding: 0 0.75rem;
    }
    
    .header-left {
        gap: 0.75rem;
    }
    
    .app-title {
        font-size: 1rem;
    }
    
    .app-subtitle {
        display: none;
    }
    
    .header-actions {
        gap: 0.25rem;
    }
    
    .header-action-btn {
        width: 36px;
        height: 36px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .app-logo-icon {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }
    
    .app-title {
        font-size: 0.9rem;
    }
}

/* Dark Mode Support (DISABLED - Force light header) */
@media (prefers-color-scheme: dark) {
    .app-header {
        background: #ffffff !important;
        border-bottom-color: #e5e7eb !important;
    }
    
    .app-title,
    .user-name {
        color: #333333 !important;
    }
    
    .user-role {
        color: #666666 !important;
    }
    
    .user-dropdown-content {
        background: #ffffff !important;
        border-color: #e5e7eb !important;
    }
    
    .user-dropdown-item {
        color: #333333 !important;
    }
    
    .user-dropdown-item:hover {
        background-color: #f3f4f6 !important;
    }
}

/* Loading State */
.header-loading .app-title::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}