
/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */

.ressources-filter-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ============================================
   BARRA DE BÚSQUEDA Y FILTROS
   ============================================ */

.ressources-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
}

/* Campo de búsqueda */
.search-box {
    position: relative;
    flex: 1 1 300px;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.search-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

/* Filtros dropdown */
.filter-dropdown {
    flex: 0 1 auto;
}

.filter-dropdown select {
    padding: 12px 40px 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 160px;
}

.filter-dropdown select:hover {
    border-color: #ccc;
}

.filter-dropdown select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Botón de reset */
.reset-btn {
    padding: 12px 24px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reset-btn:hover {
    background: #ff9800;
    border-color: #ff9800;
    color: white;
    transform: translateY(-2px);
}

.reset-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive para búsqueda y filtros */
@media (max-width: 768px) {
    .ressources-search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        flex: 1 1 100%;
        min-width: 100%;
    }
    
    .filter-dropdown {
        flex: 1 1 100%;
    }
    
    .filter-dropdown select {
        width: 100%;
    }
    
    .reset-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   FILTROS DE CATEGORÍAS
   ============================================ */

.ressources-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    align-items: center;
}

.filter-btn {
    padding: 12px 24px;
    background: #f8f9fa;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

.filter-btn:hover {
    background: #e8e8e8;
    border-color: #ccc;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.filter-btn .count {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 4px;
}

/* ============================================
   CONTADOR DE RESULTADOS
   ============================================ */

.ressources-count {
    text-align: center;
    margin-bottom: 20px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

#results-count {
    color: #2563eb;
    font-weight: 700;
}

/* ============================================
   GRID DE RECURSOS
   ============================================ */

.ressources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    transition: opacity 0.3s ease;
}

.ressources-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.ressources-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive */
@media (max-width: 992px) {
    .ressources-grid,
    .ressources-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .ressources-grid,
    .ressources-grid[data-columns="2"],
    .ressources-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }
    
    .ressources-filters {
        justify-content: flex-start;
    }
}

/* ============================================
   TARJETA DE RECURSO
   ============================================ */

.ressource-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ressource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.ressource-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #f0f0f0;
}

.ressource-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ressource-card:hover .ressource-thumbnail img {
    transform: scale(1.05);
}

.ressource-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ressource-categories {
    font-size: 12px;
    color: #2563eb;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.ressource-title {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.ressource-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ressource-title a:hover {
    color: #2563eb;
}

.ressource-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

.ressource-link {
    display: inline-block;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
}

.ressource-link:hover {
    color: #1d4ed8;
    transform: translateX(5px);
}

/* ============================================
   META INFORMACIÓN (Age, Lieu, Type)
   ============================================ */

.ressource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    background: #f8f9fa;
    padding: 0px 12px!important;
    border-radius: 20px;
    font-weight: 500;
}

.meta-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Age - Violet con icono de persona */
.meta-age {
    color: #7c3aed;
    background: #f5f3ff;
}

.meta-age svg {
    color: #7c3aed;
}

/* Lieu - Verde con icono de ubicación */
.meta-lieu {
    color: #059669;
    background: #f0fdf4;
}

.meta-lieu svg {
    color: #059669;
}

/* Type de ressource - Estilos específicos por tipo */
.meta-type {
    font-weight: 600;
}

/* Programme - Azul con estrella */
.meta-type-programme {
    color: #2563eb;
    background: #eff6ff;
}

.meta-type-programme svg {
    color: #2563eb;
}

/* Outil - Naranja con lupa */
.meta-type-outil {
    color: #ea580c;
    background: #fff7ed;
}

.meta-type-outil svg {
    color: #ea580c;
}

/* Information - Verde azulado con i */
.meta-type-information {
    color: #0891b2;
    background: #ecfeff;
}

.meta-type-information svg {
    color: #0891b2;
}

/* ============================================
   MENSAJES Y LOADER
   ============================================ */

.no-ressources {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px!important;
    font-size: 16px;
    color: #666;
    background: #f9f9f9;
    border-radius: 12px;
}

.ressources-loader {
    text-align: center;
    padding: 40px;
    grid-column: 1 / -1;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ============================================
   ANIMACIONES DE FADE
   ============================================ */

.ressources-grid.fade-out {
    opacity: 0.5;
}

.ressources-grid.fade-in {
    opacity: 1;
}

/* ============================================
   FILTROS ADICIONALES - DISEÑO UX MEJORADO
   ============================================ */

.ressources-additional-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

/* Dropdowns mejorados */
.filter-dropdown {
    flex: 1 1 200px;
    padding: 12px 40px 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.filter-dropdown:hover {
    border-color: #2563eb;
}

.filter-dropdown:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Botón Reset mejorado */
.reset-btn {
    flex: 0 0 auto;
    padding: 12px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reset-btn:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
}

.reset-btn svg {
    width: 16px;
    height: 16px;
}

/* Contador de resultados - estilo minimalista */
.ressources-count {
    text-align: left;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

#results-count {
    color: #2563eb;
    font-weight: 600;
    font-size: 15px;
}

/* Responsive para filtros */
@media (max-width: 768px) {
    .ressources-additional-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-dropdown {
        flex: 1 1 100%;
    }
    
    .reset-btn {
        width: 100%;
        justify-content: center;
    }
}
/* ============================================
   LAYOUT CON SIDEBAR (CATEGORÍAS A LA IZQUIERDA)
   ============================================ */

.ressources-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* Sidebar con categorías */
.ressources-sidebar {
    background: white;
    padding: 18px 0;
    height: fit-content;
    sticky: top;
    top: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Categorías en columna vertical */
.ressources-sidebar .ressources-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: flex-start;
    align-items: stretch;
}

.ressources-sidebar .filter-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    justify-content: space-between;
    display: flex;
}

.ressources-sidebar .filter-btn .count {
    margin-left: auto;
}

/* Contenido principal */
.ressources-main-content {
    min-width: 0;
}

/* Barra superior de filtros horizontales */
.ressources-top-filters {
    margin-bottom: 0;
}

.ressources-additional-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
}

/* Responsive - En móvil, sidebar arriba */
@media (max-width: 992px) {
    .ressources-layout {
        grid-template-columns: 1fr;
    }
    
    .ressources-sidebar {
        position: static;
    }
    
    .ressources-sidebar .ressources-filters {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .ressources-sidebar .filter-btn {
        width: auto;
        flex: 0 1 auto;
    }
}

@media (max-width: 768px) {
    .ressources-additional-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .reset-btn {
        width: 100%;
        justify-content: center;
    }
}
