/* =========================================================
   AS Golf de Baugé
   Habillage Webix - nouvelle architecture Espace membre
   ========================================================= */

/* Fenêtres Webix */
.webix_window {
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16) !important;
    overflow: hidden;
}

/* Barre de titre */
.webix_window .webix_win_head,
.webix_window .webix_header {
    background: #E8F2FC !important;
    color: #3182CE !important;
}

.webix_window .webix_win_head .webix_view,
.webix_window .webix_win_head .webix_el_box {
    background: #E8F2FC !important;
    color: #3182CE !important;
}

/* Contenu */
.webix_window .webix_win_body {
    background: #ffffff;
}

/* Datatable */
.webix_dtable {
    border-color: #dfe6ee !important;
}

.webix_ss_header {
    background: #f5f8fb !important;
}

.webix_hcell {
    font-weight: 600 !important;
    color: #2d3748 !important;
}

/* Survol d'une ligne */
.webix_column > div:hover {
    background: #f3f8fd !important;
}

/* Boutons */
.webix_button {
    border-radius: 5px !important;
}

/* Bouton principal */
.webix_primary .webix_button,
.webix_button.webix_primary {
    background: #3182CE !important;
    border-color: #3182CE !important;
    color: #ffffff !important;
}

/* Champs */
.webix_el_text input,
.webix_el_combo input,
.webix_el_select select {
    border-radius: 4px !important;
    border-color: #cbd5e0 !important;
}

/* Scrollbar Webix */
.webix_scroll_cont {
    scrollbar-width: thin;
}

/* =========================================================
   Passe 2 - Lisibilité et actions
   ========================================================= */

/* Typographie générale Webix */
.webix_view,
.webix_view input,
.webix_view select,
.webix_view textarea {
    font-size: 14px;
}

/* Boutons d’action Webix uniquement */
.webix_el_button .webix_button {
    font-size: 14px;
}

/* Un peu plus de présence dans les formulaires */
.webix_el_box input,
.webix_el_box select {
    border-color: #cbd5e0 !important;
}

/* Titres de groupes / fieldsets */
.webix_view fieldset {
    border-color: #d8e1eb;
}

.webix_view legend {
    font-weight: 600;
}

/* =========================================================
   Boutons Webix - thème Espace membre
   ========================================================= */

/* Tous les boutons */
.webix_window .webix_el_button .webix_button {
    background: #E8F2FC !important;
    border: 1px solid #B8D5EF !important;
    border-radius: 6px !important;
    color: #3182CE !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transition:
            background-color 0.15s ease,
            border-color 0.15s ease,
            box-shadow 0.15s ease;
}

/* Survol */
.webix_window .webix_el_button .webix_button:hover {
    background: #DCECFB !important;
    border-color: #8DBCE6 !important;
}

/* Clic */
.webix_window .webix_el_button .webix_button:active {
    background: #D0E6F8 !important;
}

/* Bouton désactivé */
.webix_window .webix_el_button .webix_button:disabled {
    background: #F1F5F9 !important;
    border-color: #DCE3EA !important;
    color: #94A3B8 !important;
}

/* Datatable : lecture légèrement plus douce */
.webix_dtable .webix_cell {
    padding-left: 8px;
    padding-right: 8px;
}

/* En-têtes des tableaux */
.webix_dtable .webix_hcell {
    font-weight: 600 !important;
}

/* Séparateurs moins marqués */
.webix_view,
.webix_dtable,
.webix_ss_body,
.webix_ss_header {
    border-color: #dfe6ee !important;
}

/* Fond général des vues dans la fenêtre */
.webix_window .webix_view {
    background-color: #F7F9FC !important;
}

/* On conserve les champs de saisie blancs */
.webix_window input,
.webix_window select,
.webix_window textarea {
    background-color: #FFFFFF !important;
}

/* Action principale des écrans métier */
.webix_window .agb-primary-action .webix_button {
    background: #3182CE !important;
    border-color: #3182CE !important;
    color: #FFFFFF !important;
}

