/* ═══════════════════════════════════════════════════════
   loader.css  —  Animation de chargement
   Chemin : ./content/css/loader.css
   ═══════════════════════════════════════════════════════ */

/* ── Verrouiller le scroll pendant le chargement ─────── */
body.is-loading {
    overflow: hidden;
    height: 100vh;
}

/* ── Écran plein écran ───────────────────────────────── */
#site-loader {
    position: fixed;
    inset: 0;                       /* top/right/bottom/left: 0 */
    width: 100vw;
    height: 100vh;
    background-color: #212121;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;                 /* au-dessus de tout */
    pointer-events: all;            /* bloque tous les clics */

    /* État initial visible */
    opacity: 1;
    visibility: visible;
    transition:
        opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Classe ajoutée par JS quand le loader disparaît ─── */
#site-loader.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ── Fond : petits grains animés ─────────────────────── */


/* ── Contenu centré ──────────────────────────────────── */
.loader-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

/* ── Wrapper anneau + logo ───────────────────────────── */
.loader-ring-wrap {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── SVG de l'anneau ─────────────────────────────────── */
.loader-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);      /* départ à midi */
}

/* Piste (cercle gris discret) */
.loader-ring-track {
    stroke: rgba(255, 255, 255, 0.08);
}

/* Arc bleu animé */
.loader-ring-arc {
    stroke: #2272ff;
    animation: arcSpin 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: center;
    transform-box: fill-box;
}

@keyframes arcSpin {
    0%   { stroke-dashoffset: 280; transform: rotate(0deg); }
    50%  { stroke-dashoffset: 60;  transform: rotate(135deg); }
    100% { stroke-dashoffset: 280; transform: rotate(360deg); }
}

/* ── Remplissage progressif (lié au JS) ──────────────── */
.loader-ring-arc.filling {
    animation: none;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-dashoffset: 0;
}

/* ── Logo centré dans l'anneau ───────────────────────── */
.loader-logo {
    position: relative;
    width: 100px;
    height: 100px;
    object-fit: contain;
    opacity: 0;
    animation: logoPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
    filter: drop-shadow(0 0 12px rgba(34, 114, 255, 0.5));
}

@keyframes logoPop {
    0%   { opacity: 0; transform: scale(0.6); }
    100% { opacity: 1; transform: scale(1); }
}

/* ── Légère rotation du logo ─────────────────────────── */
.loader-logo.spin-out {
    animation: logoSpinOut 0.5s ease-in forwards;
}

@keyframes logoSpinOut {
    to { transform: scale(1.15) rotate(30deg); opacity: 0.6; }
}

/* ── Message texte ───────────────────────────────────── */
.loader-message {
    font-family: 'ImpactWeb', Impact, Arial, sans-serif;
    font-size: clamp(0.85rem, 2.5vw, 1.5rem);
    margin-left: 35px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: baseline;
    gap: 2px;
    opacity: 0;
    animation: fadeInMsg 0.5s ease 0.6s forwards;
}

@keyframes fadeInMsg {
    to { opacity: 1; }
}

/* Ligne de texte */
.loader-msg-line {
    color: rgba(255, 255, 255, 0.7);
}

/* Points animés */
.loader-msg-dots span {
    display: inline-block;
    color: #2272ff;
    animation: dotBlink 1.2s ease-in-out infinite;
}

.loader-msg-dots span:nth-child(1) { animation-delay: 0s; }
.loader-msg-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-msg-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
    0%, 100% { opacity: 0.2; transform: translateY(0); }
    50%       { opacity: 1;   transform: translateY(-4px); }
}

/* ── Barre de progression fine en bas ────────────────── */
.loader-progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.loader-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2272ff, #64b5f6);
    transition: width 2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 2px 2px 0;
}