/* CSS Document */
/* --- ÍNDICES DE DIRECTORIOS --- */

/* 1. Contenedor del Buscador (UX Key) */
.search-hero-container {
    background-color: transparent;
    padding: 30px 6px 30px 6px;
    border-radius: 9px;
    border: transparent;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin: 0px;
    text-align: center;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 660px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    color: var(--primary);
}

#categoryFilter {
    width: 100%;
    box-sizing: border-box;
    padding: 15px 15px 15px 45px; 
    font-size: 1.1rem;
    border: 2px solid #E0E0E0;
    border-radius: 50px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    
    /* Aseguramos que no se salga en móviles muy pequeños */
    max-width: 100%; 
}

#categoryFilter:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 76, 129, 0.1);
}

.no-results-container {
    width: 100%;
    margin-top: 0px;
    padding: 30px 20px;
    text-align: center;
    background-color: #f9fbfd;
    border: 2px dashed #cfd8dc;
    border-radius: 10px;
    box-sizing: border-box;
}

.no-results-content h3 {
    color: var(--primary);
    margin: 10px 0;
    font-size: 1.2rem;
}

.no-results-content p {
    color: #546e7a;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

/* 2. La Cuadrícula de Enlaces (Grid) */
.directory-grid {
    display: grid;
    /* Responsive automático: crea columnas de mín 250px */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 3. Las Tarjetas (Cards) */
.dir-card {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.dir-card a {
    color: var(--text-main);
    transition: color 0.2s ease;
    padding: 24px 24px;
}
.dir-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: var(--primary);
}
.dir-card:hover .dir-name {
    color: var(--accent);
    transition: color 0.2s ease;
}

/* Efecto visual: borde izquierdo de color */
.dir-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary);
    transition: background-color 0.2s;
}

.dir-card:hover::before {
    background-color: var(--accent);
}

/* Estilo para la etiqueta de "Actualizado" */
.badge-updated {
    display: inline-block;
    background-color: #2e7d32;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

/* Ajuste opcional: Si quieres que brille un poco para llamar la atención */
.badge-updated {
    box-shadow: 0 2px 4px rgba(46, 125, 50, 0.2);
}

/* 4. El Enlace dentro de la tarjeta */
.dir-card a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 15px 20px 20px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    height: 100%;
}

.dir-name {
    font-size: 1.15rem;
    line-height: 1.4;
}

.dir-card-updated {
    display: block;
    color: darkgreen;
    font-size: 14px;
    padding-left: 20px;
    padding-bottom: 20px;
    margin-top: -15px;
    font-weight: 600;
    line-height: 1;
    position: relative;
    cursor: help;
    width: fit-content;
}

.dir-card-updated:hover::after {
    content: attr(data-fecha);
    position: absolute;
    bottom: 100%;
    left: 20px;
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dir-card-updated:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* El contador (ej: 12) */
.dir-count {
    background-color: #F4F6F8;
    color: var(--text-light);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: normal;
    margin-left: 10px;
    white-space: nowrap;
}

.dir-card:hover .dir-count {
    background-color: var(--primary);
    color: #FFF;
}

/* Mensaje de "No encontrado" para el buscador */
#noResults {
    display: none;
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-style: italic;
    grid-column: 1 / -1; /* Ocupa todo el ancho */
}