/* ==========================================================================
   ESTILOS PARA DIRECTORIO (Modernizado - Versión Definitiva)
   ========================================================================== */

/* --- 1. HERO Y BUSCADOR SPOTLIGHT --- */
.explore-section {
    animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-bar-tv input:focus {
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 4px rgba(183, 42, 30, 0.15) !important;
}

/* --- 2. FILTROS RÁPIDOS (PILLS) --- */
.categories-rail::-webkit-scrollbar { 
    display: none; 
}

.category-pill { 
    scroll-snap-align: start; 
    flex: 0 0 auto; 
    background: var(--color-surface); 
    border: 1px solid var(--color-border); 
    color: var(--color-text-secondary); 
    padding: 10px 24px; 
    border-radius: 50px; 
    font-weight: 600; 
    font-size: 0.95rem; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-pill:hover { 
    border-color: var(--color-accent); 
    color: var(--color-accent); 
    transform: translateY(-2px);
}

.category-pill.active { 
    background: var(--color-accent); 
    color: white; 
    border-color: var(--color-accent); 
    box-shadow: 0 6px 15px rgba(183, 42, 30, 0.25); 
}

/* --- 3. GRID DE RESULTADOS --- */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0 60px 0;
}

/* --- 4. TARJETAS BENTO (PERFILES) --- */
.researcher-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* Sombra base sutil para el modo claro */
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.researcher-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    z-index: 2;
}

/* --- 5. AVATARES E INSIGNIAS --- */
.card-avatar-wrapper { 
    position: relative; 
    margin-bottom: 20px; 
}

.card-avatar { 
    width: 100px; 
    height: 100px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 3px solid var(--color-surface); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.12); 
    transition: transform 0.3s;
}

.researcher-card:hover .card-avatar {
    transform: scale(1.05);
}

.verified-badge { 
    position: absolute; 
    bottom: 5px; 
    right: 5px; 
    background: #10b981; /* Verde de verificación */
    color: white; 
    width: 28px; 
    height: 28px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.75rem; 
    border: 3px solid var(--color-surface); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- 6. TIPOGRAFÍA Y TEXTOS DE LA TARJETA --- */
.researcher-card h3 { 
    font-size: 1.3rem; 
    margin: 0 0 8px 0; 
    font-family: 'Playfair Display', serif; 
    color: var(--color-text-primary); 
    line-height: 1.2;
}

.researcher-institution { 
    color: var(--color-text-secondary); 
    font-size: 0.85rem; 
    margin: 0 0 20px 0; 
    /* Truncamiento a 2 líneas para biografías largas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.5em; /* Mantiene la altura incluso si no hay bio */
}

/* --- 7. ETIQUETAS DE ROL --- */
.researcher-badges { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 8px; 
    margin-bottom: 25px; 
    flex-grow: 1; /* Empuja el botón siempre hacia abajo */
    align-items: flex-start;
}

.r-badge { 
    background: var(--color-background); 
    border: 1px solid var(--color-border); 
    padding: 5px 14px; 
    border-radius: 50px; 
    font-size: 0.75rem; 
    color: var(--color-text-secondary); 
    font-weight: 600; 
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.researcher-card:hover .r-badge {
    border-color: rgba(183, 42, 30, 0.3); /* Un guiño de color al hacer hover en la tarjeta */
}

/* --- 8. BOTÓN DE VER PERFIL --- */
.btn-view-profile { 
    width: 100%; 
    padding: 12px; 
    border-radius: 12px; 
    background: transparent; 
    border: 1px solid var(--color-border); 
    color: var(--color-text-primary); 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    text-decoration: none; 
    display: block;
}

.btn-view-profile:hover { 
    background: var(--color-accent); 
    color: white; 
    border-color: var(--color-accent); 
    box-shadow: 0 5px 15px rgba(183, 42, 30, 0.2);
}

/* --- 9. AJUSTES RESPONSIVOS (MÓVIL) --- */
@media (max-width: 768px) {
    .categories-rail { 
        justify-content: flex-start; 
        padding: 0 20px 15px 20px; 
        margin: 0 -20px; 
    }
    
    .explore-section h1 {
        font-size: 2rem !important; /* Evita que el título se rompa en pantallas pequeñas */
    }
    
    .directory-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* Una columna en celulares */
        gap: 20px;
    }
}