/* General styles */
body {
    background-color: #1f1f1f;
    font-family: Arial, sans-serif;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

.container { margin: 10px auto; text-align: center; }

.title, .sub-title {
    font-size: 50px;
    text-align: left;
}

.title {
    margin-bottom: 20px;
}

.sub-title {
    margin-bottom: 2px;
}

.no-highlight {
    user-select: none; /* chrome and Opera */
    -moz-user-select: none; /* Firefox */
    -webkit-text-select: none; /* IOS Safari */
    -webkit-user-select: none; /* Safari */
}

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.kos-table ul, 
.kos-table ol {
    margin: 4px 0px 0px 0px;
}

.kos-table, .kos-table th, .kos-table td {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.kos-table th {
    padding: 12px 8px;
    background-color: #f2f2f2;
}

/* Rank Adjustment Styles */
.progress-up {
    color: green;
}

.progress-down {
    color: red;
}

.progress-neutral {
    color: black;
}

/* Rank Styles */
.rank-gold, .player-name-gold {
    background-color: #FFD700; /* Gold */
    color: #000;
    font-weight: bold;
}

.rank-silver, .player-name-silver {
    background-color: #C0C0C0; /* Silver */
    color: #000;
    font-weight: bold;
}

.rank-bronze, .player-name-bronze {
    background-color: #CD7F32; /* Bronze */
    color: #000;
    font-weight: bold;
}

.rank-black, .player-name-black {
    background-color: #000; /* Black for other ranks */
    color: #fff;
    font-weight: bold;
}

/* Avatar Styles */
.avatar-container {
    background-color: #d3d3d3;
    border-radius: 5px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.avatar-popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
    padding: 20px;
    width: 80%;
    max-width: 500px;
}

.avatar-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.avatar-popup-content img.avatar-img {
    width: 80px;
    max-width: 80px;
    margin: 10px;
    cursor: pointer;
    border: 2px solid transparent;
}

.avatar-popup-content img.avatar-img.selected {
    border-color: #0073aa;
}

.close-popup-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

.selected-avatar-thumb {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    vertical-align: middle;
}

/* Ensure responsiveness for mobile devices */
@media screen and (max-width: 600px) {
    .avatar-popup-container {
        max-width: 100%; /* Use full width on smaller screens */
        max-height: 90vh; /* Use more height on smaller screens */
    }
}


/* Red bar styles */
.red-bar, .red-bar-player {
    background-color: hsl(0, 50%, 35%);
    height: 5px;
}

.red-bar {
    margin-bottom: 20px;
}

.red-bar-player {
    margin-bottom: 2px;
}

/* Section styles */
.vs-section, .queue-section {
    background-color: #2c2c2c;
    padding: 10px;
}

.queue-section {
    padding: 20px;
    margin-bottom: 5px;
}

/* Queue styles */
.queue-players {
    color: #fff;
    flex: 1;
    margin: 0 5px;
    text-align: left;
    background-color: #2c2c2c;
    border: #862d2d;
    border-style: none;
    padding: 5px;
    width: 50%;
}

.queue-players ul {
    width: 100%;
    margin: 0;
    padding: 0;
}

.queue-players-ul li {
    float: left;
}

/* VS Section styles */
.vs-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

.vs-section select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url(/wp-content/plugins/king-of-soccer/assets/icons/DownArrowRed.png) !important;
    background-size: 13%;
    text-align: left;
    padding: 10px 15px 10px 5px;
    background-color: #2c2c2c;
    border-color: #862D2D !important;
}

/* Team styles */
.team {
    background-color: hsl(0, 50%, 35%);
    padding: 0px;
    margin: 0 5px;
    flex: 1;
    color: white;
}

.queue-team {
    background-color: hsl(0, 50%, 35%);
    padding: 10px;
    margin: 0 5px;
    flex: initial;
    color: white;
    width: 50%;
}

.vs {
    font-size: 30px;
    margin: 0 10px;
    color: hsl(0, 100%, 99.8%);
}

/* Player label styles */
.players-label {
    font-size: 13px;
    margin: 0px 10px !important;
    color: hsl(0, 50%, 35%);
    margin: 0.15em 0.75em 0 0;
    writing-mode: vertical-lr;
    text-orientation: upright;
}

/* Roster section styles */
.roster-section {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #2c2c2c;
}

/* Player list styles */
.players-list {
    color: #fff;
    flex: 1;
    margin: 0 5px;
    text-align: left;
    background-color: #2c2c2c;
    border: #862d2d;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    border-style: solid;
    padding: 5px;
}

.players-list ul {
    list-style: none;
    padding: 0;
    margin: 0px 0px 0px 0px;
}

.players-list ul li {
    padding: 0px 0;
    text-align: left;
}

/* Queue row styles */
.queue-row {
    display: flex;
    margin-bottom: 10px;
}

/* Responsive columns */
.responsive-columns {
    display: flex;
    flex-wrap: wrap;
}

.responsive-columns > div {
    flex: 1 1 calc(50% - 10px); /* Two columns layout */
    margin: 5px;
}

@media only screen and (max-width: 420px) {
    .responsive-columns > div {
        flex: 1 1 100%;
    }
}

@media (min-width: 420px) and (max-width: 500px) {
    .responsive-columns > div {
        flex: 1 1 45%;
        margin: 5px;
    }
}

/* Player card styles */
.player-card {
    width: 165px;
    height: 75px;
    margin: 5px;
    position: relative;
    overflow: hidden;
    display: block;
    background: hsl(0, 50%, 35%);
    color: white;
    border: 3.5px black;
    border-top-style: none;
    border-right-width: 3.5px;
    border-right-style: none;
    border-right-color: black;
    border-bottom-width: 3.5px;
    border-bottom-style: none;
    border-bottom-color: black;
    border-left-style: none;
    border-style: ridge;
    margin-bottom: 2.5px;
}

.player-card input[type="checkbox"]:checked + .player-card {
    background: hsl(0, 0%, 17.3%);
}

.player-image {
    position: absolute;
    top: 0;
    left: 1px;
    width: 75px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-left-radius: 37.5px;
    border-bottom-right-radius: 37.5px;
    border-bottom: 7.5px;
    border-style: solid;
    border-top-style: solid;
    border-color: black;
    border-top: 0px;
    overflow: hidden;
}

.player-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-name {
    position: absolute;
    top: 31px;
    left: 52px;
    background-color: black;
    color: white;
    padding: 2.5px 5px;
    transform: rotate(-11deg);
    min-width: 90px;
    text-align: center;
    font-size: 1em;
}

.gamer-tag {
    padding: 2.5px 5px;
    margin-top: 2.5px;
    background-color: black;
    color: white;
    margin-top: 3.5px;
    font-size: 0.6em;
    position: absolute;
    bottom: 8px;
    left: 85px;
    transform: rotate(-11deg);
    min-width: 120px;
    width: auto;
}


/* Team entry styles */
.team-entry {
    color: #862D2D;
    display: block;
    background: black;
    border: 7px black;
    border-right: 10px;
    border-bottom: 10px;
    border-style: ridge;
    margin-bottom: 5px;
    padding: 5px;
    display: flex;
    align-items: center;
}

.team-entry input[type="checkbox"]:checked + .team-entry {
    background: hsl(0, 0%, 17.3%);
}

.team-entry label {
    line-height: 1.75;
    margin: 0px 0px 5px 0px;
    color: white;
    font-weight: bold;
}

.team-entry input {
    margin-right: 10px !important;
}

.team-entry input[type="radio"] {
    flex: 0 0 auto;
    margin-right: 10px; /* Optional: Adjust the spacing between radio and text field */
}

.new-team-label {
    flex: 1;
}

.new-team-label input[type="text"] {
    width: 100%;
}

/* Table styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.kos-table {
    width: 100%;
    border-collapse: collapse;
}

.kos-table ul, 
.kos-table ol {
    margin: 4px 0px 0px 0px;
}

.kos-table th, 
.kos-table td {
    border: 1px solid #ddd;
    padding: 8px;
}

.kos-table th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: #f2f2f2;
}

/* Additional styling if needed */
form {
    margin-top: 20px;
}

input[type="text"] {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: calc(100% - 12px); /* Adjust for padding */
}

p {
    margin: 0;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

button:hover {
    background-color: #45a049;
}

/* NES controller button styles */
.timer-btn {
    background-color: hsl(0, 50%, 35%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 16px;
    margin: 0 5px;
    cursor: pointer;
}

.timer-btn:hover {
    background-color: #b22222;
}

.submit {
    background-color: hsl(0, 50%, 35%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 100px;
    height: 50px;
    font-size: 16px;
    margin: 0 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.submit:hover {
    background-color: #b22222;
}

/* Result message */
#kos_team_setup_result {
    margin-top: 20px;
    font-size: 1.2em;
    color: green;
}

/* Two-column layout for player names within table cells */
.kos-table td .player-names {
    display: flex;
    flex-wrap: wrap;
}

.kos-table td .player-names .player-name {
    flex: 1 1 50%;
    padding: 2px 0;
}

.two-columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the cards */
}

.two-columns > .player-entry {
    flex: 1 1 calc(50% - 10px); /* Two columns with space between */
    box-sizing: border-box;
    margin-bottom: 10px; /* Space between rows */
}

@media (max-width: 768px) {
    .two-columns > .player-entry {
        flex: 1 1 50%;
    }
}

@media (min-width: 527px) and (max-width: 1188px) {
    .two-columns > .player-entry {
        flex: 1 1 calc(25% - 10px); /* Four columns with space between */
    }

    .new-team-entry {
        flex: 1 1 calc(50% - 10px); /* Text field takes two column slots */
    }
}

@media (min-width: 395px) and (max-width: 527px) {
    .two-columns > .player-entry {
        flex: 1 1 calc(50% - 10px); /* Four columns with space between */
    }

    .new-team-entry {
        flex: 1 1 calc(50% - 10px); /* Text field takes two column slots */
    }
}

@media (max-width: 395px) {
    .two-columns > .player-entry {
        flex: 1 1 100%; /* Single column for small screens */
    }

    .new-team-entry {
        flex: 1 1 100%; /* Text field takes full width */
    }
}

@media (max-width: 1188px) {
    .player-card {
        width: 140px;
    }

    .player-image {
        left: 0px;
    }

    .player-name {
        top: 31px;
        left: 46px;
    }

    .gamer-tag {
        bottom: 10px;
        left: 72px;
    }
}

/* DataTable stlyes */
.dataTable > tbody > tr { 
    background-color: transparent !important; 
}

/* Add avatar to player registraton */
.avatar-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 500px;
    background-color: #1f1f1f;
    border: 2px solid #862D2D;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}

.avatar-popup img {
    width: 80px;
    height: 80px;
    margin: 10px;
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: border 0.3s ease;
}

.avatar-popup img:hover,
.avatar-popup img.selected {
    border: 3px solid #862D2D;
}

.avatar-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #862D2D;
    font-size: 18px;
}

#kos_add_player_form .avatar-button {
    background-color: #862D2D;
    color: #ffffff;
    padding: 10px;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
    text-align: center;
}


/* Arcade button styles */
.arcade-button {
    position: relative;
    width: 55px;
    height: 55px;
    background: linear-gradient(hsl(0, 50%, 50%), hsl(0, 50%, 40%));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 1px 2px 3px #290e0e;
    border: 1px solid hsl(0, 50%, 35%);
}

.mini-arcade-toggle-button {
    width: 30px;
    height: 30px;
    background: linear-gradient(hsl(0, 50%, 50%), hsl(0, 50%, 40%));
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-right: 10px;
}

.mini-arcade-toggle-button.active {
    box-shadow: none;
    transform: translate(0px, 0px);
}

.mini-button {
    width: 30px !important;
    height: 30px !important;
}

.inner-button {
    width: 45px;
    height: 45px;
    background: linear-gradient(hsl(0, 50%, 50%), hsl(0, 50%, 40%));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: hsl(0, 50%, 95%);
    font-size: .75rem;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 3px 3px 8px #000;
    transition: all 0.1s ease;
    z-index: 1;
    border: 1px solid hsl(0, 50%, 35%);
}

.mini-inner-button {
    width: 20px !important;
    height: 20px !important;
    font-size: 1.2rem;
    border: none !important;
    border-color: none !important;
}

.inner-button:active {
    box-shadow: none;
    transform: translate(0px, 0px);
    border: 1px  !important;
    border-color: #290e0e !important;
    border-style: solid !important;
}

.inner-button:focus {
    outline: none;
}

.inner-button:active:focus {
    outline: none;
}

.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0; /* Remove gap */
}

