/* ============================= */
/* ===== CONTENEUR GLOBAL ====== */
/* ============================= */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

/* TITRES PRINCIPAUX */
.main-title {
    color: var(--main-purple);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
}
.subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 35px;
}

/* ============================= */
/* ===== BARRRE DE RECHERCHE === */
/* ============================= */
.search-container {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 35px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    max-width: 320px;
    padding: 12px 20px;
    border-radius: 50px;
    border: 1px solid var(--main-purple);
    outline: none;
    transition: box-shadow 0.3s ease;
}
.search-input:focus {
    box-shadow: 0 0 12px rgba(83,2,116,0.3);
}
.btn-search {
    background: var(--main-purple);
    color: var(--white);
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-search:hover { 
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(83,2,116,0.3);
}

/* ============================= */
/* ===== GRILLE DE CARTES ====== */
/* ============================= */
.competitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    padding: 0 10px;
}

/* ============================= */
/* ===== CARTE CONCOURS ======== */
/* ============================= */
.comp-card {
    position: relative;
    width: 90%;
    max-width: 380px;
    border-radius: 22px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--white);
    box-shadow: 0 12px 28px rgba(83,2,116,0.15);
    transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}
.comp-card:hover {
    transform: translateY(-8px) rotateZ(-1.5deg);
    box-shadow: 0 20px 45px rgba(83,2,116,0.25);
    filter: brightness(1.05);
}
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(83,2,116,0.9) 0%, transparent 70%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: background 0.35s ease;
}
.comp-card:hover .card-overlay {
    background: linear-gradient(180deg, rgba(156,4,218,0.85) 0%, transparent 70%);
}
.card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
}
.card-content h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.btn-more {
    border: 1.5px solid var(--white);
    color: var(--white);
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.3s, color 0.3s;
}
.btn-more:hover { 
    background: var(--white); 
    color: var(--main-purple); 
}

/* ============================= */
/* ===== CARTE CANDIDAT ======== */
/* ============================= */
.candidate-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 90%;
    max-width: 350px;
    margin: auto;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}
.candidate-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow:0 18px 40px rgba(0,0,0,0.15);
}
.card-image-container {
    position: relative;
    height: 260px;
    overflow: hidden;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}
.card-image-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
}
.card-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.4s ease; 
}
.candidate-card:hover .card-img { transform: scale(1.08); }

.candidate-info {
    padding: 20px;
    text-align: center;
}
.candidate-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}
.rank-badge {
    display: inline-block;
    background: var(--accent-yellow);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    transition: transform 0.2s ease;
}
.card-actions { 
    display: flex; 
    gap: 10px; 
    justify-content: center;
    flex-wrap: wrap;
}
.btn-action-outline,
.btn-action-solid {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s ease;
}
.btn-action-outline { 
    border: 1px solid var(--main-purple); 
    color: var(--main-purple); 
    background: transparent; 
}
.btn-action-outline:hover { 
    background: var(--main-purple); 
    color: var(--white); 
    transform: translateY(-2px);
}
.btn-action-solid { 
    background: var(--main-purple); 
    color: var(--white); 
    box-shadow: 0 4px 12px rgba(156,4,218,0.25);
}
.btn-action-solid:hover { 
    background: #5a00a1; 
    transform: scale(1.05); 
}

/* ============================= */
/* ===== ANIMATION ================= */
/* ============================= */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================= */
/* ===== RESPONSIVE ============ */
/* ============================= */
@media(max-width: 1024px){
    .card-image-container { height:240px; }
}
@media(max-width: 768px){
    .search-container{ flex-direction: column; align-items: stretch; }
    .search-input, .btn-search{ width:100%; }
    .card-actions{ flex-direction: column; }
    .comp-card{ aspect-ratio:4/5; width: 95%; }
    .candidate-card{ width: 95%; }
}
@media(max-width:480px){
    .main-title{ font-size:1.4rem; }
    .card-image-container{ height:200px; }
    .btn-more{ font-size:0.75rem; padding:5px 12px; }
}
