/* ============================================================
   notification-modal.css — Refonte moderne (style app.css)
   Accent marque #ff385c, cartes blanches, ombres douces, Inter.
   ============================================================ */

/* ---------- Overlay ---------- */
.notification-modal {
    display: none;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(100dvh - 60px);
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: saturate(140%) blur(4px);
    backdrop-filter: saturate(140%) blur(4px);
    z-index: 10000;
    animation: notifFadeIn 0.25s ease-out;
}

/* ---------- Conteneur (commun) ---------- */
.notification-modal-content {
    position: absolute;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.notification-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: #f4f5f7;
    color: #6b7280;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification-panel-close:hover {
    background: #ffe4ea;
    color: #ff385c;
}

/* Petite poignée de tiroir (mobile) */
.notification-modal-content::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #e2e5eb;
    z-index: 3;
}

@keyframes notifSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@keyframes notifSlideFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notifFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Header ---------- */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 14px 46px 10px 14px;
    border-bottom: 1px solid #f0f1f4;
    background: #ffffff;
}

.notification-header h3 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1f2430;
}

.notification-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn-mark-all {
    background: #fff1f4;
    color: #e11d48;
    border: 1px solid #ffd7e0;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-mark-all:hover {
    background: #ff385c;
    border-color: #ff385c;
    color: #ffffff;
    transform: translateY(-1px);
}

.notification-item .notification-actions {
    margin-left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.btn-mark-read,
.btn-dismiss-notification {
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    padding: 0;
}

.btn-mark-read {
    color: #ff385c;
}

.btn-dismiss-notification {
    color: #9ca3af;
}

.btn-mark-read:hover {
    background: #ffe4ea;
}

.btn-dismiss-notification:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* ---------- Corps ---------- */
.notification-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
}

.notifications-list {
    padding: 0;
}

/* ---------- Item ---------- */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin: 2px 6px;
    border-radius: 14px;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.notification-item:hover {
    background: #f7f7f8;
}

.notification-item.unread {
    background: #fff5f7;
}

.notification-item.unread::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 999px;
    background: #ff385c;
}

.notification-item.unread:hover {
    background: #ffeef2;
}

.notification-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f0f1f4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-icon i {
    color: #6b7280;
    font-size: 14px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 700;
    color: #1f2430;
    margin-bottom: 2px;
    font-size: 0.8125rem;
    letter-spacing: -0.01em;
}

.notification-message {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.35;
    margin-bottom: 4px;
}

.notification-time {
    color: #9ca3af;
    font-size: 0.6875rem;
    font-weight: 500;
}

/* legacy — conservé si référencé ailleurs */
.btn-close {
    background: #f4f5f7;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-close:hover {
    background: #ffe4ea;
    color: #ff385c;
}

/* ---------- Loading ---------- */
.notifications-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #6b7280;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #ffe4ea;
    border-top-color: #ff385c;
    border-radius: 50%;
    animation: notifSpin 0.9s linear infinite;
    margin-bottom: 14px;
}

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

/* ---------- État vide ---------- */
.no-notifications {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: #9ca3af;
    padding: 20px;
}

.empty-state {
    text-align: center;
    max-width: 280px;
}

.empty-state i {
    font-size: 1.25rem;
    color: #ff385c;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff1f4;
    opacity: 1;
}

.empty-state p {
    margin: 0 0 4px 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1f2430;
}

.empty-state small {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
}

/* ---------- Charger plus ---------- */
.load-more-container {
    padding: 16px 18px 22px;
    text-align: center;
}

