/* ============================================================================
   ESTILOS PARA BASE.HTML - Layout principal
   ============================================================================ */

/* Contenedor principal del layout */
.main-container {
    margin-left: 220px;
    margin-top: 10px;
    transition: margin-left 0.2s ease;
}

/* Ajuste cuando el sidebar está colapsado */
body.sidebar-collapsed .main-container {
    margin-left: 60px;
}

.content {
    padding: 1.5rem;
    min-height: calc(100vh - 60px);
    background: #f8f9fa;
}

/* Alertas de Bootstrap personalizadas */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left-color: #26de81;
}

.alert-danger, .alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: #ff4757;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-left-color: #f7b731;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-left-color: #4bcffa;
}

/* ============================================================================
   MENSAJES - Notificaciones en esquina inferior derecha
   ============================================================================ */

/* Contenedor de mensajes en esquina inferior derecha */
.messages-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    max-width: 400px;
    pointer-events: none;
}

.messages-container .alert {
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding-right: 3rem !important; /* Espacio para el botón X */
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.messages-container .alert .close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    padding: 0;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.messages-container .alert .close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.messages-container .alert .close:active {
    background: rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(0.95);
}

.messages-container .alert.fade-out {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* RESPONSIVE */
@media (max-width: 992px) {
    .main-container {
        margin-left: 0 !important;
    }
}

@media (max-width: 576px) {
    .content {
        padding: 1rem;
    }
    
    .messages-container {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        max-width: none;
    }
    
    .messages-container .alert {
        font-size: 0.9rem;
        padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    }
}
