/* Styles pour le header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 5px 10px;
    font-size: 12px;
    z-index: 10; /* Valeur plus élevée pour être au-dessus des autres éléments */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header.hidden {
    transform: translateY(-100%);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo img {
    height: 24px;
    width: auto;
    border-radius: 4px;
}

.header-logo span {
    font-weight: bold;
    font-size: 14px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Nom du profil actif affiché dans le header */
.header-profile-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bouton de gestion des profils – icône seule (sans fond) */
.header-tools .profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    border: none;
    box-shadow: none;
    cursor: pointer;
    padding: 2px 4px; /* agrandir la zone cliquable sans fond */
}

.header-tools .profile-btn i {
    font-size: 18px; /* plus visible sans cercle */
    line-height: 1;
}

.header-tools .profile-btn:hover i { color: #ffd54f; }
.header-tools .profile-btn:active i { transform: scale(0.96); }

/* Styles pour le sablier dans le header - utilise les mêmes styles que le sablier original */
#headerTimer {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-left: 10px;
    position: relative;
    background-color: var(--page-color);
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 4px var(--shadow-color);
    opacity: .6;
    transition: opacity .3s;
}

#headerTimer i {
    position: absolute;
    font-size: 14px;
    color: #fff;
    z-index: 2;
}

#headerTimer .timer-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: #2ecc71;
    transition: height 0.6s linear, background-color 0.6s linear;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

/* Animation de flash pour le sablier du header */
@keyframes headerFlash { 50% { opacity: .2; } }

/* Styles pour l'horloge */
#headerClock {
    font-size: 14px;
    font-weight: 500;
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.9);
}

/* Ajustement pour le contenu principal */
.library, .splash-screen {
    margin-top: 34px; /* Ajouter un espace pour le header */
}

/* Masquer l'ancien sablier puisqu'il est maintenant dans le header */
#sessionTimer {
    display: none !important;
}

/* Animation pour le sablier */
@keyframes headerFlash {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Styles responsifs */
@media (max-width: 768px) {
    .header {
        padding: 3px 8px;
    }
    
    .header-logo img {
        height: 20px;
    }
    
    .header-logo span {
        font-size: 12px;
    }
    
    .header-timer {
        font-size: 10px;
    }
    
    #headerClock {
        font-size: 12px;
    }
    
    .header-profile-name {
        max-width: 110px;
        font-size: 11px;
    }
    
    .header-tools .profile-btn i { font-size: 17px; }
    
    .library, .splash-screen {
        margin-top: 30px; /* Ajuster pour les petits écrans */
    }
}
