/* Système d'alertes uniformisé - Toast notifications */

/* Conteneur fixe pour les notifications */
.alerts-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: calc(100% - 2rem);
    pointer-events: none;
}

.alert-component {
    border: 2px solid;
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-in 4.7s forwards;
    transform-origin: top right;
    position: relative;
    overflow: hidden;
}

/* Barre de progression pour la disparition automatique */
.alert-component::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    animation: progressBar 5s linear forwards;
    width: 100%;
    border-radius: 0 0 0.75rem 0.75rem;
}

.alert-bg-danger::before {
    background-color: #dc2626;
    opacity: 0.5;
}

.alert-bg-primary::before {
    background-color: #e3b04b;
    opacity: 0.5;
}

.alert-bg-success::before {
    background-color: #16a34a;
    opacity: 0.5;
}

.alert-bg-info::before {
    background-color: #2563eb;
    opacity: 0.5;
}

.alert-bg-warning::before {
    background-color: #e3b04b;
    opacity: 0.5;
}

.alert-bg-secondary::before {
    background-color: #4b5563;
    opacity: 0.5;
}

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

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

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.alert-icon-wrapper {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon {
    width: 1.25rem;
    height: 1.25rem;
}

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

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.alert-message {
    font-size: 0.875rem;
    margin: 0;
}

.alert-close {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.alert-close-icon {
    width: 1rem;
    height: 1rem;
}

/* Danger (rouge) */
.alert-bg-danger {
    background-color: #fef2f2;
}

.alert-border-danger {
    border-color: #fecaca;
}

.alert-icon-bg-danger {
    background-color: #fee2e2;
}

.alert-icon-color-danger {
    color: #dc2626;
}

.alert-title-color-danger {
    color: #991b1b;
}

.alert-text-color-danger {
    color: #b91c1c;
}

.alert-close-hover-danger:hover {
    background-color: #fee2e2;
}

/* Primary (jaune ManiEduc) */
.alert-bg-primary {
    background-color: #fff9e6;
}

.alert-border-primary {
    border-color: #ffc107;
}

.alert-icon-bg-primary {
    background-color: rgba(255, 193, 7, 0.2);
}

.alert-icon-color-primary {
    color: #e3b04b;
}

.alert-title-color-primary {
    color: #111827;
}

.alert-text-color-primary {
    color: #374151;
}

.alert-close-hover-primary:hover {
    background-color: rgba(255, 193, 7, 0.2);
}

/* Success (vert) */
.alert-bg-success {
    background-color: #f0fdf4;
}

.alert-border-success {
    border-color: #bbf7d0;
}

.alert-icon-bg-success {
    background-color: #dcfce7;
}

.alert-icon-color-success {
    color: #16a34a;
}

.alert-title-color-success {
    color: #166534;
}

.alert-text-color-success {
    color: #15803d;
}

.alert-close-hover-success:hover {
    background-color: #dcfce7;
}

/* Info (bleu) */
.alert-bg-info {
    background-color: #e8f0fe;
}

.alert-border-info {
    border-color: #bfdbfe;
}

.alert-icon-bg-info {
    background-color: #dbeafe;
}

.alert-icon-color-info {
    color: #2563eb;
}

.alert-title-color-info {
    color: #1e40af;
}

.alert-text-color-info {
    color: #1d4ed8;
}

.alert-close-hover-info:hover {
    background-color: #dbeafe;
}

/* Warning (orange) */
.alert-bg-warning {
    background-color: #fff7ed;
}

.alert-border-warning {
    border-color: #e3b04b;
}

.alert-icon-bg-warning {
    background-color: rgba(227, 176, 75, 0.2);
}

.alert-icon-color-warning {
    color: #e3b04b;
}

.alert-title-color-warning {
    color: #9a3412;
}

.alert-text-color-warning {
    color: #c2410c;
}

.alert-close-hover-warning:hover {
    background-color: #ffedd5;
}

/* Secondary (gris) */
.alert-bg-secondary {
    background-color: #f9fafb;
}

.alert-border-secondary {
    border-color: #e5e7eb;
}

.alert-icon-bg-secondary {
    background-color: #f3f4f6;
}

.alert-icon-color-secondary {
    color: #4b5563;
}

.alert-title-color-secondary {
    color: #111827;
}

.alert-text-color-secondary {
    color: #374151;
}

.alert-close-hover-secondary:hover {
    background-color: #e5e7eb;
}

/* Styles spécifiques pour les alertes dans les formulaires d'authentification */
.auth-form .alert-component,
.auth-form-section .alert-component {
    position: relative;
    animation: none;
    transform: none;
    margin-bottom: 1.5rem;
}

.auth-form .alert-component::before,
.auth-form-section .alert-component::before {
    display: none;
}

/* Responsive */
@media (max-width: 640px) {
    .alerts-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: 100%;
        width: calc(100% - 1rem);
    }
    
    .alert-component {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .alert-icon-wrapper {
        width: 2rem;
        height: 2rem;
    }
    
    .alert-icon {
        width: 1rem;
        height: 1rem;
    }
    
    .alert-title {
        font-size: 0.875rem;
    }
    
    .alert-message {
        font-size: 0.8125rem;
    }
}

