/**
 * Styles de l'en-tête principal
 * Style moderne avec dégradé et effets glassmorphism
 */

/* Header principal */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-gradient-blue, #1e40af), var(--primary-gradient-purple, #3730a3));
    color: var(--text-on-primary);
    padding: var(--spacing-md) var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--box-shadow, 0 4px 20px rgba(0, 0, 0, 0.15));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: headerGlow 8s infinite alternate;
    transition: all 0.3s ease;
    background-size: 300% 300%;
}
@keyframes headerGlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--breakpoint-desktop);
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* Titre principal - maintient au centre mais avec z-index ajusté */
header h1 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 700;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    background: linear-gradient(to right, var(--header-title-gradient-1, #ffffff), var(--header-title-gradient-2, #f0f0f0), var(--header-title-gradient-1, #ffffff));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: shimmer 3s infinite;
    z-index: 5; /* Z-index ajusté pour être derrière le theme-switch */
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Styles pour les actions de l'en-tête (boutons et horloge) */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-left: auto;
    z-index: 10;
}

/* Positionnement du theme switch à gauche */
.theme-switch-wrapper {
    z-index: 20;
    margin-right: auto;
    flex-shrink: 0; /* Empêche le rétrécissement sur les petits écrans */
    min-width: 48px; /* Largeur minimale réduite */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Positionnement de l'horloge à droite */
.top-clock {
    margin-left: auto;
    z-index: 10;
    flex-shrink: 0; /* Empêche le rétrécissement sur les petits écrans */
}

/* Effet supplémentaire pour le header au survol */
header:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: var(--spacing-sm) var(--spacing-sm);
    }
    
    .header-container {
        justify-content: space-between;
        padding: 0 2px;
    }
    
    header h1 {
        font-size: calc(var(--font-size-lg) - 0.2rem);
        width: 60%;
        text-align: center;
    }
    
    /* Ajustement pour aligner à gauche sur mobile */
    .theme-switch-wrapper {
        margin-right: auto;
        margin-left: 0;
        position: relative;
        left: 0;
        min-width: 30px; /* Encore plus petit pour mobile */
        padding-left: 0;
    }
    
    /* Ajustement pour l'horloge sur mobile */
    .top-clock {
        margin-left: auto;
        position: relative;
        right: 0;
        transform: scale(0.95);
        transform-origin: right center;
    }
}

@media (max-width: 480px) {
    header {
        padding: var(--spacing-xs, 0.3rem) var(--spacing-xs, 0.3rem);
    }
    
    .header-container {
        padding: 0;
    }
    
    header h1 {
        font-size: calc(var(--font-size-md));
        width: 55%;
        left: 48%; /* Légèrement décentré pour compenser l'espace du theme-switch */
    }
    
    /* Réduire encore l'espacement sur les petits écrans */
    .theme-switch-wrapper {
        margin-right: 0;
        position: relative;
        left: 0;
        min-width: 25px; /* Minimiser la largeur */
    }
    
    /* Ajuster la position de l'horloge sur très petits écrans */
    .top-clock {
        margin-left: auto;
        position: relative;
        right: 0;
        /* Réduire la taille de l'horloge sur mobile */
        transform: scale(0.85);
        transform-origin: right center;
    }
} 
