/* ==========================
   FLASH MESSAGES / ALERTS
========================== */

/* Contenedor de mensajes (posición fija) */
.flash-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.flash-container > * {
    pointer-events: auto;
}

/* Flash message base */
.flash {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius-md, 10px);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.4s ease-out;
    box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, 0.1));
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Contenido del mensaje */
.flash-content {
    flex: 1;
}

/* Botón de cerrar */
.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity var(--transition-fast, 150ms);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flash-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Iconos para flash messages usando pseudo-elementos */
.flash::before {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Variante Success */
.flash-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid #10b981;
    color: #065f46;
}

.flash-success::before {
    content: '✓';
}

/* Variante Danger/Error */
.flash-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.flash-danger::before {
    content: '✕';
}

/* Variante Warning */
.flash-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.flash-warning::before {
    content: '⚠';
}

/* Variante Info */
.flash-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.flash-info::before {
    content: 'ℹ';
}

/* ==========================
   ANIMACIONES
========================== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* ==========================
   RESPONSIVE
========================== */
@media screen and (max-width: 768px) {
    .flash-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .flash {
        padding: 12px 16px;
        font-size: 0.85rem;
    }

    .flash::before {
        font-size: 1.2rem;
    }
}