/* Estilos personalizados para mensajes del sistema */

/* Asegurar que los mensajes no interfieran con el layout */
.alert-container * {
    box-sizing: border-box;
}

/* Forzar estilos base para todos los mensajes */
.alert-container .alert {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Contenedor para mensajes tipo globo (esquina superior derecha) */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
    background: transparent;
    isolation: isolate;
}

/* Contenedor para mensajes normales (parte superior de la página) */
.alert-container .normal-message {
    position: relative;
    margin-bottom: 15px;
    pointer-events: auto;
}

/* Estilos específicos para mensajes tipo globo */
.alert-container .balloon-message {
    position: relative;
    margin-bottom: 10px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
}

/* Estilos específicos para mensajes normales */
.alert-container .normal-message {
    position: relative;
    margin-bottom: 15px;
    pointer-events: auto;
    animation: slideInDown 0.3s ease-out;
}

/* Asegurar que los mensajes estáticos NO tengan animaciones del sistema */
.alert:not(.balloon-message):not(.normal-message) {
    animation: none !important;
}

/* Mensajes estáticos mantienen solo sus propias animaciones */
.alert.email-exists-warn-alert,
.alert.images-lost-info-alert {
    animation: none !important;
}

/* Permitir animaciones específicas para mensajes estáticos */
.alert.highlight-info {
    animation: imagesLostPulse 2s ease-in-out !important;
}

.alert-container .container {
    padding: 0;
    margin-bottom: 10px;
}

.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    padding-right: 56px;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
}

.alert-container .alert.success {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    border-left: 4px solid #1e7e34 !important;
    border: none !important;
}

.alert-container .alert.info {
    background: linear-gradient(135deg, #17a2b8, #6f42c1) !important;
    color: white !important;
    border-left: 4px solid #117a8b !important;
    border: none !important;
}

.alert-container .alert.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
    color: #212529 !important;
    border-left: 4px solid #e0a800 !important;
    border: none !important;
}

.alert-container .alert.error {
    background: linear-gradient(135deg, #dc3545, #e83e8c) !important;
    color: white !important;
    border-left: 4px solid #c82333 !important;
    border: none !important;
}

.alert .close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    color: inherit;
    opacity: 0.85;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}

.alert .close:hover,
.alert .close:focus {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.08);
    outline: none;
}

.alert .close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.alert .close span {
    font-size: 1.75rem;
    line-height: 1;
    pointer-events: none;
}

.alert-container .alert p {
    margin: 0 !important;
    padding-right: 8px !important;
    font-weight: 500 !important;
    color: inherit !important;
}

/* Estilos específicos para texto en mensajes de éxito */
.alert-container .alert.success p {
    color: white !important;
}

/* Estilos específicos para texto en mensajes de info */
.alert-container .alert.info p {
    color: white !important;
}

/* Estilos específicos para texto en mensajes de warning */
.alert-container .alert.warning p {
    color: #212529 !important;
}

/* Estilos específicos para texto en mensajes de error */
.alert-container .alert.error p {
    color: white !important;
}

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

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes slideOutUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

/* Animaciones de salida */
.balloon-message.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

.normal-message.fade-out {
    animation: slideOutUp 0.3s ease-in forwards;
}

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

    .alert {
        padding: 14px 16px;
        padding-right: 52px;
        font-size: 13px;
    }

    .alert .close {
        right: 4px;
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
}
