/**
 * Estilos para utilidades de Convivencia
 */

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0.375rem;
}

.loading-spinner-container {
    text-align: center;
}

.loading-spinner-container .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Mensajes flotantes mejorados */
.alert.position-fixed {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Mejoras para botones con loading */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.btn .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Búsqueda global */
.global-search-container {
    position: relative;
}

.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    margin-top: 0.25rem;
    width: 100%;
    max-width: 500px;
}

.global-search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.global-search-result-item:hover {
    background-color: #f8f9fa;
}

.global-search-result-item:last-child {
    border-bottom: none;
}

.global-search-result-item .result-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.global-search-result-item .result-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
}

.global-search-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
}

/* Mejoras para confirmaciones */
.modal-confirm-danger .modal-header {
    background-color: #dc3545;
    color: white;
}

.modal-confirm-danger .btn-close {
    filter: invert(1);
}

/* Mejoras para formularios largos */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a90e2;
}

/* Mejoras para tablas */
.table-responsive {
    border-radius: 0.375rem;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

/* Animaciones suaves */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mejoras para cards */
.card {
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Estados de carga en inputs */
.input-loading {
    position: relative;
}

.input-loading::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

