/*************************************************************************************
                                    ── DEFI ──
************************************************************************************/

/* HERO BANNER */
.hero-defis {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2d5a1b 60%, var(--teal) 100%);
    padding: 75px 50px;
    position: relative;
    overflow: hidden;
}

.hero-defis-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-defis-text h1 {
    font-family: 'Dynapuff', cursive;
    font-size: 2.4rem;
    color: white;
    margin-bottom: 8px;
}

.hero-defis-text p {
    font-family: 'Bellota', sans-serif;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
    max-width: 480px;
}

.hero-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 16px 24px;
    text-align: center;
}

.hero-stat .hs-n {
    font-family: 'Dynapuff', cursive;
    font-size: 1.8rem;
    color: var(--mint);
    display: block;
}

.hero-stat .hs-l {
    font-family: 'Raleway', sans-serif;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* LAYOUT PRINCIPAL */
.defis-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 32px 80px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* SECTIONS */
.defis-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.section-title {
    font-family: 'Dynapuff', cursive;
    font-size: 1.2rem;
    color: var(--brown);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-count {
    font-family: 'Raleway', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--mint);
    color: var(--brown);
    border-radius: 50px;
    padding: 3px 10px;
}

/* CARTE DÉFI EN COURS */
.defi-en-cours-card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(76, 46, 5, 0.07);
    border: 1.5px solid rgba(70, 158, 70, 0.1);
    animation: fadeUp 0.5s ease both;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.defi-en-cours-card:hover {
    box-shadow: 0 8px 32px rgba(70, 158, 70, 0.15);
    border-color: var(--primary-color);
}

.defi-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.defi-cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.defi-cat-icon.numerique {
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
}

.defi-cat-icon.transport {
    background: linear-gradient(135deg, #e0f4f5, #b2dfdb);
}

.defi-cat-icon.alimentation {
    background: linear-gradient(135deg, #f1f8e9, #dcedc8);
}

.defi-cat-icon.logement {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
}

.defi-card-info {
    flex: 1;
}

.defi-card-title {
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brown);
    margin-bottom: 4px;
}

.defi-card-desc {
    font-family: 'Bellota', sans-serif;
    font-size: 0.82rem;
    color: var(--gray);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.defi-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.defi-tag {
    font-family: 'Raleway', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}

.defi-tag.cat {
    background: rgba(70, 158, 70, 0.1);
    color: var(--primary-color);
}

.defi-tag.niveau {
    background: rgba(64, 135, 140, 0.1);
    color: var(--teal);
}

.defi-tag.co2 {
    background: rgba(184, 228, 145, 0.4);
    color: #3a6b1e;
}

.defi-joined {
    font-family: 'Bellota', sans-serif;
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 12px;
}

.defi-actions {
    display: flex;
    gap: 8px;
    margin-top: 28px;
}

.btn-terminer {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 8px 18px;
    cursor: pointer;
    transition: background 0.2s;
    flex: 1;
}

.btn-terminer:hover {
    background: #3a8b3a;
}

.btn-abandonner {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    background: transparent;
    color: var(--gray);
    border: 1.5px solid #ddd;
    border-radius: 50px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-abandonner:hover {
    border-color: #e57373;
    color: #e57373;
}

/* CARTE DÉFI DISPONIBLE */
.defi-dispo-card {
    background: white;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(76, 46, 5, 0.05);
    border: 1.5px solid rgba(70, 158, 70, 0.08);
    animation: fadeUp 0.5s ease both;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.defi-dispo-card:hover {
    box-shadow: 0 8px 32px rgba(70, 158, 70, 0.12);
    border-color: rgba(70, 158, 70, 0.3);
    transform: translateY(-2px);
}


.btn-rejoindre {
    width: 100%;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--primary-color), var(--teal));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 14px;
}

.btn-rejoindre:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* DÉFIS TERMINÉS */
.defis-termines-section {
    grid-column: 1 / -1;
}

.termines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.defi-termine-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    border: 1.5px solid rgba(70, 158, 70, 0.15);
    display: flex;
    align-items: center;
    gap: 14px;
    animation: fadeUp 0.5s ease both;
}

.termine-check {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.termine-info h4 {
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brown);
    margin-bottom: 2px;
}

.termine-info p {
    font-family: 'Bellota', sans-serif;
    font-size: 0.75rem;
    color: var(--gray);
}

/* EMPTY STATE */
.empty-state {
    background: white;
    border-radius: 20px;
    padding: 40px 24px;
    text-align: center;
    border: 1.5px dashed rgba(70, 158, 70, 0.2);
}

.empty-state .big {
    font-size: 2.8rem;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    font-family: 'Raleway', sans-serif;
    font-size: 0.88rem;
    color: var(--gray);
}

/* Element Scrollable */

.scrollable {
    max-height: 550px;
    overflow-y: auto;
    padding-right: 6px;
}

/* POUR EVITER LECRASEMENT */

.defi-en-cours-card,
.defi-dispo-card {

    flex-shrink: 0 !important; /* TODO : Verifier que ça fonctionne */
}
