/*
 * common.css — assets partagés entre toutes les pages eltes
 *
 * Inclus AVANT le bloc <style> propre à chaque page.
 *
 * Fournit :
 *   1. Fix du gradient WebKit-only sur .brand-text h1 (invisible sur Firefox)
 *   2. Indicateur de page active dans la nav (.nav-btn.active)
 *   3. Hamburger menu + comportement mobile cohérent
 */

/* === 1. Brand-text gradient avec fallback Firefox/Safari pré-9 === */
.brand-text h1 {
    color: #ffffff; /* fallback */
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
    .brand-text h1 {
        color: transparent;
        background: linear-gradient(45deg, #ffffff, #e3f2fd);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

/* === 2. Indicateur "page active" === */
.nav-btn.active,
.nav-btn[aria-current="page"] {
    background: rgba(255, 255, 255, 0.28) !important;
    border-color: rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    position: relative;
}
.nav-btn.active::after,
.nav-btn[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -6px;
    height: 3px;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* === 3. Hamburger menu (mobile) === */
.nav-toggler {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    transition: background 0.2s;
}
.nav-toggler:hover,
.nav-toggler:focus {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}
.nav-toggler span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    position: relative;
    transition: transform 0.25s, opacity 0.25s;
}
.nav-toggler span::before,
.nav-toggler span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.25s, top 0.25s;
}
.nav-toggler span::before { top: -7px; }
.nav-toggler span::after  { top:  7px; }

.nav-toggler[aria-expanded="true"] span { background: transparent; }
.nav-toggler[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggler[aria-expanded="true"] span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 991px) {
    .nav-toggler { display: inline-flex; }

    .header-content {
        flex-wrap: wrap !important;
    }

    .header-nav {
        flex: 0 0 100%;
        order: 99;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        margin-top: 0.75rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, margin-top 0.3s ease;
    }
    .header-nav.is-open {
        max-height: 600px;
        margin-top: 0.75rem;
    }
    .header-nav .nav-btn,
    .header-nav .user-badge {
        width: 100%;
        justify-content: flex-start !important;
    }
}

/* === 4. Petites améliorations transverses === */

/* Empêcher le débordement horizontal sur smartphones étroits */
html, body { max-width: 100%; overflow-x: hidden; }

/* Indicateur "scroll horizontal" sur tables responsives serrées */
.table-responsive {
    position: relative;
}
.table-responsive::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.06));
    opacity: 0;
    transition: opacity 0.2s;
}
.table-responsive[data-overflow="true"]::after { opacity: 1; }

/* Utilitaires */
.eltes-clickable-row { cursor: pointer; transition: background 0.12s; }
.eltes-clickable-row:hover { background: rgba(102, 126, 234, 0.06) !important; }
