/**
 * Estilos para el modal de búsqueda de IMDER Turbo
 */

/* Estilos generales del modal de búsqueda */
#searchModal .modal-content {
    border-radius: 12px !important;
    border: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#searchModal .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #fff;
    padding: 20px 25px;
}

#searchModal .modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    display: flex;
    align-items: center;
}

#searchModal .modal-title::before {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
    color: #0d6efd;
}

#searchModal .modal-body {
    padding: 30px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    min-height: 300px;
}

/* Campo de búsqueda */
#searchModal .input-group {
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#searchModal input[type="search"] {
    border-radius: 50px 0 0 50px;
    font-size: 1.1rem;
    height: 60px;
    padding: 0 25px;
    border: none;
}

#searchModal input[type="search"]:focus {
    box-shadow: none;
}

#searchModal .input-group-text {
    border-radius: 0 50px 50px 0 !important;
    background-color: #fff;
    border: none;
    cursor: pointer;
    padding: 0 30px !important;
    transition: all 0.3s ease;
}

#searchModal .input-group-text:hover {
    background-color: #f8f9fa;
}

#searchModal .input-group-text i {
    color: #0d6efd;
    font-size: 1.2rem;
}

/* Mejoras visuales para el campo de búsqueda */
#searchModal input[type="search"].searching {
    background-color: #f8f9fa;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#searchModal input[type="search"]:focus {
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Efecto de carga durante la búsqueda */
@keyframes searchingPulse {
    0% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(13, 110, 253, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}

.searching {
    animation: searchingPulse 1.5s infinite;
}

/* Contenedor de resultados */
#search-results-container {
    background-color: #fff;
    border-radius: 12px;
    padding: 0;
    margin-top: 25px;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
    width: 100% !important;
    scrollbar-width: thin;
    scrollbar-color: #0d6efd #f8f9fa;
}

#search-results-container::-webkit-scrollbar {
    width: 8px;
}

#search-results-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 0 12px 12px 0;
}

#search-results-container::-webkit-scrollbar-thumb {
    background-color: #0d6efd;
    border-radius: 10px;
}

#search-results {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
}

/* Elementos de resultados de búsqueda */
.search-results-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e9ecef;
}

.search-results-list {
    padding: 15px;
}

.search-result-item {
    padding: 18px;
    transition: all 0.35s ease;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 5px solid #0d6efd;
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-result-item:hover {
    background-color: #e9ecef;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.search-result-item h5 {
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.search-result-item h5 a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.search-result-item h5 a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.search-result-item p {
    color: #495057;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.search-result-item .btn {
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.search-result-item .btn:hover {
    background-color: #0a58ca;
    color: white;
    transform: translateX(3px);
}

/* Iconos y elementos visuales */
.search-result-item .fas,
.search-results .fas {
    color: #0d6efd;
}

.text-center .fas {
    opacity: 0.85;
    margin-bottom: 15px;
}

/* Animaciones para resultados */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-result-item {
    animation: fadeIn 0.4s ease forwards;
    animation-delay: calc(0.1s * var(--index, 0));
}

/* Estilo para el mensaje cuando no hay resultados */
.text-center.py-4 {
    padding: 30px 20px !important;
}

.search-result-item p {
    color: #6c757d;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.search-result-item .btn {
    padding: 5px 15px;
    font-size: 0.85rem;
}

/* Mensaje cuando no hay resultados */
#search-results .text-center {
    padding: 30px;
    color: #6c757d;
}

/* Estilos para el resaltado de palabras clave */
mark {
    background-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.result-title mark {
    background-color: rgba(13, 110, 253, 0.15);
    padding: 0 3px;
}

.search-result-item:hover mark {
    background-color: rgba(13, 110, 253, 0.3);
}

/* Animaciones mejoradas para la carga de resultados */
@keyframes fadeInResult {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    70% { 
        opacity: 0.7;
        transform: translateY(0);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.search-result-item {
    animation: fadeInResult 0.5s ease forwards;
    animation-delay: calc(0.08s * var(--index, 0));
}

/* Responsive */
@media (max-width: 767.98px) {
    #searchModal .input-group {
        width: 100% !important;
    }
    
    #searchModal input[type="search"] {
        height: 50px;
    }
    
    #search-results-container {
        max-height: 300px;
    }
}
