/**
 * notifications.css
 * Styles pour le système de notifications in-app (badges, bannières, toasts)
 * Architecture: Material Design avec animations fluides
 */

/* ============================================
   Variables globales
   ============================================ */
:root {
    --notif-info: #3b82f6;
    --notif-info-bg: #dbeafe;
    --notif-info-border: #93c5fd;

    --notif-success: #10b981;
    --notif-success-bg: #d1fae5;
    --notif-success-border: #6ee7b7;

    --notif-warning: #f59e0b;
    --notif-warning-bg: #fef3c7;
    --notif-warning-border: #fcd34d;

    --notif-error: #ef4444;
    --notif-error-bg: #fee2e2;
    --notif-error-border: #fca5a5;

    --notif-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --notif-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.2);
    --notif-radius: 8px;
    --notif-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BADGES (notifications persistantes)
   ============================================ */
.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: badge-appear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.notification-badge .material-symbols-outlined {
    font-size: 14px;
    font-weight: 700;
}

/* Couleurs badges */
.notification-badge.badge-orange {
    background: var(--notif-warning);
}

.notification-badge.badge-red {
    background: var(--notif-error);
}

.notification-badge.badge-blue {
    background: var(--notif-info);
}

.notification-badge.badge-green {
    background: var(--notif-success);
}

/* Animation apparition badge */
@keyframes badge-appear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   BANNIÈRES (notifications contextuelles)
   ============================================ */
.notification-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: var(--notif-radius);
    border-left: 4px solid;
    box-shadow: var(--notif-shadow);
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--notif-transition);
    will-change: transform, opacity;
}

.notification-banner.banner-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Types bannières */
.notification-banner.banner-info {
    background: var(--notif-info-bg);
    border-color: var(--notif-info);
}

.notification-banner.banner-success {
    background: var(--notif-success-bg);
    border-color: var(--notif-success);
}

.notification-banner.banner-warning {
    background: var(--notif-warning-bg);
    border-color: var(--notif-warning);
}

.notification-banner.banner-error {
    background: var(--notif-error-bg);
    border-color: var(--notif-error);
}

/* Icône bannière */
.banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

.banner-icon .material-symbols-outlined {
    font-size: 24px;
}

.banner-info .banner-icon .material-symbols-outlined {
    color: var(--notif-info);
}

.banner-success .banner-icon .material-symbols-outlined {
    color: var(--notif-success);
}

.banner-warning .banner-icon .material-symbols-outlined {
    color: var(--notif-warning);
}

.banner-error .banner-icon .material-symbols-outlined {
    color: var(--notif-error);
}

/* Contenu bannière */
.banner-content {
    flex: 1;
    min-width: 0;
}

.banner-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2937;
}

.banner-message {
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

/* Bouton CTA bannière */
.banner-cta {
    flex-shrink: 0;
    padding: 8px 16px;
    background: white;
    border: 2px solid currentColor;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--notif-transition);
}

.banner-info .banner-cta {
    color: var(--notif-info);
}

.banner-success .banner-cta {
    color: var(--notif-success);
}

.banner-warning .banner-cta {
    color: var(--notif-warning);
}

.banner-error .banner-cta {
    color: var(--notif-error);
}

.banner-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Bouton fermer bannière */
.banner-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    transition: var(--notif-transition);
}

.banner-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1f2937;
}

.banner-close .material-symbols-outlined {
    font-size: 20px;
}

/* ============================================
   TOASTS (notifications temporaires)
   ============================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.notification-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: white;
    border-radius: var(--notif-radius);
    border-left: 4px solid;
    box-shadow: var(--notif-shadow);
    opacity: 0;
    transform: translateX(100%);
    transition: var(--notif-transition);
    pointer-events: all;
    will-change: transform, opacity;
}

.notification-toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Types toasts */
.notification-toast.toast-info {
    border-color: var(--notif-info);
}

.notification-toast.toast-success {
    border-color: var(--notif-success);
}

.notification-toast.toast-warning {
    border-color: var(--notif-warning);
}

.notification-toast.toast-error {
    border-color: var(--notif-error);
}

/* Icône toast */
.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toast-info .toast-icon {
    background: var(--notif-info-bg);
}

.toast-success .toast-icon {
    background: var(--notif-success-bg);
}

.toast-warning .toast-icon {
    background: var(--notif-warning-bg);
}

.toast-error .toast-icon {
    background: var(--notif-error-bg);
}

.toast-icon .material-symbols-outlined {
    font-size: 20px;
}

.toast-info .toast-icon .material-symbols-outlined {
    color: var(--notif-info);
}

.toast-success .toast-icon .material-symbols-outlined {
    color: var(--notif-success);
}

.toast-warning .toast-icon .material-symbols-outlined {
    color: var(--notif-warning);
}

.toast-error .toast-icon .material-symbols-outlined {
    color: var(--notif-error);
}

/* Contenu toast */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1f2937;
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    color: #6b7280;
}

/* Bouton CTA toast */
.toast-cta {
    flex-shrink: 0;
    padding: 6px 12px;
    background: none;
    border: 1.5px solid currentColor;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--notif-transition);
}

.toast-info .toast-cta {
    color: var(--notif-info);
}

.toast-success .toast-cta {
    color: var(--notif-success);
}

.toast-warning .toast-cta {
    color: var(--notif-warning);
}

.toast-error .toast-cta {
    color: var(--notif-error);
}

.toast-cta:hover {
    transform: scale(1.05);
}

/* Bouton fermer toast */
.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    cursor: pointer;
    transition: var(--notif-transition);
}

.toast-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.toast-close .material-symbols-outlined {
    font-size: 18px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    /* Badges */
    .notification-badge {
        top: -6px;
        right: -6px;
        min-width: 18px;
        height: 18px;
        font-size: 11px;
    }

    /* Bannières */
    .notification-banner {
        flex-direction: column;
        padding: 12px 16px;
        gap: 12px;
    }

    .banner-icon {
        width: 32px;
        height: 32px;
    }

    .banner-icon .material-symbols-outlined {
        font-size: 20px;
    }

    .banner-cta {
        width: 100%;
    }

    /* Toasts */
    .toast-container {
        top: auto;
        bottom: 24px;
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .notification-toast {
        transform: translateY(100%);
    }

    .notification-toast.toast-visible {
        transform: translateY(0);
    }
}

/* ============================================
   Accessibilité
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .notification-badge,
    .notification-banner,
    .notification-toast,
    .banner-cta,
    .banner-close,
    .toast-cta,
    .toast-close {
        animation: none;
        transition: none;
    }

    .notification-toast {
        transform: none;
    }

    .notification-banner {
        transform: none;
    }
}

/* Focus visible */
.banner-cta:focus-visible,
.banner-close:focus-visible,
.toast-cta:focus-visible,
.toast-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ============================================
   États d'interaction
   ============================================ */
.notification-toast:hover {
    box-shadow: var(--notif-shadow-hover);
}

.notification-banner:hover {
    box-shadow: var(--notif-shadow-hover);
}
