/* Búsqueda Federada - Bento Box */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Override hero background for busqueda */
.hero-container {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%), radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 400px) !important;
    background-blend-mode: overlay !important;
}

.hero-inner {
    max-width: 1480px !important;
    padding: 0 10px;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.bouncing-dots {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: bounce 0.5s infinite alternate;
}

.dot-1 { background-color: #3b82f6; animation-delay: 0s; }
.dot-2 { background-color: #00897b; animation-delay: 0.15s; }
.dot-3 { background-color: #00a7e1; animation-delay: 0.3s; }

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-12px); }
}

.busqueda-main {
    max-width: 1480px !important;
    margin-bottom: 20px !important;
}

.bento-container {
    display: grid;
    gap: 15px;
    max-width: 1480px;
    margin: 0 auto;
    padding: 10px;
    justify-content: center;
}

.bento-container.grid-4 {
    grid-template-columns: repeat(4, minmax(300px, 1fr));
}

.bento-container.grid-3 {
    grid-template-columns: repeat(3, minmax(250px, 380px));
}

.bento-container.grid-2 {
    grid-template-columns: repeat(2, minmax(250px, 380px));
}

@media (max-width: 1320px) {
    .bento-container.grid-4 {
        grid-template-columns: repeat(2, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .bento-container.grid-4, .bento-container.grid-3, .bento-container.grid-2 {
        grid-template-columns: 1fr;
    }
}

.bento-box {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bento-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.bento-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bento-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bento-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bento-body {
    padding: 12px 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bento-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bento-item:hover {
    background-color: #f8fafc;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.bento-item:last-child {
    border-bottom: none;
}

.bento-item-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: #64748b;
    font-size: 1.1rem;
}

.bento-item-content {
    flex-grow: 1;
}

.bento-item-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
    margin-bottom: 2px;
    line-height: 1.25;
}

.bento-item-desc {
    font-size: 0.75rem;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.bento-footer {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.bento-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #3b82f6;
    padding: 8px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .bento-header {
        padding: 10px 12px;
    }
    .bento-header h3 {
        font-size: 0.95rem;
    }
    .bento-body {
        padding: 10px 12px;
        gap: 6px;
    }
    .bento-item {
        padding: 6px 8px;
        gap: 8px;
    }
    .bento-item-title {
        font-size: 0.85rem;
    }
    .bento-item-desc {
        font-size: 0.7rem;
    }
    .bento-footer {
        padding: 10px 12px;
    }
    .bento-btn {
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* Efecto Shimmer (Brillo constante) */
.bento-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shimmer 4s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { left: -100%; }
    60% { left: 200%; }
    100% { left: 200%; }
}

.bento-btn i {
    transition: transform 0.2s ease;
}

.bento-btn:hover {
    background: #f1f5f9;
}

.bento-btn:hover i {
    transform: translateX(4px);
}

/* Colores de cabeceras de Bento Box */
#box-catalogo .bento-header {
    background: #dcfce7;
    border-bottom-color: #bbf7d0;
}
#box-catalogo .bento-header h3 { color: #166534; }
#box-catalogo .bento-badge { background: #166534; color: #fff; }
#box-catalogo .bento-header i { color: #166534 !important; }

#box-diccionarios .bento-header {
    background: #ffedd5;
    border-bottom-color: #fed7aa;
}
#box-diccionarios .bento-header h3 { color: #c2410c; }
#box-diccionarios .bento-badge { background: #c2410c; color: #fff; }
#box-diccionarios .bento-header i { color: #c2410c !important; }

#box-fuentes .bento-header {
    background: #fefce8;
    border-bottom-color: #fef08a;
}
#box-fuentes .bento-header h3 { color: #a16207; }
#box-fuentes .bento-badge { background: #a16207; color: #fff; }
#box-fuentes .bento-header i { color: #a16207 !important; }

#box-tesauro .bento-header {
    background: #f5f0ff;
    border-bottom-color: #e9d5ff;
}
#box-tesauro .bento-header h3 { color: #7c3aed; }
#box-tesauro .bento-badge { background: #7c3aed; color: #fff; }
#box-tesauro .bento-header i { color: #7c3aed !important; }

/* Section specific hovers and icons */
#box-catalogo .bento-item:hover { background-color: #f0fdf4; }
#box-catalogo .bento-btn { color: #166534; background: #f0fdf4; }
#box-catalogo .bento-btn:hover { background: #dcfce7; }
#box-catalogo .bento-item-icon { color: #22c55e; }

#box-diccionarios .bento-item:hover { background-color: #fff7ed; }
#box-diccionarios .bento-btn { color: #c2410c; background: #fff7ed; }
#box-diccionarios .bento-btn:hover { background: #ffedd5; }
#box-diccionarios .bento-item-icon { color: #f97316; }

#box-fuentes .bento-item:hover { background-color: #fefce8; }
#box-fuentes .bento-btn { color: #a16207; background: #fefce8; }
#box-fuentes .bento-btn:hover { background: #fef08a; }
#box-fuentes .bento-item-icon { color: #eab308; }

#box-tesauro .bento-item:hover { background-color: #faf5ff; }
#box-tesauro .bento-btn { color: #7c3aed; background: #faf5ff; }
#box-tesauro .bento-btn:hover { background: #f3e8ff; }
#box-tesauro .bento-item-icon { color: #8b5cf6; }
