/* ========================================
   TOURNAMENT STRUCTURE STYLESHEET
   Modern Dark Theme - JCUP
   ======================================== */

/* ============================================ */
/* 1. SECTION PRINCIPALE DU TOURNOI            */
/* ============================================ */

.tournament-section {
    padding: 6rem 4rem;
    background: linear-gradient(135deg, #0a0e27, #1a1f3a);
    position: relative;
    overflow: hidden;
}

/* Fond animé subtle */
.tournament-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(0, 102, 255, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.tournament-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.tournament-title {
    color: #d4af37;
    font-size: 2.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 4rem;
    margin-top: 0;
    position: relative;
    padding-bottom: 1.5rem;
}

/* Ligne dorée sous le titre */
.tournament-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #a38318, transparent);
    border-radius: 2px;
}

.tournament-phases-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* ============================================ */
/* 2. CONTENEUR DE PHASE                       */
/* ============================================ */

.phase-container {
    background: rgba(26, 31, 58, 0.7);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 12px;
    border-top: 5px solid #c0c0c0;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.phase-container-poules {
    background: rgba(26, 31, 58, 0.7);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 12px;
    border-top: 5px solid #0066a5;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.phase-container-grande-finale {
    background: rgba(26, 31, 58, 0.7);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 12px;
    border-top: 5px solid #ffc400;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.phase-title {
    color: #ffd000;
    font-size: 1.8rem;
    margin: 0 0 2rem 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.phase-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ffd000, transparent);
}

.phase-title-poules {
    color: #ffffff;
    font-size: 1.8rem;
    margin: 0 0 2rem 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.phase-title-poules::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #0081c1, transparent);
}

/* ============================================ */
/* 3. GRILLE DES MATCHS                        */
/* ============================================ */

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ============================================ */
/* 4. CARTE DE MATCH                           */
/* ============================================ */

.match-card {
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.9) 0%, rgba(15, 20, 40, 0.8) 100%);
    padding: 0 1.2rem  0;
    border-radius: 10px;
    border: 2px solid;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* Variantes de statut */
.match-card.match-a-venir {
    border-color: #494949;
}

