/* =============================================================
   VILLAGE-HEADER.CSS — Header, Navigation, Bandeau d'annonce
   Styles pour la top-bar + nav desktop (pill-bar) + nav mobile (burger)
   Compatible avec les 3 thèmes (surcharge via --theme-main)
   Alif Genesis Ltd — 2026
   ============================================================= */


/* --- 1. BANDEAU D'ANNONCE (Top Bar) --- */
.top-bar {
    background-color: var(--bleu-nuit);
    color: var(--blanc-lumineux);
    height: 30px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    z-index: 102;
    position: relative;
    overflow: hidden;
    font-family: 'Fredoka', sans-serif;
}

/* Conteneur du texte défilant */
.news-container {
    width: 60%;
    overflow: hidden;
    white-space: nowrap;
}

/* Texte défilant (ticker) */
.news-ticker {
    display: inline-block;
    font-style: italic;
    padding-left: 100%;
    animation: defilement 15s linear infinite;
    line-height: 30px;
    color: var(--blanc-lumineux);
}

/* Lien doré dans le ticker */
.news-ticker a,
.ticker-link {
    color: var(--or-solaire);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid var(--or-solaire);
}

/* Icônes réseaux sociaux (header) */
.social-icons {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-shrink: 0;
}

.social-icons img {
    height: 26px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-icons img:hover {
    transform: scale(1.3);
}


/* --- 2. NAVIGATION DESKTOP (Pill-Bar) --- */
nav {
    position: absolute;
    top: 40px;
    width: 100%;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 100;
}

/* Logo */
.logo img {
    height: 130px;
    width: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin-top: 5px;
    background: radial-gradient(closest-side, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.0) 100%);
    border-radius: 50%;
    padding: 10px;
    margin-left: -10px;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.15);
}

/* Barre de navigation principale (pill-bar glassmorphism) */
.menu-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 25px;
    display: flex;
    background: rgba(255, 255, 255, 0.4);
    padding: 5px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    width: max-content;
    max-width: 95%;
    box-shadow: 0 5px 15px rgba(93, 64, 55, 0.05);
}

/* Liens de navigation */
.menu-links a {
    text-decoration: none;
    color: var(--marron-texte);
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 30px;
    transition: 0.3s;
    white-space: nowrap;
    position: relative;
}

/* Lien actif et hover — utilise la couleur du thème courant */
.menu-links a:hover,
.menu-links a.active {
    background: var(--theme-main);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--theme-glow);
}

/* Sous-titre "(Alif Genesis Online School)" sous le lien Quartier Éducatif */
.menu-links a span.subtitle {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    font-weight: bold;
    color: var(--or-solaire);
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
}

/* Bouton Connexion (Desktop) */
.connexion-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: 0.3s;
    margin-top: 10px;
    cursor: pointer;
}

.connexion-icon img {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.6);
    margin-bottom: 5px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.connexion-text {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    color: var(--marron-texte);
    transition: 0.3s;
    margin-top: 5px;
}

.connexion-wrapper:hover .connexion-icon img {
    transform: scale(1.15);
    border-color: var(--theme-main);
}

.connexion-wrapper:hover .connexion-text {
    color: var(--theme-main);
}


/* --- 3. ÉLÉMENTS MASQUÉS EN DESKTOP --- */
.burger-centered {
    display: none;
}

.mobile-connexion-right {
    display: none;
}

.close-menu-btn {
    display: none;
}


/* --- 4. RESPONSIVE MOBILE (max-width: 900px) --- */
@media (max-width: 900px) {

    /* Réorganisation de la nav */
    nav {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: absolute;
        top: 35px;
        width: 100%;
        padding: 0 20px;
        z-index: 200;
        background-color: var(--sable-fond) !important;
    }

    /* Logo réduit sur mobile */
    .logo img {
        height: 120px;
        width: auto;
        aspect-ratio: 1 / 1;
        object-fit: contain;
        margin: 0;
        padding: 0;
        background: none;
    }

    /* Masquer la pill-bar et le bouton connexion desktop */
    .menu-links,
    .connexion-wrapper {
        display: none;
    }

    /* Afficher le bouton burger (centré) */
    .burger-centered {
        display: flex;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 2rem;
        color: var(--bleu-nuit);
        cursor: pointer;
        background: rgba(255,255,255,0.5);
        padding: 5px 10px;
        border-radius: 10px;
    }

    /* Afficher le bouton connexion mobile (à droite) */
    .mobile-connexion-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        gap: 2px;
    }

    .mobile-connexion-right img {
        width: 55px;
        height: 55px;
        border-radius: 50%;
        border: 2px solid white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .mobile-connexion-right span {
        font-size: 0.85rem;
        font-weight: bold;
        color: var(--marron-texte);
        font-family: 'Fredoka', sans-serif;
    }

    /* Menu mobile (panneau latéral droit) — caché par défaut */
    .menu-links {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    /* Menu mobile ouvert */
    .menu-links.mobile-active {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        height: 100vh;
        background: white;
        padding-top: 80px;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        z-index: 300;
        transform: translateX(0);
    }

    /* Liens dans le menu mobile */
    .menu-links a {
        font-size: 1.1rem;
        padding: 15px 20px;
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #eee;
        border-radius: 0;
    }

    /* Subtitle en mobile : en dessous du lien, pas en absolute */
    .menu-links a span.subtitle {
        position: static;
        transform: none;
        margin-top: 2px;
        margin-left: 0;
        font-size: 0.75rem;
    }

    /* Bouton fermer le menu mobile */
    .close-menu-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 2rem;
        color: var(--marron-texte);
        cursor: pointer;
    }
}
