/*
 * Fichier : duels-widget.css
 * Thème : Ya Vamos Viendo
 * Description : Styles spécifiques au widget “Duels”
 * Auteur : YVV
 * Date : 2025-10-24
 * Version : 1.0
 */


/* DUELS WIDGET */
.block-widget-duels {
    margin-bottom: 70px;
}

/* Container principal */
.block-duels {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}

/* Sélecteurs <select> */
.select-joueur-duel {
    width: 150px;
    min-width: 150px;
    margin-bottom: 10px;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 2px;
    border: 2px solid #ccc;
    transition: border 0.1s ease;
}

.select-joueur-duel:focus {
    border-color: #007BFF;
    outline: none;
}

/* --- base Choices.js --- */
.choices {
    position: relative;
    width: 100%;
    font-size: 14px;
}
.block-metabox-joueur-1 .choices__placeholder,
.block-metabox-joueur-2 .choices__placeholder {
  opacity: .7!important;
}
.choices__inner {
    width: 76%!important;
    background-color: gold!important;
    color: black!important;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 12px;
    min-height: 40px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.choices[data-type*="select-one"]::after {
    right: 70px!important;
}
.choices__inner:hover {
    border-color: #999;
}
.choices__list--single {
    width: 100%;
}
.choices__list--dropdown {
    position: absolute;
    top: 100%;
    left: 12%;
    right: 0;
    width: 76%!important;
    z-index: 9999;
    background: black!important;
    border: 1px solid #ccc;
    border-radius: 0!important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    max-height: 300px;          /* taille max du menu déroulant */
    overflow-y: auto;
    animation: dropdownFade 0.25s ease;
}
.choices__list--dropdown .choices__item {
    background-color: black!important;
    color: gold!important;
    padding: 10px 12px;
    transition: background-color 0.15s ease;
}
.choices__list--dropdown .choices__item:hover {
    background-color: gold!important;
    color: black!important;
}
.block-metabox-joueur-1 .choices__item--choice.is-selected,
.block-metabox-joueur-2 .choices__item--choice.is-selected {
    background-color: gold!important;
    color: black!important;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted::after,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted::after {
  opacity: 1!important;
}
@keyframes dropdownFade {

    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }

}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.block-duels label {
    display: block;
    margin: 0;
}

/* Images joueurs */
.block-duels .figure {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
    padding: 0;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 6px 20px rgba(0, 0, 0, 0.19);
}
.block-duels .img-hover {
    width: 220px;
    height: 220px;
    margin: 15px auto 0;
    text-align: center;
}
.block-duels .img-hover a { display: contents; }
.block-duels .img-hover .figure::before {
    position: absolute;
    top: 0;
    left: -75%;
    z-index: 2;
    display: block;
    content: '';
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
    transform: skewX(-25deg);
}
.block-duels .img-hover .figure:hover::before {
    animation: shineduel .75s;
}
@keyframes shineduel {
    100% { left: 125%; }
}

/* Position dans le classement */
.block-duels .position {
    margin: 20px 0;
    color: gold;
}

/* --- structure du bloc parent --- */
.block-metabox-joueur-1,
.block-metabox-joueur-2 {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    vertical-align: top;
    width: 50%;
    max-width: 420px;
    min-width: 280px;
    min-height: 50px;
    transition: min-height 0.28s ease;
    overflow: visible;
    padding: 8px 0;
}
.block-metabox-joueur-1 { margin-right: 0; }
.block-metabox-joueur-2 { margin-left: 0; }

/* Section joueur (fiche dynamique) */
.section-duel {
    width: 76%;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    background-color: black;
    color: gold;
    padding: 0;
    transition: opacity 0.2s ease, max-height 0.2s ease, transform 0.2s ease;
    transform: translateY(-10px);
    margin-top: 10px;
}
.section-duel.active {
    opacity: 1;
    max-height: 600px;
    padding: 0 20px 20px 20px;
    transform: translateY(0);
}

/* Table */
.block-duels .tbl-duels {
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 13px;
    width: 100%;
}
.block-duels .tbl-duels th {
    width: 60px;
    letter-spacing: 0;
}

/* Graphiques */
.block-duels .block-graphs {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    height: 225px;
    padding: 10px;
}
.block-duels .graphs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    font-size: 12px;
    text-align: center;
}
.block-duels .graphs .number {
    display: inline-block;
    height: 20px;
    min-width: 25px;
    line-height: 20px;
    text-align: center;
}
.block-duels .barres {
    width: 18px;
    transition: height 0.3s ease;
}

