:root {
    --bg1-color: #f1f1f1;
    --text1-color: #000000;
    --bg2-color: #476d7c;
    --text2-color: #fff;
    --bg3-color: #a8c5d1;
    --text3-color: #000000;
    --bg4-color: #c8c8c8;
    --text4-color: #000000;
    --bg5-color: #e6e6e6;
    --text5-color: #000000;
    --radius: 5px;
    --padding-button: 5px;
    --bg-homme: #C5E3E1;
    --bg-femme: #E6D9F0;
}

.theme-dark {
    --bg1-color: #000000;
    --text1-color: #f1f1f1;
    --bg2-color: #476d7c;
    --text2-color: #fff;
    --bg3-color: #000000;
    --text3-color: #a8c5d1;
    --bg4-color: #ffffff;
    --text4-color: #349170;
    --radius: 5px;
}

body {
    background: var(--bg1-color) !important;
    color: var(--text1-color) !important;
    margin-bottom: 100px !important;
    user-select: none;
    touch-action: manipulation;
}

input,
select,
textarea {
    padding: 0.5rem 0.75rem !important;
    border: 1px solid #d1d5db;
    /* gray-300 */
    border-radius: 0.375rem;
    /* rounded-md */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* shadow-sm */
}

input:focus,
select:focus,
textarea:focus {
    outline:none;
    border-color: #3b82f6;
    /* blue-500 */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
    /* ring-2 */
}
#global {
    height: 100vh;
    width: 100%;
}

body.withPanel {
    padding-right: 300px;
}

body.withPanel .footer{
    right: 300px;
}

#panel {
    position: fixed;
    top: 0px;
    right: 0px;
    height: 100vh;
    width: 300px;
    background: #f5f5f5;
    border-left: 1px solid #ccc;
    overflow-y: auto;
    display: none;
    z-index: 5;
    box-shadow: 0px -6px 17px 1px gray;
    overflow-x:hidden;
    padding-bottom: 50px;
}

#panel.open {
    display: block;
}

mark{
    background-color: rgb(51, 112, 128);
    color: white;
    padding: 2px;
    border-radius: 3px;
}

#stats-tournament-panel>*{
    margin-top:0.2em;
    margin-bottom: 0.2em ;
    background: #eee;
    border: none;
    text-align: left;
    width: 100%;
}

@media (max-width: 600px) {
    body{
        flex-direction: column;
    }
    body.withPanel{
        padding-right: 0px;
        padding-bottom:300px;
    }
    #panel {
        width: 100%;
        height: 50vh;
        bottom: 0;
        top: auto;
        border-left: none;
        border-top: 1px solid #ccc;
    }
}

.accordion {
    cursor: pointer;
     padding: 0.2em;
    background: #eee;
    border: none;
    text-align: left;
    width: 100%;
}

.accordion-content {
    display: none;
}

.accordion.open+.accordion-content {
    display: flex;
}

.header{
    background: var(--bg2-color);
    color: var(--text2-color);
    padding: 5px 10px;
    height: 50px;
    min-height: 50px;
    z-index: 3;
}

.footer {
    background: var(--bg1-color);
    color: var(--text1-color);
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 5px 10px;
    z-index: 5;
    border-top: lightgray 1px solid;
}

.sous-header {
    background: var(--bg3-color);
    color: var(--text3-color);
    padding: 10px;
    display: flex;
    justify-content: flex-start;
    position: sticky;
    top: 0px;
    z-index:2;
    height: 50px;
}


.sous-sous-header{
    top: 51px;

}
.sous-header-secondary {
    background: var(--bg4-color);
    color: var(--text4-color);
    padding: 10px;
    display: flex;
    justify-content: flex-start;
    position: sticky;
    top: 50px;
    z-index: 1;
    }

.sous-header-ternary {
    background: var(--bg5-color);
    color: var(--text5-color);
    padding: 10px;
    display: flex;
    justify-content: flex-start;
}

.btn-primary {
    background: var(--bg2-color);
    color: var(--text2-color); 
    border-radius: var(--radius);
    padding: 10px;
}

.btn-secondary {
    background: var(--bg4-color);
    color: var(--text4-color);
    border-radius: var(--radius);
    padding: 10px;
}

.btn-ternairy {
    background: var(--bg3-color);
    color: var(--text3-color);
    border-radius: var(--radius);
    padding: 10px;
}

.btn-warning {
    color: var(--text5-color);
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#label-progress-bar {
    /*opacity: 0;*/
    transition: opacity 0.5s ease-in-out;
}

#label-progress-bar.visible {
    opacity: 1; 
}

.player{
    box-shadow: 5px 5px 20px 5px lightgray;

}

.player-preparation {
    background-color: var(--bg-homme);
}
.player-preparation-H {
    background-color: var(--bg-homme);
}
.player-preparation-F {
    background-color: var(--bg-femme);
}

