/**
 * TXL Gen4 Design System - Alerts
 * 
 * Composants d'alerte pour messages utilisateur
 */

/* ============================================
   ALERT BASE
   ============================================ */

.alert {
    position: relative;
    padding: var(--spacing-4) var(--spacing-6);
    margin-bottom: var(--spacing-6);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.alert-title {
    margin-top: 0;
    margin-bottom: var(--spacing-2);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.alert-body {
    font-size: var(--font-size-base);
}

.alert-body p:last-child {
    margin-bottom: 0;
}

/* ============================================
   COLOR VARIANTS
   ============================================ */

.alert-success {
    background-color: var(--color-success-50);
    border-color: var(--color-success-200);
    color: var(--color-success-900);
}

.alert-success .alert-title {
    color: var(--color-success-800);
}

.alert-warning {
    background-color: var(--color-warning-50);
    border-color: var(--color-warning-200);
    color: var(--color-warning-900);
}

.alert-warning .alert-title {
    color: var(--color-warning-800);
}

.alert-error {
    background-color: var(--color-error-50);
    border-color: var(--color-error-200);
    color: var(--color-error-900);
}

.alert-error .alert-title {
    color: var(--color-error-800);
}

.alert-info {
    background-color: var(--color-info-50);
    border-color: var(--color-info-200);
    color: var(--color-info-900);
}

.alert-info .alert-title {
    color: var(--color-info-800);
}

/* ============================================
   FILLED VARIANTS
   ============================================ */

.alert-filled.alert-success {
    background-color: var(--color-success-500);
    border-color: var(--color-success-500);
    color: var(--color-neutral-0);
}

.alert-filled.alert-warning {
    background-color: var(--color-warning-500);
    border-color: var(--color-warning-500);
    color: var(--color-neutral-900);
}

.alert-filled.alert-error {
    background-color: var(--color-error-500);
    border-color: var(--color-error-500);
    color: var(--color-neutral-0);
}

.alert-filled.alert-info {
    background-color: var(--color-info-500);
    border-color: var(--color-info-500);
    color: var(--color-neutral-0);
}

/* ============================================
   BORDERED VARIANTS
   ============================================ */

.alert-bordered {
    border-width: 2px;
    border-left-width: 4px;
}

/* ============================================
   ALERT WITH ICON
   ============================================ */

.alert-with-icon {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-3);
}

.alert-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.125rem;
}

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

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

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

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

.alert-filled .alert-icon {
    color: inherit;
}

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

/* ============================================
   DISMISSIBLE ALERT
   ============================================ */

.alert-dismissible {
    padding-right: var(--spacing-10);
}

.alert-close {
    position: absolute;
    top: var(--spacing-4);
    right: var(--spacing-4);
    padding: var(--spacing-1);
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

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

/* ============================================
   ALERT WITH ACTIONS
   ============================================ */

.alert-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    margin-top: var(--spacing-3);
}

.alert-action-btn {
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border: none;
    border-radius: var(--radius-base);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.alert-success .alert-action-btn {
    background-color: var(--color-success-600);
    color: var(--color-neutral-0);
}

.alert-success .alert-action-btn:hover {
    background-color: var(--color-success-700);
}

.alert-warning .alert-action-btn {
    background-color: var(--color-warning-600);
    color: var(--color-neutral-900);
}

.alert-warning .alert-action-btn:hover {
    background-color: var(--color-warning-700);
}

.alert-error .alert-action-btn {
    background-color: var(--color-error-600);
    color: var(--color-neutral-0);
}

.alert-error .alert-action-btn:hover {
    background-color: var(--color-error-700);
}

.alert-info .alert-action-btn {
    background-color: var(--color-info-600);
    color: var(--color-neutral-0);
}

.alert-info .alert-action-btn:hover {
    background-color: var(--color-info-700);
}

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

.alert-fade-in {
    animation: alert-fade-in var(--transition-base);
}

@keyframes alert-fade-in {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-fade-out {
    animation: alert-fade-out var(--transition-base);
}

@keyframes alert-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-1rem);
    }
}
