/* ==========================================================================
   FrontPulse - thème « Forge »
   Même structure que AltPulse (en-tête, panneaux, pied de page, atomes) ;
   ardoise métallique, ambre de forge pour l'aggro, bleu acier pour la mitigation.
   Les styles propres à un composant sont dans son .razor.css.
   ========================================================================== */

:root {
    color-scheme: dark;

    --bg: #0B0E14;
    --bg-2: #111622;
    --panel: rgba(26, 34, 50, 0.84);
    --panel-solid: #1A2232;
    --panel-2: #212B3F;
    --line: #2A364F;
    --line-strong: #3B4B6C;

    --amber: #F59E0B;
    --bronze: #D97706;
    --amber-glow: rgba(245, 158, 11, 0.32);
    --steel: #38BDF8;
    --cobalt: #2563EB;
    --steel-glow: rgba(56, 189, 248, 0.25);

    --text: #E6EAF2;
    --text-dim: #9AA6BD;
    --text-faint: #64718A;
    --danger: #F87171;
    --warn: #FBBF24;

    --radius: 14px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-title: "Cinzel", Georgia, serif;
    --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
}

/* Pied de page collé en bas même sur une page courte : body en colonne, le footer prend le reste (margin-top: auto). */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: #FBBF24; text-decoration: underline; }

h1:focus { outline: none; }

/* --- Fond : ardoise + plaques rivetées ----------------------------------- */
.forge-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(1000px 560px at 12% -10%, rgba(245, 158, 11, 0.13), transparent 60%),
        radial-gradient(900px 640px at 100% 0%, rgba(37, 99, 235, 0.14), transparent 55%),
        radial-gradient(1200px 800px at 50% 120%, rgba(56, 189, 248, 0.06), transparent 60%),
        linear-gradient(180deg, var(--bg-2), var(--bg));
}

.forge-backdrop::after {
    /* motif de plaques d'armure : joints et rivets */
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image:
        radial-gradient(circle at 4px 4px, var(--text-dim) 1.2px, transparent 1.8px),
        linear-gradient(var(--line-strong) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-strong) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, black, transparent 70%);
}

/* --- En-tête ------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: rgba(11, 14, 20, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: none;
    color: var(--text);
}

.brand:hover { text-decoration: none; color: var(--text); }

.brand-sigil {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--amber);
    background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 70%);
    border: 1px solid var(--line-strong);
    box-shadow: 0 0 18px var(--amber-glow);
}

.brand-name {
    font-family: var(--font-title);
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: 0.08em;
    background: linear-gradient(90deg, var(--amber), var(--bronze) 55%, var(--steel));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* « FrontPulse » au-dessus, « by Noovio » juste en dessous, calé à droite */
.brand-wordmark {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.05;
}

.brand-by {
    margin-top: 1px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

.brand-tag {
    color: var(--text-dim);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Navigation des spécialisations : icônes seules, à la couleur de classe, nom au survol */
.spec-nav {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.spec-link {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    padding: 4px;
    border-radius: 11px;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.spec-link:hover, .spec-link:focus-visible { text-decoration: none; transform: translateY(-1px); background: color-mix(in srgb, var(--class-color) 8%, transparent); }
.spec-link:focus-visible { outline: 2px solid var(--class-color); outline-offset: 1px; }
.spec-link.is-active {
    border-color: color-mix(in srgb, var(--class-color) 55%, transparent);
    background: color-mix(in srgb, var(--class-color) 14%, transparent);
}
/* soulignement lumineux de la spécialisation ouverte */
.spec-link.is-active::after {
    content: "";
    position: absolute;
    left: 25%;
    right: 25%;
    bottom: -7px;
    height: 2px;
    border-radius: 2px;
    background: var(--class-color);
    box-shadow: 0 0 10px var(--class-color);
}

.spec-nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--class-color) 70%, black);
    filter: saturate(0.55) brightness(0.85);
    transition: filter 0.15s, box-shadow 0.15s;
}
.spec-link:hover .spec-nav-icon, .spec-link:focus-visible .spec-nav-icon, .spec-link.is-active .spec-nav-icon {
    filter: none;
    box-shadow: 0 0 12px color-mix(in srgb, var(--class-color) 65%, transparent);
}

/* infobulle : spécialisation et classe */
.spec-tip {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid color-mix(in srgb, var(--class-color) 50%, var(--line));
    background: var(--panel-solid);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 16px color-mix(in srgb, var(--class-color) 18%, transparent);
    white-space: nowrap;
    line-height: 1.25;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -4px);
    transition: opacity 0.12s, transform 0.12s;
}
.spec-tip::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--panel-solid);
    border-left: 1px solid color-mix(in srgb, var(--class-color) 50%, var(--line));
    border-top: 1px solid color-mix(in srgb, var(--class-color) 50%, var(--line));
    transform: translateX(-50%) rotate(45deg);
}
.spec-tip strong { font-family: var(--font-title); font-size: 0.95rem; letter-spacing: 0.04em; color: var(--class-color); }
.spec-tip span { font-size: 0.72rem; color: var(--text-dim); }
.spec-link:hover .spec-tip, .spec-link:focus-visible .spec-tip { opacity: 1; transform: translate(-50%, 0); }

