/* ============================
   ALERTES MODERNES
   ============================ */

.custom-alert {
    position: relative;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem auto;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInDown 0.5s ease-out;
    max-width: 600px;
}

/* Animation d'entrée */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation de sortie */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.custom-alert.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Icône de l'alerte */
.alert-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.5rem;
}

/* Contenu de l'alerte */
.alert-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.alert-message {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.95;
}

/* Bouton de fermeture personnalisé */
.alert-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
}

.alert-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* ============================
   TYPES D'ALERTES
   ============================ */

/* Alerte de succès */
.custom-alert.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 5px solid #28a745;
}

.custom-alert.alert-success .alert-icon {
    background: #28a745;
    color: white;
}

/* Alerte d'erreur/danger */
.custom-alert.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 5px solid #dc3545;
}

.custom-alert.alert-danger .alert-icon {
    background: #dc3545;
    color: white;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Alerte d'information */
.custom-alert.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 5px solid #17a2b8;
}

.custom-alert.alert-info .alert-icon {
    background: #17a2b8;
    color: white;
}

/* Alerte d'avertissement */
.custom-alert.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 5px solid #ffc107;
}

.custom-alert.alert-warning .alert-icon {
    background: #ffc107;
    color: #212529;
}

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

@media (max-width: 768px) {
    .custom-alert {
        margin: 1rem;
        padding: 1rem;
        max-width: calc(100% - 2rem);
    }

    .alert-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .alert-title {
        font-size: 0.95rem;
    }

    .alert-message {
        font-size: 0.85rem;
    }
}

/* ============================
   ALERTES SPÉCIALES
   ============================ */

/* Alerte avec progression (auto-fermeture) */
.custom-alert.auto-close {
    position: relative;
    overflow: hidden;
}

.custom-alert.auto-close::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: progress 5s linear forwards;
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Alerte fixe en haut */
.custom-alert.alert-fixed {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    margin: 0;
    animation: slideInDown 0.5s ease-out;
}