/**
 * ========================================
 * STYLES DES NOTIFICATIONS TOAST
 * ========================================
 */

/* Conteneur des toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 420px;
    width: 100%;
}

/* Toast individuel */
.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1),
                0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 64px;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.toast:hover {
    transform: translateX(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15),
                0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Animations */
.toast-enter {
    opacity: 0;
    transform: translateX(100%);
}

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

.toast-exit {
    opacity: 0;
    transform: translateX(120%);
}

/* Types de toast */
.toast-success {
    border-left-color: #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

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

.toast-icon svg {
    width: 100%;
    height: 100%;
}

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

.toast-message {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    word-wrap: break-word;
}

/* Bouton de fermeture */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

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

.toast-close:active {
    transform: scale(0.95);
}

/* Barre de progression pour auto-fermeture */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
        transform-origin: left;
    }
    to {
        transform: scaleX(0);
        transform-origin: left;
    }
}

/* Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        padding: 12px;
    }

    .toast-message {
        font-size: 13px;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1f2937;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3),
                    0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .toast-message {
        color: #f3f4f6;
    }

    .toast-close {
        color: #9ca3af;
    }

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

/* Variantes avec icônes colorées en fond */
.toast-success::before,
.toast-error::before,
.toast-warning::before,
.toast-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    opacity: 0.1;
}