/* -------------------- BLEU -------------------- */
.block-duels.theme-bleu .barre-pts { background: linear-gradient(to top, #a0c4ff, #005f99); }
.block-duels.theme-bleu .barre-pj  { background: linear-gradient(to top, #bde0fe, #3399ff); }
.block-duels.theme-bleu .barre-v   { background: linear-gradient(to top, #caf0f8, #00b4d8); }
.block-duels.theme-bleu .barre-d   { background: linear-gradient(to top, #ade8f4, #0096c7); }
.block-duels.theme-bleu .barre-fp  { background: linear-gradient(to top, #90e0ef, #0077b6); }
.block-duels.theme-bleu .barre-fm  { background: linear-gradient(to top, #48cae4, #023e8a); }
.block-duels.theme-bleu .barre-cg  { background: linear-gradient(to top, #00b4d8, #03045e); }

/* -------------------- VERT -------------------- */
.block-duels.theme-vert .barre-pts { background: linear-gradient(to top, #d8f3dc, #2d6a4f); }
.block-duels.theme-vert .barre-pj  { background: linear-gradient(to top, #b7e4c7, #40916c); }
.block-duels.theme-vert .barre-v   { background: linear-gradient(to top, #95d5b2, #52b788); }
.block-duels.theme-vert .barre-d   { background: linear-gradient(to top, #74c69d, #2d6a4f); }
.block-duels.theme-vert .barre-fp  { background: linear-gradient(to top, #52b788, #1b4332); }
.block-duels.theme-vert .barre-fm  { background: linear-gradient(to top, #40916c, #081c15); }
.block-duels.theme-vert .barre-cg  { background: linear-gradient(to top, #2d6a4f, #081c15); }

/* -------------------- ROUGE -------------------- */
.block-duels.theme-rouge .barre-pts { background: linear-gradient(to top, #ffc9c9, #b00020); }
.block-duels.theme-rouge .barre-pj  { background: linear-gradient(to top, #ffa8a8, #9b0000); }
.block-duels.theme-rouge .barre-v   { background: linear-gradient(to top, #ff8787, #8b0000); }
.block-duels.theme-rouge .barre-d   { background: linear-gradient(to top, #ff6b6b, #7f0000); }
.block-duels.theme-rouge .barre-fp  { background: linear-gradient(to top, #fa5252, #660000); }
.block-duels.theme-rouge .barre-fm  { background: linear-gradient(to top, #f03e3e, #550000); }
.block-duels.theme-rouge .barre-cg  { background: linear-gradient(to top, #c92a2a, #330000); }

/* -------------------- JAUNE -------------------- */
.block-duels.theme-jaune .barre-pts { background: linear-gradient(to top, #b38600, #ffd633); }
.block-duels.theme-jaune .barre-pj  { background: linear-gradient(to top, #cc9900, #ffe066); }
.block-duels.theme-jaune .barre-v   { background: linear-gradient(to top, #d9a600, #ffe680); }
.block-duels.theme-jaune .barre-d   { background: linear-gradient(to top, #e6b300, #ffeb99); }
.block-duels.theme-jaune .barre-fp  { background: linear-gradient(to top, #f2bf00, #fff2b3); }
.block-duels.theme-jaune .barre-fm  { background: linear-gradient(to top, #ffcc00, #fff7cc); }
.block-duels.theme-jaune .barre-cg  { background: linear-gradient(to top, #ffd633, #ffff99); }

.container-fluid.no-padding {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Responsive : toujours côte à côte mais sans débordement */
@media( max-width: 767px ) {

    .container-fluid.no-padding { padding-left: 0;padding-right: 0;overflow: hidden; }

    .block-widget-duels {
        margin-bottom: 30px;
    }
    .block-duels {
        flex-wrap: nowrap;
        justify-content: center;
        align-items: flex-start;
        gap: 0;
        padding: 0;
    }
    .choices__inner {
        width: 80%!important;
    }
    .choices[data-type*="select-one"]::after {
        right: 30px!important;
    }
    .choices__list--dropdown {
        left: 10%!important;
        width: 80%!important;
    }
    .block-duels .position {
        margin: 10px 0;
    }
    .block-metabox-joueur-1,
    .block-metabox-joueur-2 {
        width: 47%;
        max-width: none;
        min-width: 0;
    }
    .block-duels .img-hover {
        margin: 0 auto;
    }
    .block-duels .img-hover,
    .block-duels .figure {
        width: 100%;
        height: auto;
    }
    .block-duels select {
        width: 160px;
        font-size: 13px;
    }
    .section-duel {
        width: 100%;
    }
    .section-duel.active {
        padding: 10px 13px 0 13px;
        max-height: 500px;
    }
    .block-duels .block-graphs {
        gap: 0;
        height: 225px;
        padding: 10px 0;
    }
    .block-duels .graphs {
        font-size: 10px;
    }
    .block-duels .barres {
        width: 10px;
    }

}