.webix_window .agb-primary-action .webix_button:hover {
    background: #2B6CB0 !important;
    border-color: #2B6CB0 !important;
}

/* État désactivé */
.webix_window .agb-primary-action .webix_button:disabled {
    background: #E2E8F0 !important;
    border-color: #E2E8F0 !important;
    color: #94A3B8 !important;
}

/* =========================================================
   Datatable - quadrillage
   ========================================================= */

.webix_dtable .webix_cell {
    border-right: 1px solid #D5DEE8 !important;
    border-bottom: 1px solid #D5DEE8 !important;
}

.webix_dtable .webix_hcell {
    border-right: 1px solid #CBD5E0 !important;
    border-bottom: 1px solid #CBD5E0 !important;
}

/* Footer de la liste des inscrits */
.webix_window .agb-list-footer .webix_layout_line {
    height: auto !important;
}

.webix_window .agb-list-footer-line {
    height: auto !important;
}

.webix_dtable .webix_ss_header {
    border-top: 1px solid #CBD5E0 !important;
}

.webix_view fieldset legend {
    padding: 0 8px;
}
/* =========================================================
   Uploader Webix
   ========================================================= */

.webix_uploader.webix_uploadIcon {
    background: transparent !important;
}

.webix_uploader.webix_uploadIcon .webix_el_box {
    position: relative;
    background: transparent !important;
}

.webix_uploader.webix_uploadIcon
button.webix_button.webix_uploadIcon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* L'icône est indépendante du rendu du bouton Webix */
.webix_uploader.webix_uploadIcon .webix_el_box::after {
    content: "";
    position: absolute;
    width: 64px;
    height: 64px;
    left: 0;
    top: 0;
    background-image: url("../images/file-upload.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 64px 64px;
    pointer-events: none;
}

/* Uploader Webix : aucun fond autour de l'icône */
.webix_uploader.webix_uploadIcon,
.webix_uploader.webix_uploadIcon .webix_el_box,
.webix_uploader.webix_uploadIcon .webix_button {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* Encadrement complet des fieldsets Webix */
.webix_fieldset > fieldset {
    border: 1px solid #CBD5E0 !important;
    box-sizing: border-box;
}

/* La légende coupe naturellement la bordure supérieure */
.webix_fieldset > fieldset > .webix_fieldset_label {
    padding: 0 8px;
}

.agb-cabane {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #333;
    vertical-align: middle;
}

.agb-cabane--yes {
    background-color: #16a34a;
}

.agb-cabane--no {
    background-color: #ef4444;
}

/* Texte général */
.agb-competitions-window,
.agb-competitions-window .webix_el_box,
.agb-competitions-window .webix_cell,
.agb-competitions-window .webix_list_item {
    font-size: 14px;
}

/* En-têtes de tableau */
.agb-competitions-window .webix_hcell {
    font-size: 14px;
    font-weight: 600;
}

/* Titres */
.agb-competitions-window .webix_el_label .webix_el_box {
    font-size: 15px;
    font-weight: 600;
}

/* Champs de saisie */
.agb-competitions-window input,
.agb-competitions-window textarea {
    font-size: 14px;
}

/* Boutons d’action uniquement */
.agb-competitions-window .webix_el_button button {
    font-size: 14px;
}

/* =========================================================
   Footer de la fenêtre Compétitions
   ========================================================= */

.agb-competitions-footer {
    background: #f7f9fc !important;
    color: #3182ce;
}

.agb-competitions-footer .webix_template {
    padding: 12px 14px;
    overflow: visible;
}

.agb-competitions-footer__content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 10px 22px;

    font-size: 13px;
    line-height: 1.45;
}

.agb-competitions-footer__fees {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.agb-competitions-footer__reward {
    align-self: start;
}

.agb-competitions-footer__tees {
    grid-column: 1 / -1;

    padding: 8px 10px;

    border: 1px solid #64748b;

    color: #ef4444;
}

.agb-competitions-footer__tees-title {
    margin-bottom: 4px;
    color: #3182ce;
}

.agb-competitions-footer__tees > div:not(:last-child) {
    margin-bottom: 3px;
}

/* =========================================================
   Compétitions - machine à états
   ========================================================= */

/* Zone contenant la légende */
.agb-competitions-state-legend {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #D5DEE8 !important;
}

/* Contenu du template Webix */
.agb-competitions-state-legend .webix_template {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px 12px !important;
    overflow: hidden;
}

/* Liste des états */
.agb-state-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 8px 18px;

    color: #334155;
    font-size: 13px;
    line-height: 20px;
}

/* Un état de la légende */
.agb-state-legend__item {
    display: inline-flex;
    align-items: center;

    gap: 6px;
    white-space: nowrap;
}

/* Pastille générique */
.agb-state-legend__dot {
    display: inline-block;
    flex: 0 0 auto;

    width: 13px;
    height: 13px;

    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 50%;
}

/* Pas d’état */
.agb-state-legend__dot--none {
    background-color: #FFFFFF;
    border-color: #94A3B8;
}

/* En attente */
.agb-state-legend__dot--waiting {
    background-color: #94A3B8;
}

/* Ouverte */
.agb-state-legend__dot--open {
    background-color: #16A34A;
}

/* Réservation terminée */
.agb-state-legend__dot--reservation-closed {
    background-color: #F59E0B;
}

/* Compétition réalisée */
.agb-state-legend__dot--completed {
    background-color: #3182CE;
}

/* =========================================================
   Compétitions - état affiché devant le nom
   ========================================================= */

.agb-competition-name {
    display: flex;
    align-items: center;
    gap: 8px;

    height: 100%;
}

.agb-competition-name__state {
    display: inline-block;
    flex: 0 0 auto;

    width: 11px;
    height: 11px;

    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 50%;
}

.agb-competition-name__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #475569;
}

