/* ========================================
   RESET ET STYLES GÉNÉRAUX
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   EN-TÊTE
   ======================================== */

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* ========================================
   SECTION RECHERCHE ET FILTRES
   ======================================== */

.search-section {
    background: rgba(255, 255, 255, 0.9);
    padding: 30px 20px;
    margin: 30px 0;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Barre de recherche */
.search-bar {
    margin-bottom: 20px;
}

#searchInput {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Filtres par catégorie */
.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: #e8e8e8;
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ========================================
   GRILLE DE COURS
   ======================================== */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* ========================================
   CARTE DE COURS
   ======================================== */

.course-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Icône du cours */
.course-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
}

/* Contenu du cours */
.course-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-title {
    color: #333;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.course-category {
    display: inline-block;
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    width: fit-content;
}

.course-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex: 1;
}

/* Boutons d'action */
.course-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-view {
    background: #667eea;
    color: white;
}

.btn-view:hover {
    background: #5568d3;
}

.btn-download {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
}

.btn-download:hover {
    background: #e8e8e8;
    border-color: #667eea;
}

/* ========================================
   MESSAGE "AUCUN RÉSULTAT"
   ======================================== */

.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    margin: 20px 0;
}

.no-results p {
    font-size: 1.2rem;
    color: #666;
}

/* ========================================
   PIED DE PAGE
   ======================================== */

footer {
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
    color: #666;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de masquage pour les cours filtrés */
.course-card.hidden {
    display: none;
}

/* ========================================
   RESPONSIVE - TABLETTES
   ======================================== */

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .category-filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
}

/* ========================================
   RESPONSIVE - MOBILES
   ======================================== */

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .course-card {
        padding: 20px;
    }

    .course-title {
        font-size: 1.2rem;
    }

    .course-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 7px 12px;
    }
}