/* =========================================================
   ALPHÉA SUITE — CENTRE DE NOTIFICATIONS PREMIUM
   ========================================================= */

.alphea-notification-menu {
    position: relative;
    flex: 0 0 auto;
}

body.alphea-v2 .alphea-notification-toggle {
    position: relative;
    overflow: visible;
}

.alphea-notification-bell {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    color: #1e3a5f;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    transform: rotate(45deg);
}

.alphea-notification-menu.is-open
.alphea-notification-toggle {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .08) !important;
}

.alphea-notification-count {
    position: absolute;
    top: -5px;
    right: -6px;
    display: grid;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .35);
}

.alphea-notification-count.is-urgent {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, .38);
    animation: alpheaNotificationPulse 2.6s ease-in-out infinite;
}

@keyframes alpheaNotificationPulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.11);
    }
}

.alphea-notification-panel {
    position: absolute;
    top: calc(100% + 13px);
    right: -72px;
    z-index: 100100;
    width: min(410px, calc(100vw - 30px));
    overflow: hidden;
    border: 1px solid #dbe4ef;
    border-radius: 22px;
    background:
        linear-gradient(
            180deg,
            rgba(248, 251, 255, .98),
            rgba(255, 255, 255, .99) 140px
        );
    box-shadow:
        0 34px 90px rgba(15, 23, 42, .22),
        0 10px 30px rgba(15, 23, 42, .10);
    opacity: 0;
    transform: translateY(-7px) scale(.985);
    transform-origin: top right;
    transition:
        opacity 150ms ease,
        transform 150ms ease;
    backdrop-filter: blur(20px);
}

.alphea-notification-panel[hidden] {
    display: none !important;
}

.alphea-notification-panel.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.alphea-notification-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e8edf4;
}

.alphea-notification-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #2563eb;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.alphea-notification-header h2 {
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    letter-spacing: -.025em;
}

.alphea-notification-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
}

.alphea-notification-close {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #dce5ef;
    border-radius: 11px;
    background: rgba(255, 255, 255, .85);
    color: #64748b;
    font-size: 21px;
    cursor: pointer;
    transition:
        background 130ms ease,
        color 130ms ease,
        transform 130ms ease;
}

.alphea-notification-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: rotate(4deg);
}

.alphea-notification-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f5;
    background: rgba(248, 250, 252, .75);
}

.alphea-notification-summary > div,
.alphea-notification-summary > a {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 9px 10px;
    border: 1px solid #e5ebf2;
    border-radius: 13px;
    background: #fff;
    text-decoration: none;
}

.alphea-notification-summary strong {
    color: #0f172a;
    font-size: 16px;
    font-weight: 950;
}

.alphea-notification-summary span {
    color: #7c8a9d;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.alphea-notification-summary .is-danger strong {
    color: #dc2626;
}

