/* ========================================
   css/notifications.css - Styles pour les notifications et badges de statut
======================================== */

/* =================================
   CONTENEUR DES NOTIFICATIONS
================================= */
.notifications-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 400px;
    width: 100%;
    max-height: 100vh;
    overflow: hidden;
}

/* =================================
   NOTIFICATION DE BASE
================================= */
.notification {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

/* Types de notifications */
.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-error {
    border-left: 4px solid var(--error-color);
}

.notification-warning {
    border-left: 4px solid var(--warning-color);
}

.notification-info {
    border-left: 4px solid var(--info-color);
}

/* Contenu */
.notification-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    position: relative;
}

/* Icône */
.notification-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-success .notification-icon {
    color: var(--success-color);
}

.notification-error .notification-icon {
    color: var(--error-color);
}

.notification-warning .notification-icon {
    color: var(--warning-color);
}

.notification-info .notification-icon {
    color: var(--info-color);
}

/* Corps */
.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    font-size: 0.9rem;
}

.notification-message {
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.875rem;
    word-wrap: break-word;
}

/* Actions */
.notification-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.notification-action {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.notification-action:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.notification-success .notification-action:hover {
    border-color: var(--success-color);
    color: var(--success-color);
}

.notification-error .notification-action:hover {
    border-color: var(--error-color);
    color: var(--error-color);
}

.notification-warning .notification-action:hover {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

/* Bouton de fermeture */
.notification-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.notification-close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* Barre de progression */
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.notification-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform-origin: left;
    animation: notificationProgress linear forwards;
}

@keyframes notificationProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.notification-success .notification-progress-bar {
    background: var(--success-color);
}

.notification-error .notification-progress-bar {
    background: var(--error-color);
}

.notification-warning .notification-progress-bar {
    background: var(--warning-color);
}

.notification-info .notification-progress-bar {
    background: var(--info-color);
}

/* Effets hover */
.notification:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-xl);
}

.notification:hover .notification-progress-bar {
    animation-play-state: paused;
}

/* ========================================
   STATUS BADGES - SYSTÈME CENTRALISÉ
   ======================================== */

/* Badge de base - styles communs à tous les badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* =================================
   VARIANTES PAR TYPE
================================= */

/* Type 1: Client Authentication Status (navbar) */
.status-badge.client-status {
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
}

.status-badge.guest {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-muted);
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-badge.authenticated {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Type 2: Validation/State Status */
.status-badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.status-badge.info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info-color);
}

/* Type 3: Neutral/Default */
.status-badge.neutral {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* =================================
   MODIFICATEURS
================================= */

/* Tailles */
.status-badge.sm {
    padding: 0 var(--space-1);
    font-size: 0.7rem;
    height: 20px;
}

.status-badge.lg {
    padding: var(--space-2) var(--space-4);
    font-size: 0.9rem;
}

/* Avec bordure */
.status-badge.bordered {
    border-width: 1px;
    border-style: solid;
    border-color: currentColor;
}

/* Style outline (bordure sans fond) */
.status-badge.outline {
    background: transparent;
    border: 1px solid currentColor;
}

/* Avec icône */
.status-badge i {
    font-size: 0.8em;
}

.status-badge.sm i {
    font-size: 0.7em;
}

.status-badge.lg i {
    font-size: 0.9em;
}

/* Animation pulse */
.status-badge.pulse {
    position: relative;
}

.status-badge.pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: currentColor;
    opacity: 0.2;
    transform: translate(-50%, -50%);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.2;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Indicateur de statut (point) */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-badge.success .status-indicator,
.status-badge.authenticated .status-indicator {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-badge.error .status-indicator {
    background: var(--error-color);
}

.status-badge.warning .status-indicator {
    background: var(--warning-color);
}

.status-badge.info .status-indicator {
    background: var(--info-color);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 currentColor;
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

/* =================================
   CONTEXTES SPÉCIFIQUES
================================= */

/* Dans la navbar */
.client-status-indicator {
    display: flex;
    align-items: center;
    margin-right: var(--space-4);
}

.client-status-indicator .logout-btn {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    margin-left: var(--space-1);
}

.client-status-indicator .logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

/* Dans les tableaux */
.table .status-badge {
    font-size: 0.7rem;
}

/* Dans les cartes de validation */
.validation-card .status-badge {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
}

/* =================================
   ANIMATIONS
================================= */

/* Animations d'entrée */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateX(0);
    }
    40%, 43% {
        transform: translateX(-8px);
    }
    70% {
        transform: translateX(-4px);
    }
    90% {
        transform: translateX(-2px);
    }
}

.notification.bounce {
    animation: bounce 0.6s ease-in-out;
}

/* Notifications empilées */
.notification:nth-child(n+4) {
    transform: scale(0.95) translateX(10px);
    opacity: 0.8;
}

.notification:nth-child(n+5) {
    transform: scale(0.9) translateX(20px);
    opacity: 0.6;
}

.notification:nth-child(n+6) {
    display: none;
}

/* =================================
   RESPONSIVE
================================= */

@media (max-width: 768px) {
    .notifications-container {
        top: var(--space-2);
        right: var(--space-2);
        left: var(--space-2);
        max-width: none;
    }
    
    .notification-content {
        padding: var(--space-3);
        gap: var(--space-2);
    }
    
    .notification-message {
        font-size: 0.8rem;
    }
    
    .notification-actions {
        flex-wrap: wrap;
        gap: var(--space-1);
    }
    
    .notification-action {
        font-size: 0.75rem;
        padding: var(--space-1) var(--space-2);
    }
    
    .client-status-indicator {
        margin-right: var(--space-2);
    }
    
    .status-badge {
        padding: var(--space-1) var(--space-2);
        font-size: 0.75rem;
    }
    
    .status-badge.client-status {
        padding: var(--space-1) var(--space-2);
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .notifications-container {
        top: var(--space-1);
        right: var(--space-1);
        left: var(--space-1);
    }
    
    .notification {
        border-radius: var(--radius-md);
    }
    
    .notification-close {
        top: var(--space-2);
        right: var(--space-2);
    }
    
    .status-badge.sm {
        font-size: 0.65rem;
        padding: 0 var(--space-1);
    }
}

/* =================================
   MODE SOMBRE
================================= */

@media (prefers-color-scheme: dark) {
    .notification {
        background: rgba(26, 26, 46, 0.95);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .notification-progress {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* =================================
   ACCESSIBILITÉ
================================= */

@media (prefers-reduced-motion: reduce) {
    .notification {
        transition: none;
        animation: none;
    }
    
    .notification-progress-bar {
        animation: none;
        transform: scaleX(0);
    }
    
    .notification.show {
        transform: translateX(0);
        opacity: 1;
    }
    
    .status-badge.pulse::before {
        animation: none;
    }
}

/* =================================
   CLASSES UTILITAIRES
================================= */

/* Notification toast compacte */
.notification.compact {
    padding: var(--space-2);
}

.notification.compact .notification-content {
    padding: var(--space-2);
    gap: var(--space-2);
}

.notification.compact .notification-icon {
    width: 20px;
    height: 20px;
}

.notification.compact .notification-message {
    font-size: 0.8rem;
}

/* Notification permanente (pas de timer) */
.notification.permanent .notification-progress {
    display: none;
}