@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ESTILOS GENERALES - ANCHO COMPLETO */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #f7f9fc;
    color: #2d3748;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: transparent;
    overflow: hidden;
    border-radius: 0;
}
.content {
    padding: 24px 28px;
    max-width: 1100px;
    margin: 0 auto;
}

/* INDICE ALFABETICO - DISEÑO MODERNO */
.alphabetic-index {
    margin: 14px 0 24px 0;
    text-align: center;
}
.alphabetic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.alphabetic-title i {
    color: #3182ce;
}
.alphabetic-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    max-width: 800px;
}
.alphabetic-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #ffffff;
    color: #3182ce;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.alphabetic-letter:hover, .alphabetic-letter.current {
    background: #3182ce;
    color: #ffffff;
    border-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.25);
    text-decoration: none;
}

/* BÚSQUEDA SOLICITADA - DISEÑO MODERNO HORIZONTAL */
.search-header-modern {
    margin: 0 0 20px 0;
}
.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #48bb78;  /* Línea vertical verde */
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.search-chip i {
    color: #a0aec0;
    font-size: 1.1rem;
}
.search-chip-content {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-chip-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
}
.search-chip-terms {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2b6cb0;
    background: #ebf8ff;
    padding: 4px 10px;
    border-radius: 6px;
}

/* ANIMACIÓN EN CASCADA PARA TARJETAS */
@keyframes resultFadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* V20 Antigravity: Idea 1 - Minimalismo Espacial (Premium) */
.source-item {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 10px;
    padding: 14px 18px; 
    margin-bottom: 12px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    opacity: 0;
    animation: resultFadeIn 0.4s ease-out forwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.01);
}
.source-item:hover {
    transform: translateY(-2px); 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e0;
}

.source-title {
    font-size: 1.1rem; 
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 6px 0; 
    display: flex;
    align-items: center;
    gap: 8px; 
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.title-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #ebf8ff;
    border-radius: 6px;
    color: #3182ce;
    font-size: 0.8rem;
}
.source-title-text {
    flex: 0 1 auto;
}
.title-separator {
    color: #cbd5e0;
    font-weight: 300;
    margin: 0 6px;
}
.source-main-link {
    background: #3182ce;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(49, 130, 206, 0.2);
}
.source-main-link:hover {
    background: #2b6cb0;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(49, 130, 206, 0.3);
    text-decoration: none;
}
.source-main-link i {
    font-size: 0.85rem;
}

.source-description {
    color: #4a5568;
    font-size: 0.88rem;
    line-height: 1.4;
    margin: 8px 0;
    padding: 2px 0 2px 12px;
    border-left: 3px solid #e2e8f0;
}

/* ENLACES RELACIONADOS - PILLS EN LÍNEA */
.related-links-section {
    margin: 10px 0 0 0;
    padding-top: 10px;
    border-top: 1px dashed #edf2f7;
}
.related-links-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.related-pill-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #718096;
    text-decoration: none;
    transition: all 0.2s ease;
}
.related-pill-link i {
    color: #cbd5e0;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}
.related-pill-link:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #4a5568;
    box-shadow: none;
    transform: none;
}
.related-pill-link:hover i {
    color: #a0aec0;
}

/* MENSAJES */
.message {
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.message i { 
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.9;
}
.message h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.message-warning {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2b6cb0;
}
.message-warning i { color: #3182ce; }
.message-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}
.message-error i { color: #e53e3e; }

/* ENLACE DE REGRESO */
.nav-back {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #edf2f7;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    color: #4a5568;
    padding: 12px 28px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.back-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    color: #2d3748;
    text-decoration: none;
}

/* Modern loader para JS */
.modern-loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}
.bouncing-dots {
    display: flex;
    gap: 10px;
}
.bouncing-dots div {
    width: 14px;
    height: 14px;
    background-color: #3182ce;
    border-radius: 50%;
    animation: bounce 0.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}
.bouncing-dots div:nth-child(2) { animation-delay: 0.15s; }
.bouncing-dots div:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { to { transform: translateY(-12px); } }

/* SCROLL FAB - Igual que en Catálogo y Diccionarios */
.scroll-fab { position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%; background: rgba(61,107,94,0.85); color: #fff; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; opacity: 0; pointer-events: none; z-index: 89; box-shadow: 0 4px 12px rgba(61,107,94,0.25); backdrop-filter: blur(4px); transition: opacity 0.34s ease, transform 0.3s, background 0.3s, box-shadow 0.3s; outline: none; }
.scroll-fab.visible { opacity: 1; pointer-events: auto; }
.scroll-fab:hover { background: rgba(61,107,94,1); transform: scale(1.08); box-shadow: 0 6px 16px rgba(61,107,94,0.4); }
.scroll-fab i { transition: transform 0.32s ease, opacity 0.2s ease; }
.scroll-fab.direction-up i { transform: rotate(180deg); }

/* Responsive */
@media (max-width: 768px) {
    .content { padding: 16px; }
    .source-item { padding: 20px; border-radius: 10px; }
    .back-btn { width: 100%; box-sizing: border-box; justify-content: center; }
    .scroll-fab { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}