.match-card.match-a-venir:hover {
    border-color: #b3b3b3;
    box-shadow: 0 12px 36px rgba(102, 102, 102, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateY(-6px);
}

.match-card.match-en-cours {
    border-color: #b49a42;
}

.match-card.match-en-cours:hover {
    border-color: #ffd900;
    box-shadow: 0 12px 36px rgba(212, 175, 55, 0.5), 0 0 30px rgba(212, 175, 55, 0.25);
    transform: translateY(-6px);
}

.match-card.match-termine {
    border-color: #347a1f;
}

.match-card.match-termine:hover {
    border-color: #00ff00;
    box-shadow: 0 12px 36px rgba(0, 170, 0, 0.5), 0 0 30px rgba(0, 170, 0, 0.25);
    transform: translateY(-6px);
}

.match-card.match-unknown {
    border-color: #666666;
}

/* ============================================ */
/* 5. DATE DU MATCH                            */
/* ============================================ */

.match-date {
    color: #ffffff;
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: smaller;
    background: linear-gradient(0deg, #303030, #6c6c6c);
    border-radius: 0 0 15px 15px;
    padding: 0 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.match-date-poules {
    color: #ffffff;
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: smaller;
    background: linear-gradient(0deg, #00173c, #006c9c);
    border-radius: 0 0 15px 15px;
    padding: 0 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.match-date-grande-finale {
    color: #ffffff;
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: smaller;
    background: linear-gradient(0deg, #4f2f00, #aa7200);
    border-radius: 0 0 15px 15px;
    padding: 0 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.match-heure {
    font-weight: 700;
    font-size: larger;
}
/* ============================================ */
/* 6. PARTICIPANTS                             */
/* ============================================ */

.match-participants {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.participant-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 90px;
}

/* ============================================ */
/* 7. WRAPPER LOGO/AVATAR                      */
/* ============================================ */

.logo-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* ============================================ */
/* 8. LOGOS D'ÉQUIPE                           */
/* ============================================ */

.team-logo {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.team-logo.winner {
    filter: drop-shadow(0 0 3px rgba(212, 175, 55)) brightness(1.1);
    animation: glow-pulse 2s ease-in-out infinite;
}

.team-logo.winner-poules {
    filter: drop-shadow(0 0 3px rgb(255, 255, 255)) brightness(1.1);
    animation: glow-pulse-poules 2s ease-in-out infinite;
}

.team-logo.loser {
    /* Default styling for loser logos */
}

.team-logo-classement-winner {
    /* Logo dans le classement final de la page  d'un jeu */
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55)) brightness(1.1);
    animation: glow-pulse-classement 2s ease-in-out infinite;
}

/* Style pour l'équipe gagnante d'un match pour un jeu de type CLASSEMENT */
.winner-position {
    filter: drop-shadow(0 0 3px rgba(212, 175, 55)) brightness(1.1);
    animation: glow-pulse 2s ease-in-out infinite;
}

/* ============================================ */
/* 9. TAGS D'ÉQUIPE (FALLBACK)                 */
/* ============================================ */

.team-tag {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.team-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.team-tag.winner {
    filter: drop-shadow(0 0 3px rgba(212, 175, 55));
    animation: glow-pulse 2s ease-in-out infinite;
}

.team-tag.winner-poules {
    filter: drop-shadow(0 0 3px rgb(255, 255, 255));
    animation: glow-pulse-poules 2s ease-in-out infinite;
}

.team-tag.winner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    animation: pulse-ring 2s ease-out infinite;
}

.team-tag.loser {
    /* Default styling for loser tags */
}

.team-tag-classement-winner {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55)) brightness(1.1);
    animation: glow-pulse-classement 2s ease-in-out infinite;
}


/* ============================================ */
/* 10. PLACEHOLDER LOGOS                       */
/* ============================================ */

.logo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 4px;
    background: linear-gradient(135deg, #555555, #333333);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.logo-placeholder.winner {
    filter: drop-shadow(0 0 3px rgba(212, 175, 55));
    animation: glow-pulse 2s ease-in-out infinite;
}

.logo-placeholder.winner-poules {
    filter: drop-shadow(0 0 3px rgb(255, 255, 255));
    animation: glow-pulse-poules 2s ease-in-out infinite;
}

.logo-placeholder.loser {
    /* Default styling for loser placeholders */
}

/* ============================================ */
/* 11. AVATARS JOUEURS                         */
/* ============================================ */

.player-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-avatar.winner {
    filter: drop-shadow(0 0 3px rgba(255, 196, 0)) brightness(1.1);
    border-color: rgba(212, 175, 55, 0.5);
    animation: glow-pulse 2s ease-in-out infinite;
}

.player-avatar.winner-poules {
    filter: drop-shadow(0 0 3px rgb(255, 255, 255)) brightness(1.1);
    border-color: rgba(255, 255, 255, 0.5);
    animation: glow-pulse-poules 2s ease-in-out infinite;
}

.player-avatar.loser {
    /* Default styling for loser avatars */
}

/* ============================================ */
/* 12. PLACEHOLDER AVATARS                     */
/* ============================================ */

.player-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #555555, #333333);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-placeholder.winner {
    filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.9));
    animation: glow-pulse 2s ease-in-out infinite;
}

.player-placeholder.winner-poules {
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.9));
    animation: glow-pulse 2s ease-in-out infinite;
}

.player-placeholder.loser {
    /* Default styling for loser placeholders */
}

/* ============================================ */
/* 13. CROIX PERDANT                            */
/* ============================================ */

.loser-cross {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
    animation: fade-in 0.3s ease;
}

.loser-cross line {
    stroke: #960404;
    stroke-width: 8;
    stroke-linecap: round;
}

.loser-cross.player {
    border-radius: 50%;
}

/* ============================================ */
/* 14. NOM PARTICIPANT                         */
/* ============================================ */

