/* ==========================================================
   ESTILOS BASE (Header, Variables, Toast, Mensajes de Estado)
   ========================================================== */

/* 1. Header Fijo */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

/* --- Variables de Color Aesthetic --- */
:root {
    --color-success-aesthetic: #8FBC8F; 
    --color-error-aesthetic: #B22222; 
    --color-warning-aesthetic: #DAA520; 
    --color-process-aesthetic: #A9A9A9; 
    --font-aesthetic: sans-serif;
}

/* 2. Toast (Posición genérica inferior-derecha) */
#aesthetic-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}
.aesthetic-toast {
    min-width: 250px;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #444;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease-out;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 500;
}
.aesthetic-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.aesthetic-toast.success { background-color: #e6ffe6; color: #21603d; }
.aesthetic-toast.error { background-color: #ffeaea; color: #b22222; }
.aesthetic-toast.warning { background-color: #fff8e1; color: #e69900; }

/* 3. Toast Específico (#successToast) */
#successToast {
    position: fixed;
    bottom: 25px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999999;
    
    background-color: #e6ffed;
    color: #1a6f3b;
    border: 1px solid #c8e6c9;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
    max-width: 300px;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    display: flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    gap: 5px;
}
#successToast.show { opacity: 1; visibility: visible; }

/* ==========================================================
   MODAL DE CONFIRMACIÓN (SOLUCIÓN UX PERFECTA)
   ========================================================== */

/* Contenedor Velo */
.modal-overlay {
    position: fixed;
    inset: 0; 
    z-index: 2147483647;

    /* MODIFICADO: Se elimina el centrado Flex para permitir posición absoluta */
    display: block;

    background-color: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none; 
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Contenido del Modal (La Caja Blanca) */
.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    
    /* MODIFICADO: Posición absoluta para seguir al clic del usuario */
    position: absolute;
    /* Valores por defecto (se sobrescriben con JS) */
    top: 50%;
    left: 50%;

    /* Solo dejamos la escala, quitamos el translate */
    transform: scale(0.9);
    opacity: 0;
    
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

/* Estilos de Texto del Modal */
.modal-message {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}
.modal-content p { 
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Contenedor de Acciones del Modal */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Estilos Comunes de Botones */
.modal-actions .btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    border: none;
    min-width: 100px;
}
.modal-actions .btn:active {
    transform: scale(0.95);
}
.modal-actions .btn:hover {
    opacity: 0.9;
}

/* Botón de Cancelar */
.modal-actions .btn-outline {
    background-color: transparent;
    border: 2px solid #e0e0e0;
    color: #7f8c8d;
}
.modal-actions .btn-outline:hover {
    border-color: #bdc3c7;
    background-color: #f9f9f9;
    color: #2c3e50;
}

/* Botón de Confirmación */
.modal-actions .btn.eliminar-action-confirm {
    background-color: var(--color-error-aesthetic, #B22222);
    color: white;
    box-shadow: 0 4px 10px rgba(178, 34, 34, 0.3);
}
.modal-actions .btn.eliminar-action-confirm:hover {
    background-color: #991e1e;
    box-shadow: 0 6px 15px rgba(178, 34, 34, 0.4);
}

/* ==========================================================
   CONGELACIÓN DE SCROLL
   ========================================================== */
body.modal-open {
    overflow: hidden;
    height: 100vh;
}

/* ==========================================================
   ESTILOS DE MENSAJES DE ESTADO (SUPERIOR)
   ========================================================== */
#message-container {
    position: fixed; 
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    pointer-events: none;
}
#message-container > div { 
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    font-size: 0.95rem;
    font-weight: 500;
    transform: translateY(-100px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease-out;
    pointer-events: all;
    margin: 0;
}
#message-container > div.show {
    transform: translateY(0);
    opacity: 1;
}

/* Colores de Mensajes de Estado */
.msg-success-bg { background-color: #E8F5E9; border: 1px solid #C8E6C9; color: #8FBC8F; } 
.msg-error-bg { background-color: #FFEBEE; border: 1px solid #FFCDD2; color: #B22222; } 
.msg-process-bg { background-color: #ECEFF1; border: 1px solid #CFD8DC; color: #A9A9A9; } 
.msg-warning-bg { background-color: #FFFDE7; border: 1px solid #FFF9C4; color: #DAA520; }

/* Animación de Carga */
.process-icon {
    position: relative;
    top: 1px;
    animation: spin 1.2s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Iconos */
.feather-check-circle { stroke: #8FBC8F; }
.feather-x-circle { stroke: #B22222; }
.feather-loader { stroke: #A9A9A9; }
.feather-alert-triangle { stroke: #DAA520; }

/* ==========================================================
   4. ESTILOS DE ESTADO PARA status-message
   ========================================================== */
.success-state {
    background-color: #d4edda; 
    border: 1px solid #c3e6cb; 
    color: #155724; 
}
.success-state .inline-svg { stroke: #155724; }

.error-state {
    background-color: #f8d7da; 
    border: 1px solid #f5c6cb; 
    color: #721c24; 
}
.error-state .inline-svg { stroke: #721c24; }

.process-state {
    background-color: #e0e0e0; 
    border: 1px solid #bdbdbd; 
    color: #424242; 
}
.process-state .inline-svg { stroke: #424242; }

.warning-state {
    background-color: #fff3cd; 
    border: 1px solid #ffeeba; 
    color: #856404; 
}
.warning-state .inline-svg { stroke: #856404; }