.alphea-notification-list {
    max-height: min(530px, calc(100vh - 270px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.alphea-notification-item {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    min-height: 73px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 15px;
    color: #0f172a;
    text-decoration: none;
    transition:
        border-color 130ms ease,
        background 130ms ease,
        transform 130ms ease,
        box-shadow 130ms ease;
}

.alphea-notification-item + .alphea-notification-item {
    margin-top: 3px;
}

.alphea-notification-item:hover,
.alphea-notification-item:focus {
    z-index: 2;
    outline: none;
    transform: translateX(-2px);
    border-color: #dbeafe;
    background: #f8fbff;
    box-shadow: 0 8px 22px rgba(30, 64, 175, .07);
}

.alphea-notification-item-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 16px;
    font-weight: 950;
}

.alphea-notification-item.is-warning
.alphea-notification-item-icon {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.alphea-notification-item.is-urgent
.alphea-notification-item-icon {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.alphea-notification-item-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.alphea-notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.alphea-notification-meta strong {
    overflow: hidden;
    color: #2563eb !important;
    font-size: 9px !important;
    font-weight: 950 !important;
    letter-spacing: .065em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.alphea-notification-item.is-warning
.alphea-notification-meta strong {
    color: #c2410c !important;
}

.alphea-notification-item.is-urgent
.alphea-notification-meta strong {
    color: #dc2626 !important;
}

.alphea-notification-meta em {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
}

.alphea-notification-item.is-urgent
.alphea-notification-meta em {
    color: #dc2626;
}

.alphea-notification-title {
    display: -webkit-box;
    overflow: hidden;
    color: #18243b;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.alphea-notification-item-copy small {
    overflow: hidden;
    color: #718096;
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alphea-notification-arrow {
    color: #b4bfcd;
    font-size: 22px;
    transition:
        color 130ms ease,
        transform 130ms ease;
}

.alphea-notification-item:hover
.alphea-notification-arrow {
    color: #2563eb;
    transform: translateX(2px);
}

.alphea-notification-empty {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px;
    text-align: center;
}

.alphea-notification-empty > span {
    display: grid;
    width: 62px;
    height: 62px;
    margin-bottom: 15px;
    place-items: center;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 25px;
    font-weight: 950;
    box-shadow: 0 12px 28px rgba(22, 163, 74, .10);
}

.alphea-notification-empty strong {
    color: #0f172a;
    font-size: 15px;
}

.alphea-notification-empty p {
    max-width: 260px;
    margin: 7px 0 0;
    color: #64748b;
    font-size: 11px;
    line-height: 1.55;
}

.alphea-notification-footer {
    padding: 11px;
    border-top: 1px solid #e8edf4;
    background: #fafcff;
}

.alphea-notification-footer a {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    background: #eff6ff;
    text-decoration: none;
    transition:
        background 130ms ease,
        border-color 130ms ease;
}

.alphea-notification-footer a:hover {
    border-color: #bfdbfe;
    background: #eaf2ff;
}

.alphea-notification-footer a > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.alphea-notification-footer strong {
    color: #1d4ed8 !important;
    font-size: 11px !important;
}

.alphea-notification-footer small {
    color: #64748b;
    font-size: 9px;
}

.alphea-notification-footer em {
    color: #2563eb;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
}

/* MODE SOMBRE */

html[data-alphea-theme="dark"]
.alphea-notification-panel {
    border-color: #2b3b52;
    background:
        linear-gradient(
            180deg,
            rgba(20, 32, 52, .99),
            rgba(14, 24, 40, .99) 150px
        );
}

html[data-alphea-theme="dark"]
.alphea-notification-header,
html[data-alphea-theme="dark"]
.alphea-notification-summary,
html[data-alphea-theme="dark"]
.alphea-notification-footer {
    border-color: #27374d;
}

html[data-alphea-theme="dark"]
.alphea-notification-header h2,
html[data-alphea-theme="dark"]
.alphea-notification-title,
html[data-alphea-theme="dark"]
.alphea-notification-summary strong,
html[data-alphea-theme="dark"]
.alphea-notification-empty strong {
    color: #f1f5f9 !important;
}

html[data-alphea-theme="dark"]
.alphea-notification-summary {
    background: rgba(8, 15, 27, .25);
}

html[data-alphea-theme="dark"]
.alphea-notification-summary > div,
html[data-alphea-theme="dark"]
.alphea-notification-summary > a {
    border-color: #2b3b52;
    background: #152238;
}

html[data-alphea-theme="dark"]
.alphea-notification-item:hover {
    border-color: #34527c;
    background: rgba(37, 99, 235, .10);
}

html[data-alphea-theme="dark"]
.alphea-notification-item-copy small,
html[data-alphea-theme="dark"]
.alphea-notification-header p {
    color: #91a0b5;
}

html[data-alphea-theme="dark"]
.alphea-notification-footer {
    background: #0e1828;
}

html[data-alphea-theme="dark"]
.alphea-notification-footer a {
    border-color: #31517a;
    background: rgba(37, 99, 235, .13);
}

/* RESPONSIVE */

@media (max-width: 760px) {
    .alphea-notification-panel {
        position: fixed;
        top: 72px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 86px);
    }

    .alphea-notification-list {
        max-height: calc(100vh - 330px);
    }
}

/* =========================================================
   CORRECTION ICONE NOTIFICATION — IMMOBILE ET PREMIUM
   ========================================================= */

.alphea-notification-toggle {
    position: relative !important;
    display: grid !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    place-items: center !important;
    overflow: visible !important;
    transform: none !important;
    transition:
        background-color 140ms ease,
        border-color 140ms ease,
        box-shadow 140ms ease !important;
}

.alphea-notification-toggle:hover,
.alphea-notification-toggle:focus,
.alphea-notification-toggle:active {
    transform: none !important;
}

.alphea-notification-bell {
    display: grid !important;
    width: 22px !important;
    height: 22px !important;
    place-items: center !important;
    color: #334155 !important;
    line-height: 1 !important;
    transform: none !important;
    transition: color 140ms ease !important;
    pointer-events: none;
}

.alphea-notification-bell svg {
    display: block;
    width: 21px;
    height: 21px;
    overflow: visible;
    transform: none !important;
}

.alphea-notification-menu.is-open
.alphea-notification-toggle {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .07) !important;
    transform: none !important;
}

.alphea-notification-menu.is-open
.alphea-notification-bell {
    color: #2563eb !important;
    transform: none !important;
}

.alphea-notification-count {
    top: -5px !important;
    right: -6px !important;
    transform: none !important;
}

.alphea-notification-count.is-urgent {
    animation: none !important;
}

.alphea-notification-panel {
    transform: translateY(7px) scale(.992) !important;
    transition:
        opacity 150ms ease,
        transform 150ms ease !important;
}

.alphea-notification-panel.is-visible {
    transform: translateY(0) scale(1) !important;
}

html[data-alphea-theme="dark"]
.alphea-notification-bell {
    color: #cbd5e1 !important;
}

html[data-alphea-theme="dark"]
.alphea-notification-menu.is-open
.alphea-notification-bell {
    color: #60a5fa !important;
}

@media (prefers-reduced-motion: reduce) {
    .alphea-notification-toggle,
    .alphea-notification-bell,
    .alphea-notification-bell svg,
    .alphea-notification-panel,
    .alphea-notification-count {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* =========================================================
   ALPHÉA — CORRECTION DU DÉCALAGE LIÉ À LA BARRE DE DÉFILEMENT
   ========================================================= */

/*
 * Réserve en permanence la largeur de la barre verticale.
 * L'apparition d'un contenu plus haut ne décale donc plus la topbar.
 */
html {
    scrollbar-gutter: stable;
}

/*
 * Le panneau reste strictement contenu dans la fenêtre.
 * Il ne doit jamais augmenter la hauteur du document principal.
 */
.alphea-notification-panel {
    display: flex;
    max-height: calc(100dvh - 92px) !important;
    flex-direction: column;
    overflow: hidden !important;
    contain: layout paint;
    overscroll-behavior: contain;
}

.alphea-notification-panel[hidden] {
    display: none !important;
}

/*
 * Les parties haute et basse du panneau restent fixes.
 */
.alphea-notification-header,
.alphea-notification-summary,
.alphea-notification-footer {
    flex: 0 0 auto;
}

/*
 * Seule la liste centrale peut défiler.
 */
.alphea-notification-list {
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

/*
 * Empêche les longues descriptions d'élargir ou de déformer le panneau.
 */
.alphea-notification-item,
.alphea-notification-item-copy,
.alphea-notification-title,
.alphea-notification-item-copy small {
    min-width: 0;
}

/*
 * Scrollbar interne discrète et Premium.
 */
.alphea-notification-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .65) transparent;
}

.alphea-notification-list::-webkit-scrollbar {
    width: 6px;
}

.alphea-notification-list::-webkit-scrollbar-track {
    background: transparent;
}

.alphea-notification-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, .55);
}

.alphea-notification-list::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, .72);
}

/*
 * La cloche et le reste de la topbar ne doivent jamais être recalculés
 * ou déplacés lors de l'ouverture du panneau.
 */
.alphea-topbar,
.alphea-topbar-right,
.alphea-notification-menu,
.alphea-notification-toggle,
.alphea-notification-bell {
    flex-shrink: 0;
}

.alphea-notification-toggle,
.alphea-notification-toggle:hover,
.alphea-notification-toggle:focus,
.alphea-notification-toggle:active,
.alphea-notification-menu.is-open
.alphea-notification-toggle {
    translate: none !important;
    transform: none !important;
}

/*
 * Mobile : panneau fixé dans la fenêtre avec défilement interne.
 */
@media (max-width: 760px) {
    .alphea-notification-panel {
        top: 70px !important;
        right: 10px !important;
        bottom: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-height: none !important;
    }

    .alphea-notification-list {
        min-height: 0 !important;
        max-height: none !important;
    }
}