.participant-name {
    color: #ffffff;
    margin: 0;
    font-size: 0.95rem;
    word-break: break-word;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.participant-name.winner {
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: text-glow 2s ease-in-out infinite;
}

.participant-name.winner-poules {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(195, 195, 195, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: text-glow 2s ease-in-out infinite;
}

.participant-name.loser {
    color: #7b7b7b;
    font-weight: 500;
    text-decoration: line-through;
}

/* ============================================ */
/* 15. TEXTE VS                                */
/* ============================================ */

.vs-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* ============================================ */
/* 16. FORMAT MATCH                            */
/* ============================================ */

.match-format {
    color: #ffffff;
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    background: linear-gradient(0deg, #303030, #6c6c6c);
    border-radius: 15px 15px 0 0;
    padding: 0 1rem;
    margin-top: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.match-format-poules {
    color: #ffffff;
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    background: linear-gradient(0deg, #00173c, #006c9c);
    border-radius: 15px 15px 0 0;
    padding: 0 1rem;
    margin-top: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.match-format-grande-finale {
    color: #ffffff;
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    background: linear-gradient(0deg, #4f2f00, #aa7200);
    border-radius: 15px 15px 0 0;
    padding: 0 1rem;
    margin-top: auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}


.match-format:hover {
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.5);
    transform: scale(1.05);
}

/* ============================================ */
/* 17. ÉTATS VIDES                             */
/* ============================================ */

.empty-state {
    color: #b0b0b0;
    margin: 0;
    font-size: 0.95rem;
    text-align: center;
    flex: 1;
    grid-column: 1 / -1;
    font-style: italic;
    padding: 1rem;
}

.no-phases {
    color: #b0b0b0;
    text-align: center;
    grid-column: 1 / -1;
    font-size: 1.1rem;
    padding: 2rem;
    font-style: italic;
}

/* ============================================ */
/* 18. ANIMATIONS MODERNES                     */
/* ============================================ */

@keyframes glow-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgb(255, 196, 0));
    }
    50% {
        filter: drop-shadow(0 0 15px rgb(255, 208, 0));
    }
}

@keyframes glow-pulse-poules {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgb(255, 255, 255));
    }
    50% {
        filter: drop-shadow(0 0 15px rgb(255, 255, 255));
    }
}

@keyframes glow-pulse-classement {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgb(255, 196, 0));
    }
    50% {
        filter: drop-shadow(0 0 40px rgb(255, 208, 0));
    }
}

@keyframes text-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(212, 175, 55, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    50% {
        text-shadow: 0 0 15px rgba(212, 175, 55, 0.8), 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

@keyframes pulse-ring {
    0% {
        box-shadow: inset 0 0 0 0 rgba(212, 175, 55, 0.3);
    }
    70% {
        box-shadow: inset 0 0 0 15px rgba(212, 175, 55, 0);
    }
    100% {
        box-shadow: inset 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================ */
/* 19. RESPONSIVE DESIGN                       */
/* ============================================ */

@media (max-width: 768px) {
    .tournament-section {
        padding: 4rem 2rem;
    }

    .tournament-title {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    .phase-container {
        padding: 2rem;
    }

    .phase-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .matches-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .match-card {
        padding: 1.5rem;
    }

    .match-participants {
        gap: 0.8rem;
    }

    .logo-wrapper {
        width: 80px;
        height: 80px;
    }

    .team-logo,
    .team-tag,
    .logo-placeholder,
    .player-avatar,
    .player-placeholder {
        width: 80px;
        height: 80px;
    }

    .team-logo,
    .player-avatar {
        border-radius: 3px;
    }

    .team-tag,
    .logo-placeholder,
    .player-placeholder {
        border-radius: 3px;
    }

    .player-avatar,
    .player-placeholder {
        border-radius: 50%;
    }

    .vs-text {
        font-size: 0.95rem;
    }

    .match-format {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .tournament-section {
        padding: 2rem 1rem;
    }

    .tournament-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }

    .phase-container {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .phase-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .match-card {
        padding: 1rem;
    }

    .logo-wrapper {
        width: 70px;
        height: 70px;
    }

    .team-logo,
    .team-tag,
    .logo-placeholder,
    .player-avatar,
    .player-placeholder {
        width: 70px;
        height: 70px;
    }

    .team-tag {
        font-size: 1.5rem;
    }

    .match-date {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .participant-name {
        font-size: 0.85rem;
    }

    .vs-text {
        font-size: 0.85rem;
    }

    .match-format {
        font-size: 0.8rem;
    }
}