/* Prochain rechargement des données */
.next-refresh {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: none;
    padding: 5px 12px 5px 10px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(56, 189, 248, 0.05);
    color: var(--steel);
    cursor: help;
}
.next-refresh-text { display: flex; flex-direction: column; line-height: 1.15; }
.next-refresh .eyebrow { font-size: 0.6rem; }
.next-refresh strong { font-size: 0.85rem; color: var(--text); font-variant-numeric: tabular-nums; }
.next-refresh small { margin-left: 4px; font-weight: 500; color: var(--text-faint); }

.topbar-actions { display: flex; align-items: center; gap: 18px; flex: none; }

/* Connexion : bleu Battle.net, compte connecté : BattleTag */
/* .btn.btn-bnet : déclaré avant .btn dans ce fichier, il doit l'emporter sur son fond transparent */
.btn.btn-bnet {
    height: 36px;
    padding: 0 14px;
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #148EFF, #0062C4);
    box-shadow: 0 0 16px rgba(20, 142, 255, 0.35);
}
.btn.btn-bnet:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 0 24px rgba(20, 142, 255, 0.5); }

.account-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 9px;
    border: 1px solid var(--line);
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}
.account-link:hover { text-decoration: none; color: var(--steel); border-color: var(--steel); }

.shell {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 32px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* --- Pied de page -------------------------------------------------------- */
.footer {
    position: relative;
    margin-top: auto;
    padding: 28px 24px 32px;
    color: var(--text-faint);
    font-size: 0.8rem;
    background: linear-gradient(180deg, transparent, rgba(11, 14, 20, 0.88));
}

/* filet de forge qui s'estompe sur les bords */
.footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), var(--amber), var(--line-strong), transparent);
    box-shadow: 0 0 12px var(--amber-glow);
}

.footer-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
}

.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .brand-sigil { width: 34px; height: 34px; border-radius: 10px; }
.footer-brand .brand-name { font-size: 1.15rem; }
.footer-brand .brand-by { font-size: 0.66rem; }

.app-version {
    align-self: flex-end;
    margin-bottom: 1px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

.footer-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.footer-sources .eyebrow { margin-right: 4px; }

.source {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(245, 158, 11, 0.04);
    color: var(--text-dim);
    font-weight: 600;
    transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.source:hover { text-decoration: none; color: var(--amber); border-color: var(--amber); box-shadow: 0 0 12px var(--amber-glow); }

.source-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
}

/* --- Panneaux et typographie --------------------------------------------- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(230, 234, 242, 0.04);
    /* Pas de backdrop-filter ici : il ferait de chaque panneau le cadre des position: fixed de ses enfants,
       et les fenêtres modales ouvertes depuis un panneau (calculateur de talents) n'en couvriraient que la surface. */
}

.title {
    margin: 0;
    font-family: var(--font-title);
    font-size: 2rem;
    letter-spacing: 0.06em;
    color: var(--amber);
    text-shadow: 0 0 24px var(--amber-glow);
}

.subtitle { margin: 4px 0 18px; color: var(--text-dim); }

.eyebrow {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-faint);
}

.muted { color: var(--text-faint); }

/* --- Boutons ------------------------------------------------------------- */
.btn {
    height: 40px;
    padding: 0 18px;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    color: #1A1204;
    border-color: transparent;
    background: linear-gradient(135deg, var(--amber), var(--bronze));
    box-shadow: 0 0 20px var(--amber-glow);
}

.btn-primary:hover:not(:disabled) { color: #1A1204; transform: translateY(-1px); box-shadow: 0 0 30px var(--amber-glow); }
.btn-ghost:hover:not(:disabled) { background: rgba(56, 189, 248, 0.08); border-color: var(--steel); }

.btn-copy { height: 34px; padding: 0 12px; font-size: 0.85rem; }
.btn-copy.is-copied { color: var(--steel); border-color: var(--steel); background: rgba(56, 189, 248, 0.1); box-shadow: 0 0 14px var(--steel-glow); }

.btn-icon { width: 34px; padding: 0; }

/* Comparer son personnage au top : bleu acier, pour se distinguer de l'ambre des actions de page */
.btn-compare {
    position: relative;
    z-index: 1; /* au-dessus du lien étiré des fiches de l'accueil */
    flex: none;
    color: #fff;
    border-color: rgba(125, 211, 252, 0.45);
    background: linear-gradient(135deg, var(--steel), var(--cobalt));
    box-shadow: 0 0 18px var(--steel-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    white-space: nowrap;
}
.btn-compare:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 0 28px rgba(56, 189, 248, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.btn-compare.is-compact { height: 32px; padding: 0 12px; gap: 6px; font-size: 0.82rem; }
.btn-compare.is-compact .compare-icon { width: 15px; height: 15px; }

.compare-bnet {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: -6px;
    border-radius: 6px;
    background: rgba(11, 14, 20, 0.28);
}
.btn-compare.is-compact .compare-bnet { width: 20px; height: 20px; margin-right: -4px; }

/* Encart « ton tank face au top 100 » */
.compare-callout {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding: 18px 24px;
    overflow: hidden;
    border-color: rgba(56, 189, 248, 0.35);
    background:
        radial-gradient(420px 160px at 0% 50%, color-mix(in srgb, var(--class-color, var(--amber)) 16%, transparent), transparent 70%),
        linear-gradient(100deg, rgba(37, 99, 235, 0.06), rgba(56, 189, 248, 0.14)),
        var(--panel);
}
.compare-callout::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--class-color, var(--amber)), var(--steel));
}

