/* ========================= NOTIFICATIONS =========================
   Cloche du header (menu déroulant) et page « Mes notifications ».
   Couleurs en variables, redéfinies pour le thème sombre en bas de fichier. */

:root {
    --gtl-notif-surface: #ffffff;
    --gtl-notif-text: #252a35;
    --gtl-notif-muted: #737a88;
    --gtl-notif-border: #ece6ee;
    --gtl-notif-hover: #faf5f8;
    --gtl-notif-unseen: #fbeef6;
    --gtl-notif-accent: #a85d94;
    --gtl-notif-accent-strong: #bc70a4;
    --gtl-notif-badge: #e0245e;
    --gtl-notif-shadow: 0 22px 48px -18px rgba(40, 20, 40, .35), 0 4px 12px -6px rgba(0, 0, 0, .12);
}

[data-theme="dark"] {
    --gtl-notif-surface: #221d2c;
    --gtl-notif-text: #f0eafc;
    --gtl-notif-muted: #b9b0cc;
    --gtl-notif-border: rgba(255, 255, 255, .12);
    --gtl-notif-hover: rgba(255, 255, 255, .05);
    --gtl-notif-unseen: rgba(188, 112, 164, .16);
    --gtl-notif-accent: #f0b6dc;
    --gtl-notif-accent-strong: #d48cbd;
    --gtl-notif-shadow: 0 22px 48px -18px rgba(0, 0, 0, .7);
}

/* ---------- Cloche ---------- */
.gtl-bell {
    position: relative;
    display: inline-flex;
}

.gtl-bell__button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .78);
    color: var(--gtl-notif-accent);
    font-size: 1.05rem;
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .25);
    transition: transform .15s ease, background .15s ease;
}

.gtl-bell__button:hover,
.gtl-bell__button.is-open {
    background: #fff;
    transform: translateY(-1px);
}

.gtl-bell__button:focus-visible {
    outline: 3px solid rgba(188, 112, 164, .5);
    outline-offset: 2px;
}

.gtl-bell__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
    color: #fff;
    background: var(--gtl-notif-badge);
    border: 2px solid #fff;
    animation: gtl-bell-pop .35s ease-out 1;
}

@keyframes gtl-bell-pop {
    0% { transform: scale(.4); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.gtl-bell__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
}

.gtl-bell__backdrop {
    z-index: 1055;
}

/* Rendu par le layout, hors du header (qui rogne son contenu) ; top/left/width sont posés en
   ligne à l'ouverture d'après la position de la cloche. Valeurs ci-dessous = repli. */
.gtl-bell__panel {
    position: absolute;
    top: 80px;
    right: 16px;
    z-index: 1060;
    width: min(380px, calc(100vw - 32px));
    max-height: min(560px, 75vh);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: var(--gtl-notif-surface);
    color: var(--gtl-notif-text);
    border: 1px solid var(--gtl-notif-border);
    box-shadow: var(--gtl-notif-shadow);
    overflow: hidden;
    text-align: left;
}

.gtl-bell__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px 10px 16px;
    font-size: 1.05rem;
    font-weight: 800;
}

.gtl-bell__list {
    overflow-y: auto;
    padding: 0 6px 6px;
}

.gtl-bell__all {
    display: block;
    padding: 11px 16px;
    font-size: .85rem;
    font-weight: 700;
    text-align: center;
    color: var(--gtl-notif-accent);
    text-decoration: none;
    border-top: 1px solid var(--gtl-notif-border);
}

.gtl-bell__all:hover {
    background: var(--gtl-notif-hover);
    color: var(--gtl-notif-accent);
}

.gtl-bell__empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--gtl-notif-muted);
}

.gtl-bell__empty > i {
    font-size: 1.8rem;
    color: var(--gtl-notif-accent-strong);
    opacity: .8;
    margin-bottom: 8px;
}

.gtl-bell__empty-title {
    margin: 0 0 4px;
    font-weight: 800;
    color: var(--gtl-notif-text);
}

.gtl-bell__empty-text {
    margin: 0;
    font-size: .88rem;
}

/* ---------- Ligne de notification ---------- */
.gtl-notif {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 28px 10px 10px;
    border-radius: 12px;
    color: var(--gtl-notif-text);
    text-decoration: none;
    transition: background .15s ease;
}

.gtl-notif:hover {
    background: var(--gtl-notif-hover);
    color: var(--gtl-notif-text);
}

.gtl-notif.is-unseen {
    background: var(--gtl-notif-unseen);
}

.gtl-notif__avatars {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 48px;
}

.gtl-notif__avatar {
    position: absolute;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gtl-notif-surface);
    background: #eee;
}

.gtl-notif__avatar--0 { top: 0; left: 0; z-index: 2; }

/* Deux personnes : la plus ancienne en haut à gauche, la plus récente devant, en bas à droite. */
.gtl-notif__avatars.has-two .gtl-notif__avatar { width: 34px; height: 34px; }
.gtl-notif__avatars.has-two .gtl-notif__avatar--1 { top: 0; left: 0; z-index: 1; }
.gtl-notif__avatars.has-two .gtl-notif__avatar--0 { top: 14px; left: 16px; z-index: 2; }

.gtl-notif__avatar img,
.gtl-notif__initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    color: #fff;
    font-size: .74rem;
    font-weight: 800;
}

.gtl-notif__kind {
    position: absolute;
    right: -7px;
    bottom: -5px;
    z-index: 3;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .58rem;
    color: #fff;
    border: 2px solid var(--gtl-notif-surface);
}

.gtl-notif__kind--useful { background: linear-gradient(135deg, #e07bb5, #a85d94); }
.gtl-notif__kind--reply { background: linear-gradient(135deg, #4fb3e8, #2b7fc4); }

.gtl-notif__body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gtl-notif__text {
    font-size: .9rem;
    line-height: 1.35;
}

.gtl-notif__text strong {
    font-weight: 800;
}

.gtl-notif__excerpt {
    font-size: .82rem;
    color: var(--gtl-notif-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gtl-notif__time {
    font-size: .76rem;
    font-weight: 700;
    color: var(--gtl-notif-muted);
}

.gtl-notif.is-unseen .gtl-notif__time {
    color: var(--gtl-notif-accent);
}

.gtl-notif__dot {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--gtl-notif-accent-strong);
}

/* ---------- Page « Mes notifications » ---------- */
.gtl-notif-page {
    max-width: 680px;
    margin: 24px auto 48px;
    padding: 0 16px;
}

.gtl-notif-page__title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 4px;
}

.gtl-notif-page__title i {
    color: var(--gtl-notif-accent-strong);
}

.gtl-notif-page__subtitle {
    color: var(--gtl-notif-muted);
    margin: 0 0 18px;
}

.gtl-notif-page__card {
    padding: 8px;
    border-radius: 18px;
    background: var(--gtl-notif-surface);
    border: 1px solid var(--gtl-notif-border);
    box-shadow: 0 14px 30px -24px rgba(0, 0, 0, .35);
}

.gtl-bell__close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--gtl-notif-muted);
}

.gtl-bell__close:hover {
    background: var(--gtl-notif-hover);
    color: var(--gtl-notif-text);
}
