/* ════════════════════════════════════════════════════════════════════════════
   educated-alerts-panel.css — V5 Option B
   Fichier : Educated.Blazor.Server/wwwroot/css/educated-alerts-panel.css

   Dépendances :
     - design-tokens.css  (--brand, --accent, --gradient-brand, etc.)
     - Chargé après educated-shell.css dans _Host.cshtml
   ════════════════════════════════════════════════════════════════════════════ */


/* ── Hôte — remplit la cellule du Dashboard ─────────────────────────────── */
.educated-alerts-host {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    box-sizing: border-box;
}


/* ── Panneau ─────────────────────────────────────────────────────────────── */
.ap-panel {
    flex: 1;
    background: #ffffff;
    border: 1px solid rgba(62, 62, 144, .10);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(62, 62, 144, .07);
    min-width: 0;
}


/* ════════════════════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════════════════════ */
.ap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(62, 62, 144, .08);
    flex-shrink: 0;
    gap: 8px;
}

.ap-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--text-muted, #9490B8);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-voir-tout {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand, #3E3E90);
    padding: 0;
    flex-shrink: 0;
    font-family: inherit;
    line-height: 1;
    transition: color .15s ease;
}

    .ap-voir-tout:hover {
        color: var(--accent, #7B6FC0);
    }

    .ap-voir-tout:active {
        opacity: .75;
    }

    .ap-voir-tout:focus-visible {
        outline: 2px solid var(--brand, #3E3E90);
        outline-offset: 3px;
        border-radius: 4px;
    }


/* ════════════════════════════════════════════════════════════════════════════
   LISTE
   ════════════════════════════════════════════════════════════════════════════ */
.ap-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Scrollbar fine — même style que les autres panels V5 */
    scrollbar-width: thin;
    scrollbar-color: rgba(62, 62, 144, .15) transparent;
}

    .ap-list::-webkit-scrollbar {
        width: 3px;
    }

    .ap-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .ap-list::-webkit-scrollbar-thumb {
        background: rgba(62, 62, 144, .15);
        border-radius: 2px;
    }

        .ap-list::-webkit-scrollbar-thumb:hover {
            background: rgba(62, 62, 144, .28);
        }


/* ════════════════════════════════════════════════════════════════════════════
   ITEM
   ════════════════════════════════════════════════════════════════════════════ */
.ap-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(62, 62, 144, .06);
    transition: background .13s ease;
    user-select: none;
    outline: none;
    /* Empêche le texte de déborder */
    min-width: 0;
}

    .ap-item:last-child {
        border-bottom: none;
    }

    .ap-item:hover {
        background: rgba(62, 62, 144, .04);
    }

    .ap-item:active {
        background: rgba(62, 62, 144, .09);
    }

    .ap-item:focus-visible {
        box-shadow: inset 0 0 0 2px rgba(62, 62, 144, .28);
        background: rgba(62, 62, 144, .04);
    }

/* Item avec count = 0 — grisé, non-interactif */
.ap-item--zero {
    opacity: .38;
    cursor: default;
    pointer-events: none;
}


/* ════════════════════════════════════════════════════════════════════════════
   AVATAR
   ════════════════════════════════════════════════════════════════════════════ */
.ap-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    flex-shrink: 0;
    /* color et background injectés inline par le JS (palette ou valeur BDD) */
}


/* ════════════════════════════════════════════════════════════════════════════
   BODY — libellé + sous-libellé
   ════════════════════════════════════════════════════════════════════════════ */
.ap-item-body {
    flex: 1;
    min-width: 0; /* autorise le text-overflow sur les enfants */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ap-item-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1a1740);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ap-item-sub {
    font-size: 11px;
    color: var(--text-muted, #9490B8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}


/* ════════════════════════════════════════════════════════════════════════════
   DROITE — compteur + chevron
   ════════════════════════════════════════════════════════════════════════════ */
.ap-item-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ap-count {
    font-size: 15px;
    font-weight: 700;
    min-width: 18px;
    text-align: right;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    /* color injecté inline par le JS */
}

.ap-chevron {
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted, #B5B2D0);
    margin-top: -1px;
}


/* ════════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════════════════════════════════════ */
.ap-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-muted, #B5B2D0);
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
}

    .ap-empty svg {
        opacity: .7;
        flex-shrink: 0;
    }


/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — si la cellule Dashboard est étroite (< 260px)
   ════════════════════════════════════════════════════════════════════════════ */
@container (max-width: 260px) {
    .ap-header {
        padding: 12px 12px 10px;
    }

    .ap-item {
        padding: 9px 12px;
        gap: 9px;
    }

    .ap-avatar {
        width: 30px;
        height: 30px;
        border-radius: 7px;
        font-size: 10px;
    }

    .ap-count {
        font-size: 13px;
    }

    .ap-chevron {
        font-size: 15px;
    }
}

/* Fallback si @container non supporté */
.educated-alerts-host.ap-narrow .ap-header {
    padding: 12px 12px 10px;
}

.educated-alerts-host.ap-narrow .ap-item {
    padding: 9px 12px;
    gap: 9px;
}

.educated-alerts-host.ap-narrow .ap-avatar {
    width: 30px;
    height: 30px;
}