.arcade-button-container {
    padding: 2px; /* Add padding around each button */
}

@media only screen and (max-width: 420px) {
    .arcade-button-container {
        padding: 2px;
    }
}

.timer-display {
    font-size: 20px;
    color: white;
}

.timer-section {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-color: #2c2c2c; 
    padding: 10px; 
    margin-bottom: 5px;
}

.timer-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0px; /* Add gap for spacing between the buttons */
    flex-wrap: nowrap; /* Ensure no wrapping occurs */
}
.score-section {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background-color: #2c2c2c; 
    padding: 5px 20px 20px 20px; 
    margin-bottom: 5px;
}

.score-section input[type="number"] {
    width: 60px;
    text-align: center;
    border-width: 3px;
    border-color: hsl(0, 50%, 35%);
}

.score-input {
    width: 60px;
    text-align: center;
    background-color: transparent; 
    padding: 10px; 
    margin: 0 5px; 
    flex: 1; 
    color: white;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 5px; /* Add space between the buttons */
}
.score-input[type=number] {
    -moz-appearance: textfield;
}

/* Ensure buttons are visible on all screen sizes */
.timer-btn, .submit, .inner-button, .arcade-button {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px; /* Add some margin to ensure space around buttons */
}

@media only screen and (max-width: 420px) {
    .timer-btn, .submit, .inner-button, .arcade-button {
        display: flex; /* Ensure flex display on small screens */
        justify-content: center;
        align-items: center;
    }
}

div.player-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Active Teams Section */
#active_teams_section {
    display: flex;
    flex-wrap: wrap;
}

.team-container input[type="radio"] {
    display: none;
}

.team-container label {
    background-color: transparent;
    padding: 0px;
    border: 0px;
    cursor: pointer;
}

.team-container label {
    padding: 0px 8px;
    margin: 0px 0px 0px 0px;
    background-color: #101010;
    border: 2px #d4d4d6;
      border-top-style: none;
      border-right-style: none;
      border-bottom-style: none;
      border-left-style: none;
    border-style: inset;
    border-radius: 10%;
}   

.team-container input[type="radio"]:checked + label {
    background-color: #b83e3e;
    color: white;
}

.team-container .new-team-label input[type="text"] {
    border: none;
    padding: 5px;
    width: 100%;
    color: #862d2d;
}

.team-container .new-team-entry {
    flex: 1 1 100%;
}

.team-container .team-entry {
    flex: 1 1 calc(50% - 10px);
    margin-bottom: 10px;
    background-image: url('/wp-content/plugins/king-of-soccer/assets/background/KOS-BG1-thmbunail.png');
    background-color: black !important;
}