.player-tournament{
    border-radius: 5px;
    padding: 2px 6px;
    margin: 2px;
    /*width: fit-content;*/
    width: 100%;
}

.player-tournament-H{
    background-color: var(--bg-homme);
}

.player-tournament-F {
    background-color: var(--bg-femme);
}

.player-attente{
    border-radius: 5px;
    padding: 2px 6px;
    margin: 2px;
}
.player-attente-H{
    background-color: var(--bg-homme);
}

.player-attente-F {
    background-color: var(--bg-femme);
}

.divAttente{
    background-color: var(--bg4-color);
}

.noUi-touch-area{
    background-color: var(--bg4-color);
}

.noUi-connect{
    background-color: var(--bg2-color);
}

.noUi-vertical .noUi-handle:after,
.noUi-vertical .noUi-handle:before{
    background-color: var(--text4-color);
}

#form-add-player{
    box-shadow: 0px 8px 11px 0px gray;
}

.separator-vertical{
    border: 1px solid lightgray;
    /*box-shadow: 0px 0px 20px 2px gray;*/
    margin: 16px ;
    border-radius: 50%;
    width:0px;
    height: 100%;
}

.menu-context {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    min-width: 150px;
}

.menu-item {
    padding: 8px 12px;
    cursor: pointer;
    white-space: nowrap;
    background-color: var(--bg5-color);
    color: var(--text5-color);
}

.menu-item:hover {
    background: #f0f0f0; }

#button-cloture:disabled{
    opacity: 0.7;
}

.loader {
    border: 6px solid #f3f3f3;
    /* contour clair */
    border-top: 6px solid #3498db;
    /* couleur animée */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    } }

        .noUi-handle:after,
        .noUi-handle:before{
            background: #585858;
        }

.slider{
    margin: 0px 20px;
}

/* Styles pour la popup À propos */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: left;
    animation: slideIn 0.3s ease-out;
}

.popup-content h2 {
    margin-top: 0;
    color: var(--text1-color);
    font-size: 24px;
    margin-bottom: 15px;
}

.popup-content p {
    color: var(--text1-color);
    font-size: 16px;
    line-height: 1.6;
    margin: 10px 0;
}

.popup-content button {
    margin-top: 20px;
    padding: 10px 30px;
    font-size: 16px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.genderFilterActif, .typeTournoiFilterActif{
    background-color: var(--bg2-color);
    color: var(--text2-color);
    font-weight: bold;

}

/* Styles for score inputs in match editing mode */
.score-input {
    width: 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    padding: 0.3rem 0.5rem !important;
    border: 2px solid #3b82f6 !important;
    border-radius: 0.375rem;
    background-color: #eff6ff;
    cursor: text;
}

.score-input:focus {
    outline: none;
    border-color: #1e40af !important;
    background-color: #dbeafe;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3) !important;
}

/* Hide spinner arrows on number input */
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-input[type=number] {
    -moz-appearance: textfield;
}

/* Match focus styling when not editing */
.matchFocused {
    outline: 4px solid #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    background-color: #f0f9ff !important;
}

.match {
  scroll-margin-top: 200px; /* décalage de 200px vers le bas */
}

/* Improved player card styles */
.player-preparation-H,
.player-preparation-F {
    background-color: var(--bg-homme) !important;
    border: 2px solid #cee4e7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.player-preparation-F {
    background-color: var(--bg-femme) !important;
    border-color: var(--bg-femme);
}

.player-preparation-H:hover,
.player-preparation-F:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Delete button styles */
.delete-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    min-width: 40px;
    text-align: center;
}

.delete-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.delete-btn-confirm {
    font-size: 0.9rem !important;
}

/* Gender symbols alignment fix for consistent rendering across browsers and iOS */
select option,
button {
    line-height: 1.5;
    vertical-align: middle;
}

/* Ensure gender symbols display consistently */
.gender-symbol {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

/* Fix for iOS/iPhone dropdown alignment - prevent downward shift of gender symbols */
select option {
    line-height: 1.5;
    vertical-align: middle;
}

/* Additional fix for webkit browsers (Safari/iOS) */
select {
    /* iOS specific fixes */
    -webkit-text-size-adjust: 100%;
}

/* iOS-specific alignment fixes for select elements */
@supports (-webkit-touch-callout: none) {
    select {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        line-height: 1.5;
    }
    
    select option {
        padding-top: 0;
        padding-bottom: 0;
        line-height: normal;
    }
}

ol{
    list-style: decimal !important;
    list-style-position: inside;
}

/* Custom styled checkbox for player selection */
.player-selection-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid var(--bg2-color);
    border-radius: 6px;
    background-color: white;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.player-selection-checkbox:hover {
    border-color: var(--bg3-color);
    box-shadow: 0 0 0 3px rgba(71, 109, 124, 0.1);
}

.player-selection-checkbox:checked {
    background-color: var(--bg2-color);
    border-color: var(--bg2-color);
}

.player-selection-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}