.btn-load-more {
    background: #ffffff;
    border: 1px solid #ececf0;
    color: #1f2430;
    font-weight: 600;
    padding: 11px 22px;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-load-more:hover {
    border-color: #ff385c;
    color: #ff385c;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
}

/* ---------- Desktop : panneau depuis le haut (sous la nav), à droite ---------- */
@media (min-width: 769px) {
    .notification-modal {
        top: var(--nav-h, 68px);
        height: calc(100dvh - var(--nav-h, 68px));
        background: rgba(15, 23, 42, 0.28);
        align-items: flex-start;
        justify-content: flex-end;
    }

    .notification-modal-content {
        position: absolute;
        top: 12px;
        right: 18px;
        bottom: auto;
        left: auto;
        width: 400px;
        max-width: calc(100vw - 36px);
        height: auto;
        max-height: min(640px, calc(100dvh - var(--nav-h, 68px) - 28px));
        border-radius: 20px;
        box-shadow: 0 20px 50px rgba(16, 24, 40, 0.22);
        animation: notifSlideFromTop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        transform-origin: top right;
    }

    .notification-modal-content::before {
        display: none;
    }

    .notification-header {
        padding: 12px 44px 10px 12px;
        border-radius: 20px 20px 0 0;
    }
}

/* ---------- Mobile : panneau sous le bouton cloche (comme desktop) ---------- */
@media (max-width: 768px) {
    .notification-modal {
        top: var(--nav-h, 60px);
        height: calc(100dvh - var(--nav-h, 60px));
        background: rgba(15, 23, 42, 0.28);
    }

    .notification-modal-content {
        position: absolute;
        top: 8px;
        right: 12px;
        bottom: auto;
        left: auto;
        width: min(360px, calc(100vw - 24px));
        height: auto;
        max-height: min(520px, calc(100dvh - var(--nav-h, 60px) - 20px));
        border-radius: 20px;
        box-shadow: 0 20px 50px rgba(16, 24, 40, 0.22);
        animation: notifSlideFromTop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        transform-origin: top right;
    }

    .notification-modal-content.is-positioned {
        top: var(--notif-panel-top, 8px);
        right: var(--notif-panel-right, 12px);
    }

    .notification-modal-content::before {
        display: none;
    }

    .notification-header {
        padding: 12px 42px 10px 12px;
        border-radius: 20px 20px 0 0;
    }

    .btn-mark-all__label {
        display: none;
    }

    .notification-item {
        padding: 10px 11px;
        margin: 2px 5px;
    }

    .notification-item-icon {
        width: 32px;
        height: 32px;
    }
}

/* ---------- Types de notifications (icônes colorées harmonisées) ---------- */
.notification-item[data-type="message"] .notification-item-icon { background: #e8effd; }
.notification-item[data-type="message"] .notification-item-icon i { color: #2563eb; }

.notification-item[data-type="like"] .notification-item-icon { background: #ffe4ea; }
.notification-item[data-type="like"] .notification-item-icon i { color: #ff385c; }

.notification-item[data-type="match"] .notification-item-icon { background: #e6f6ee; }
.notification-item[data-type="match"] .notification-item-icon i { color: #10b981; }

.notification-item[data-type="system"] .notification-item-icon { background: #fef3e2; }
.notification-item[data-type="system"] .notification-item-icon i { color: #f59e0b; }

.notification-item[data-type="advertisement_response"] .notification-item-icon { background: #ecedfb; }
.notification-item[data-type="advertisement_response"] .notification-item-icon i { color: #6366f1; }

.notification-item[data-type="advertisement_participation"] .notification-item-icon { background: #f5e9fb; }
.notification-item[data-type="advertisement_participation"] .notification-item-icon i { color: #a855f7; }

.notification-item[data-type="favorite_place_advertisement"] .notification-item-icon { background: #e3f4f1; }
.notification-item[data-type="favorite_place_advertisement"] .notification-item-icon i { color: #0d9488; }

html[data-theme="dark"] .notification-panel-close {
    background: var(--surface-2, #161616);
    color: var(--text-muted, #a3a3a3);
}

html[data-theme="dark"] .notification-panel-close:hover {
    background: rgba(255, 56, 92, 0.18);
    color: #ff385c;
}

html[data-theme="dark"] .btn-dismiss-notification:hover {
    background: var(--surface-2, #161616);
    color: var(--text, #f5f5f5);
}

/* ---------- Prompt activation push (bannière compacte, alignée PWA) ---------- */
.spiitz-push-prompt {
    position: fixed;
    z-index: 12050;
    left: 50%;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #ececf0);
    border-radius: var(--r-md, 14px);
    box-shadow: var(--shadow-lg, 0 10px 32px rgba(17, 24, 39, 0.18));
    animation: notifFadeIn 0.25s ease-out;
}

.spiitz-push-prompt__close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

.spiitz-push-prompt__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-soft, #fff1f4);
    color: var(--brand, #ff385c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.spiitz-push-prompt__content {
    min-width: 0;
    flex: 1 1 auto;
    padding-right: 14px;
}

.spiitz-push-prompt__title {
    font-weight: 700;
    font-size: 0.8125rem;
    line-height: 1.25;
    color: var(--text, #1f2430);
}

.spiitz-push-prompt__text {
    color: var(--text-soft, #6b7280);
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 2px;
}

.spiitz-push-prompt__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.spiitz-push-btn {
    border: 0;
    border-radius: var(--r-pill, 999px);
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.spiitz-push-btn.primary {
    background: var(--brand, #ff385c);
    color: #fff;
}

.spiitz-push-btn.secondary {
    background: transparent;
    color: var(--text-muted, #9ca3af);
    padding: 4px 8px;
    font-size: 0.6875rem;
}

.spiitz-push-toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(12px);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #111827;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    z-index: 100000;
    opacity: 0;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 92vw;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.spiitz-push-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.spiitz-push-toast.success { background: linear-gradient(135deg, #16a34a, #15803d); }
.spiitz-push-toast.error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.spiitz-push-toast.info { background: linear-gradient(135deg, #ff385c, #e11d48); }

.spiitz-push-toast-icon { font-size: 0.875rem; line-height: 1; }
.spiitz-push-toast-text { line-height: 1.35; }

@media (min-width: 769px) {
    .spiitz-push-prompt {
        bottom: 24px;
        right: 24px;
        left: auto;
        transform: none;
    }
}
