/* ============================================================
   Spellbook — css/spellbook.css
   Palette Akalavolo :
     Onyx        #373746
     Black Coral #5A5A7A
     Yellow      #F0D351
     White Coffee #E6E0D4
     Dark Charcoal #2E2E2E
   ============================================================ */

/* ── Conteneur principal ── */
.sb-spellbook {
    font-family: 'Open Sans', sans-serif;
    color: #E6E0D4;
    background-color: #2E2E2E;
    border: 1px solid #5A5A7A;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
}

/* ── Header ── */
.sb-spellbook__header {
    background-color: #373746;
    padding: 14px 20px;
    border-bottom: 2px solid #F0D351;
}

.sb-spellbook__title {
    color: #F0D351 !important;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    border-bottom: none !important;
    padding: 0 !important;
}

/* ── Body : 2 colonnes ── */
.sb-spellbook__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

/* ── Colonnes ── */
.sb-col {
    padding: 16px;
}

.sb-col--spec {
    border-right: 1px solid #5A5A7A;
}

/* ── Sections ── */
.sb-section {
    margin-bottom: 20px;
}

.sb-section:last-child {
    margin-bottom: 0;
}

.sb-section__title {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #F0D351 !important;
    border-bottom: 1px solid rgba(240, 211, 81, 0.4) !important;
    padding-bottom: 6px !important;
    margin-bottom: 10px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Compteur de sorts dans le titre */
.sb-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #5A5A7A;
    color: #E6E0D4;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    margin-left: auto;
}

/* Couleur d'accentuation par type de section */
.sb-section--spec-tree  .sb-section__title { color: #EBE36D !important; }
.sb-section--pvp        .sb-section__title { color: #E06C75 !important; }
.sb-section--hero       .sb-section__title { color: #56B6C2 !important; }
.sb-section--class-tree .sb-section__title { color: #ABB2BF !important; }
.sb-section--core       .sb-section__title { color: #888 !important; }

/* ── Liste de sorts ── */
.sb-section__list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Ligne de sort ── */
.sb-spell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.03);
    transition: background-color 0.15s ease;
}

.sb-spell:hover {
    background-color: rgba(240, 211, 81, 0.08);
}

.sb-spell__name {
    color: #E6E0D4 !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-spell__name:hover {
    color: #F0D351 !important;
    text-decoration: underline !important;
}

.sb-spell__badges {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ── Badges ── */
.sb-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    cursor: default;
}

/* Badge CC */
.sb-badge--cc {
    background-color: rgba(224, 108, 117, 0.2);
    color: #E06C75;
    border: 1px solid rgba(224, 108, 117, 0.5);
}

/* Badge Passif */
.sb-badge--passive {
    background-color: rgba(90, 90, 122, 0.3);
    color: #ABB2BF;
    border: 1px solid rgba(90, 90, 122, 0.5);
}

/* Badge École de magie */
.sb-badge--school {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ABB2BF;
}

/* Couleurs par école */
.sb-school--physique  { color: #C0C0C0; border-color: rgba(192,192,192,0.4); }
.sb-school--sacré,
.sb-school--sacre     { color: #F8D860; border-color: rgba(248,216,96,0.4); }
.sb-school--feu       { color: #FF8040; border-color: rgba(255,128,64,0.4); }
.sb-school--nature    { color: #80C040; border-color: rgba(128,192,64,0.4); }
.sb-school--givre     { color: #80E0FF; border-color: rgba(128,224,255,0.4); }
.sb-school--ombre     { color: #C080FF; border-color: rgba(192,128,255,0.4); }
.sb-school--arcane    { color: #FF80FF; border-color: rgba(255,128,255,0.4); }

/* ── Message d'erreur ── */
.sb-error {
    color: #E06C75;
    background-color: rgba(224, 108, 117, 0.1);
    border: 1px solid rgba(224, 108, 117, 0.3);
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sb-spellbook__body {
        grid-template-columns: 1fr;
    }
    .sb-col--spec {
        border-right: none;
        border-bottom: 1px solid #5A5A7A;
    }
    .sb-spell__name {
        white-space: normal;
    }
}
