/**
 * Estilos para FindModal
 * Componente de búsqueda/selección de registros
 */

/* Modal de Find */
#findModal .modal-dialog {
    max-width: 800px;
}

#findModal .modal-content {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#findModal .modal-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    color: white;
    border-bottom: none;
    padding: 1rem 1.5rem;
}

#findModal .modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

#findModal .btn-close {
    filter: brightness(0) invert(1);
}

/* Panel de búsqueda */
.find-search-panel {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.find-search-panel .form-label {
    font-weight: 600;
    color: #2c5282;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.find-search-panel .form-select,
.find-search-panel .form-control {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.find-search-panel .form-select:focus,
.find-search-panel .form-control:focus {
    border-color: #2c5282;
    box-shadow: 0 0 0 0.2rem rgba(44, 82, 130, 0.25);
}

/* Contenedor del grid */
.find-grid-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

/* Tabla de resultados */
#findDataTable {
    margin-bottom: 0;
    font-size: 0.9rem;
}

#findDataTable thead th {
    background: #2c5282;
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

#findDataTable tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

#findDataTable tbody tr:hover {
    background-color: #e3f2fd !important;
}

#findDataTable tbody tr.selected {
    background-color: #bbdefb !important;
    font-weight: 500;
}

#findDataTable tbody tr.find-selected {
    background-color: #0d6efd !important;
    color: white !important;
    font-weight: 500;
}

#findDataTable tbody tr.find-selected td {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0a58ca !important;
}

#findDataTable tbody tr.find-selected:hover {
    background-color: #0a58ca !important;
}

#findDataTable tbody tr.find-selected:hover td {
    background-color: #0a58ca !important;
}

#findDataTable tbody td {
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

/* Footer del modal */
#findModal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

#findModal .modal-footer .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 4px;
}

#findModal .modal-footer .btn-primary {
    background: #2c5282;
    border-color: #2c5282;
}

#findModal .modal-footer .btn-primary:hover {
    background: #1e3a5f;
    border-color: #1e3a5f;
}

/* Botón de Find en formularios */
.find-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    background: #2c5282;
    border: none;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
    height: 32px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.find-button:hover {
    background: #1e3a5f;
    transform: translateY(-50%);
}

.find-button:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(44, 82, 130, 0.25);
    transform: translateY(-50%);
}

.find-button i {
    font-size: 0.9rem;
    line-height: 1;
}

/* Input con botón Find (overlay mode) */
.input-with-find {
    position: relative;
}

.input-with-find input {
    padding-right: 45px;
}

/* Find button inside input-group (inline mode, e.g. RUT fields) */
.input-group .find-button {
    position: static;
    transform: none;
    border-radius: 0 3px 3px 0;
    height: auto;
}

.input-group .find-button:hover,
.input-group .find-button:focus {
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    #findModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem;
    }
    
    .find-grid-container {
        max-height: 300px;
    }
    
    #findDataTable {
        font-size: 0.85rem;
    }
}

/* Loading state */
.find-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.find-loading::after {
    content: "Cargando...";
    display: block;
    margin-top: 0.5rem;
}

/* Empty state */
.find-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.find-empty::before {
    content: "📋";
    display: block;
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.find-empty::after {
    content: "No se encontraron registros";
    display: block;
}