.compare-visual { display: flex; align-items: center; gap: 10px; flex: none; }
.compare-visual .wow-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 2px solid var(--class-color);
    box-shadow: 0 0 16px color-mix(in srgb, var(--class-color) 45%, transparent);
}
.compare-visual-me {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--steel);
    border: 2px solid rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.1);
    box-shadow: 0 0 16px var(--steel-glow);
}
.compare-vs { font-family: var(--font-title); font-weight: 800; font-size: 0.85rem; color: var(--text-faint); }
.compare-visual-top {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
    color: var(--amber);
    border: 2px solid rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.1);
    box-shadow: 0 0 16px var(--amber-glow);
}
.compare-visual-top strong { font-family: var(--font-title); font-size: 1rem; letter-spacing: 0; }

.compare-text { flex: 1 1 320px; min-width: 0; }
.compare-text h2 { margin: 0 0 4px; font-family: var(--font-title); font-size: 1.2rem; letter-spacing: 0.05em; color: var(--text); }
.compare-text p { margin: 0; color: var(--text-dim); }
.compare-hint { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--steel); }

/* Icône WoW : cadre biseauté sombre, comme dans l'interface du jeu */
.wow-icon {
    display: block;
    flex: none;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px rgba(0, 0, 0, 0.5);
    background: var(--panel-2);
    object-fit: cover;
}

/* Badge d'arbre héroïque (icône + nom) */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 3px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--steel);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    white-space: nowrap;
}
.hero-badge img { width: 20px; height: 20px; border-radius: 50%; }
.hero-badge.is-small { font-size: 0.7rem; padding: 1px 8px 1px 2px; }
.hero-badge.is-small img { width: 16px; height: 16px; }

/* --- Couleur de chaque caractéristique secondaire (jauges, accueil) ------ */
.stat-haste { --stat: var(--amber); }
.stat-versatility { --stat: var(--steel); }
.stat-mastery { --stat: #8B5CF6; }
.stat-crit { --stat: #F87171; }

/* --- Verdicts d'analyse (partagés par les composants d'analyse) ---------- */
.verdict-good { --verdict: #34D399; }
.verdict-improve { --verdict: #FBBF24; }
.verdict-problem { --verdict: #F87171; }

/* --- Fenêtre modale ------------------------------------------------------ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(5, 7, 11, 0.78);
    backdrop-filter: blur(4px);
}

.modal {
    width: min(720px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 20px 24px;
    background: var(--panel-solid);
    border-color: var(--line-strong);
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.12);
}

.modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; font-family: var(--font-title); font-size: 1.35rem; letter-spacing: 0.05em; }
.modal-head .close { margin-left: auto; align-self: flex-start; }

/* --- États --------------------------------------------------------------- */
.empty-state { padding: 48px 24px; text-align: center; color: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-state h1, .empty-state h2 { margin: 0; font-family: var(--font-title); color: var(--amber); }

.spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(245, 158, 11, 0.15);
    border-top-color: var(--amber);
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Erreur Blazor ------------------------------------------------------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0.7rem 1.25rem;
    color: var(--text);
    background: #3a1212;
    border-top: 1px solid var(--danger);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* --- Écrans moyens : la navigation prend la place du slogan -------------- */
@media (max-width: 1240px) {
    .brand-tag { display: none; }
}

@media (max-width: 980px) {
    .next-refresh .eyebrow, .next-refresh small { display: none; }
}

/* --- Mobile -------------------------------------------------------------- */
@media (max-width: 720px) {
    .shell { padding: 16px; }
    .topbar { padding: 10px 16px; flex-wrap: wrap; row-gap: 12px; }
    .spec-nav { order: 1; width: 100%; margin-left: 0; justify-content: space-between; }
    .next-refresh { margin-left: auto; }
    .compare-callout { padding: 16px; }
    .compare-callout .btn-compare { width: 100%; }
    .title { font-size: 1.5rem; }
    .footer { padding: 24px 16px 28px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
}
