/* Style User-Friendly FIXED - Avec images et design complet */

:root {
    --primary: #000000;
    --secondary: #4a4a4a;
    --accent: #0304E9;
    --bg-light: #ffffff;
    --bg-gray: #f8f9fa;
    --border: #e0e0e0;
    --text-dark: #2c2c2c;
    --text-light: #6c6c6c;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Container */
#catalogue-courses-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.catalogue-header {
    text-align: center;
    padding: 50px 20px 30px;
    background: var(--bg-light);
    margin-bottom: 40px;
    border-radius: 8px;
}

.catalogue-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.catalogue-header h2::before {
    content: "🏃 ";
    font-size: 0.8em;
}

.total-races {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 400;
}

/* Search & Filters */
.catalogue-search {
    margin: 30px 0;
}

.search-box {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.catalogue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 180px;
}

.filter-select:hover {
    background: var(--bg-gray);
    border-color: var(--primary);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.btn-reset {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    align-self: flex-end;
}

.btn-reset:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Results Info */
.results-info {
    text-align: center;
    margin: 20px 0;
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Grid */
.races-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Race Card */
.race-card {
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.race-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Race Image */
.race-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.race-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.race-type-badge.trail {
    background: rgba(39, 174, 96, 0.95);
    color: white;
}

.race-type-badge.running {
    background: rgba(3, 4, 233, 0.95);
    color: white;
}

.race-type-badge.cross {
    background: rgba(155, 89, 182, 0.95);
    color: white;
}

.race-type-badge.marche {
    background: rgba(255, 107, 53, 0.95);
    color: white;
}

.race-level-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Card Header */
.race-header {
    padding: 25px;
    border-bottom: 1px solid var(--border);
}

.race-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.race-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.race-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Card Body */
.race-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.race-type {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-gray);
    color: var(--text-dark);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.race-type.trail {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.race-type.running {
    background: rgba(3, 4, 233, 0.1);
    color: #0304E9;
}

.race-type.cross {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
}

.race-type.marche {
    background: rgba(255, 107, 53, 0.1);
    color: #FF6B35;
}

.race-distances {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.distance-tag {
    padding: 5px 12px;
    background: rgba(3, 4, 233, 0.08);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.race-info {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-gray);
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.7;
}

.race-info p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.race-info strong {
    color: var(--primary);
    font-weight: 600;
}

/* Card Footer */
.race-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.race-link {
    display: block;
    width: 100%;
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: center;
    border: none;
    cursor: pointer;
}

.race-link:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.pagination button {
    padding: 10px 18px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-dark);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-light);
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-light);
    font-size: 1rem;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: var(--text-light);
    background: var(--bg-light);
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .races-grid {
        grid-template-columns: 1fr;
    }
    
    .catalogue-filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .catalogue-header h2 {
        font-size: 2rem;
    }
    
    .race-name {
        font-size: 1.2rem;
    }
    
    .race-image {
        height: 160px;
    }
}

@media (max-width: 480px) {
    #catalogue-courses-container {
        padding: 10px;
    }
    
    .race-header,
    .race-body,
    .race-footer {
        padding: 15px;
    }
    
    .race-image {
        height: 140px;
    }
}