/* Pas d’état */
.agb-competition-name__state--none {
    background-color: #FFFFFF;
    border-color: #94A3B8;
}

/* En attente */
.agb-competition-name__state--waiting {
    background-color: #94A3B8;
}

/* Ouverte */
.agb-competition-name__state--open {
    background-color: #16A34A;
}

/* Réservation terminée */
.agb-competition-name__state--reservation-closed {
    background-color: #F59E0B;
}

/* Compétition réalisée */
.agb-competition-name__state--completed {
    background-color: #3182CE;
}

.agb-upload-instructions textarea {
    font-size: 12px !important;
    line-height: 19.2px !important;
}

/*
 * CKEditor 5 intégré à Webix.
 */
.webix_ck_toolbar {
    width: auto;
}

.webix_ck_body > .ck-editor__editable {
    margin-left: 1px;
    width: auto;
    height: 260px;
    border: 1px solid;
}

/*
 * Fenêtres de confirmation AGB.
 */
.agb-confirmation-message {
    background: #ffffff;
}

.agb-confirmation-message__content {
    padding: 18px 20px;
    line-height: 1.5;
    color: #44546a;
}

.webix_window[view_id="manageCompetitionParameters"] .webix_inp_label {
    font-size: 12px !important;
    white-space: nowrap !important;
}

.agb-member-workspace,
.agb-admin-workspace {
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 110px);
}

.agb-member-workspace::before,
.agb-admin-workspace::before {
    content: "" !important;
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("../images/logo_as_2024_site.png")
    center top 20px / min(70%, 800px) auto no-repeat;
    opacity: 0.07;
    pointer-events: none;
}

.agb-admin-workspace.elementor-element::before {
    content: "" !important;
    opacity: 0.07 !important;
    pointer-events: none !important;
}

body.agb-payment-return-page div.webix_modal_cover {
    background-color: transparent !important;
    opacity: 0 !important;
}

/* Alignement des cases du formulaire Compétitions */
.webix_window[view_id="manageCompetition"]
.webix_el_checkbox .webix_custom_checkbox {
    margin-top: -3px !important;
}

.agb-repere-pastille {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid #64748b;
    border-radius: 50%;
    vertical-align: middle;
    box-sizing: border-box;
}

.agb-repas-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    color: #1380dd;
}

.agb-repas-icone svg {
    display: block;
}

.agb-repas-icone img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}