/* Contenedor principal */
.iae-search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Caja de búsqueda */
.iae-search-box {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Formulario */
.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#iae-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#iae-search-input:focus {
    outline: none;
    border-color: #0073aa;
}

.search-btn {
    padding: 12px 25px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #005a87;
}

/* Filtros */
.search-filters {
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.search-filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

/* Loading */
.iae-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Wrapper de resultados con altura fija */
.iae-results-wrapper {
    max-height: 500px; /* Altura fija */
    overflow-y: auto; /* Scroll vertical */
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    margin-top: 20px;
    display: none; /* Inicialmente oculto */
}

/* Header de resultados */
.results-header {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-count {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.results-tools {
    display: flex;
    gap: 5px;
}

.scroll-top-btn,
.scroll-bottom-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    color: #555;
    transition: all 0.2s;
}

.scroll-top-btn:hover,
.scroll-bottom-btn:hover {
    background: #e9ecef;
    color: #333;
}

/* Lista de resultados */
.iae-results-list {
    padding: 0;
}

/* Item individual de resultado */
.iae-result-item {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.iae-result-item:hover {
    background: #f8f9fa;
}

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

/* Header del item */
.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.result-epigrafe.badge {
    background: #0073aa;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
}

.result-codigo-corto {
    font-family: monospace;
    color: #666;
    font-size: 14px;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
}

.result-codigo-completo {
    font-family: monospace;
    color: #888;
    font-size: 12px;
    background: #f9f9f9;
    padding: 2px 8px;
    border-radius: 3px;
}

/* Descripción */
.result-descripcion {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 10px;
	text-transform:capitalize
}

/* Metadatos */
.result-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #666;
}

.meta-item {
    display: flex;
    gap: 5px;
}

.meta-item strong {
    font-weight: 600;
    color: #555;
}

/* Sin resultados */
.iae-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Debug */
.result-debug {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    color: #999;
    font-size: 11px;
}

/* Scrollbar personalizado */
.iae-results-wrapper::-webkit-scrollbar {
    width: 8px;
}

.iae-results-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.iae-results-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.iae-results-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}