/* =========================================================================
   JERRY.MA — CALENDRIER DES COURSES
   Aligné sur la Renaissance v5.3.2 (Glassmorphism Immersif)
   ========================================================================= */

/* --- HERO --- */
.hero-calendar {
    background: transparent;
    color: var(--white);
    text-align: center;
    padding: 5vh var(--space-md) 4vh;
    position: relative;
    overflow: hidden;
}

.hero-calendar h1 {
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -2.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-calendar h1 span {
    color: var(--burnt-orange);
}

.hero-calendar p {
    font-size: 1.15rem;
    font-weight: 500;
    max-width: 700px;
    margin: 0 auto 0;
    opacity: 0.9;
    line-height: 1.6;
    letter-spacing: -0.5px;
}

/* --- FILTRES (Glassmorphism) --- */
.filters-container {
    max-width: 1100px;
    margin: var(--space-md) auto;
    padding: var(--space-md);
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    position: relative;
    z-index: 10;
}

.filter-btn,
.filter-select {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
    outline: none;
}

.filter-btn:hover,
.filter-select:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
}

.filter-btn.active {
    background: var(--burnt-orange);
    border-color: var(--burnt-orange);
    color: white;
    box-shadow: 0 4px 12px rgba(211, 84, 0, 0.35);
}

.filter-select option {
    background: var(--slate-blue);
    color: white;
}

/* --- GRILLE DES COURSES --- */
.races-grid {
    max-width: 1100px;
    margin: 0 auto var(--space-xl);
    padding: 0 var(--space-md);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}

/* --- RACE CARD (Glassmorphism) --- */
.race-card {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.race-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.race-card-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: rgba(44, 62, 80, 0.4);
    position: relative;
}

.race-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    color: var(--slate-blue);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.race-card-body {
    padding: var(--space-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.race-date {
    color: var(--burnt-orange);
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.race-title {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.race-location {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.race-distances {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--space-md);
}

.distance-badge {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.race-card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meute-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

.meute-count span {
    color: var(--burnt-orange);
}

.btn-participate {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--white);
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    cursor: pointer;
}

.btn-participate:hover {
    background: var(--burnt-orange);
    border-color: var(--burnt-orange);
    color: white;
}

/* --- BOUTON AJOUTER UNE COURSE --- */
.btn-add-race {
    background-color: var(--burnt-orange);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    box-shadow: 0 4px 10px rgba(211, 84, 0, 0.3);
    height: fit-content;
    align-self: center;
}

.btn-add-race:hover {
    background-color: #e65c00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(211, 84, 0, 0.4);
}

/* --- MOBILE --- */
@media (max-width: 650px) {
    .hero-calendar {
        padding: 4vh var(--space-md) 3vh;
    }

    .hero-calendar h1 {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 15px;
    }

    .hero-calendar p {
        font-size: 0.95rem;
    }

    .filters-container {
        margin: var(--space-sm) var(--space-md);
        flex-direction: column;
        gap: var(--space-xs);
    }

    .filter-btn,
    .filter-select {
        width: 100%;
        font-size: 0.9rem;
    }

    .races-grid {
        padding: 0 var(--space-sm);
        gap: var(--space-md);
        margin-bottom: 50px;
    }

    .race-card-img {
        height: 130px;
    }

    .race-card-body {
        padding: var(--space-md);
    }

    .race-title {
        font-size: 1.1rem;
    }

    .btn-participate {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}
