body {
    font-family: Arial, sans-serif;
    background-color: #222;
}
/* General styling for the player card */
.card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    min-width: 100px;
    height: 88%;
    padding: 5px;
    /*margin: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /*background-color: #fff;*/
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.square .card{
    height: calc(92vh * 0.23 * 0.88);
}
/* Styling the player image */
.card img {
    width: 120px;
    /* height: 70%; */
    object-fit: cover;
    margin-bottom: 10px;
    cursor: move;
    margin: 0;
    /* background-color: rgb(82, 82, 82); */
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
}

.card-text{
    border: 1px solid black;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    padding: 3px;
    min-width: 100px;
    text-align: center;
    min-height: fit-content;
}

.card-text:hover{
    background-color: lightblue;
    border-color: black;
    border-style: solid;
}

/* Styling the player name */
.player-name {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

/* Styling the player's value */
.value {
    font-size: 10px;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
}

.value.bet {
    color: green;
}

/* Styling the stats */
.stats {
    font-size: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
}

.stats .material-symbols-outlined {
    font-size: 10px;
    color: #888;
}

.field{
    position: relative;
    background-color: #009b55;
    width: 50vw;
    background-image: url("field.png");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.sub{
    width: 45vw;
}

.sub .line{
    border-top: #009b55 1px solid;
    margin-left: 0px;
}

.line{
    height: 23%;
    margin: 1% 0;
    display: flex;
    align-items: center;
    overflow-x: scroll;
    overflow-y: hidden;
}

#reset-button{
    cursor: pointer;
    position: absolute;
    top: 40px;
    right: 10px;
    background-color: rgb(50, 50, 50);
    border: solid 1px rgb(65, 65, 65);
    border-radius: 10px;
    height: 40px;
    width: 40px;
}

.square{
    display: none;
    width: 100%;
    grid-template-columns: repeat(auto-fill, 100px);
    gap: 40px;
    grid-template-rows: repeat(auto-fill, 23%);
    height: calc(25% * 4);
    padding: 5px;
    overflow: scroll;
}

.line::-webkit-scrollbar {
    display: none;
}

.line {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.field .line{
    justify-content: center;
}

:not(.field) .line .card{
    margin: 0 10px;
}

.area {
    height: 92vh;
    padding: 5px;
}

.card.swap-highlight .card-text{
    background-color: rgb(121, 215, 246);
    border-color: black;
}

.card.swap-valid:not(.swap-highlight) .card-text{
    background-color: rgb(149, 255, 120);
}

.card.swap-invalid{
    opacity: 0.6;
}

.card.dragging {
    opacity: 0.5;
}

.card {
    transition: transform 0.2s, background-color 0.2s, border-color 0.2s;
}

.data{
    display: flex;
    padding: 5px;
    margin-top: 1vh;
    color:lightgray;
    font-size: 20px;
    justify-content: space-between;
    margin: 5px;
    width: 45vw;
    height: 3vh;
}

#budget-expected{
    margin-left: 10px;
    font-size: 15px;
    line-height: 20px;
    opacity: 0.7;
}

#budget-expected.negative{
    color: red;
}

#budget-expected.positive{
    color: rgb(97, 255, 97);
}

.players{
    display: flex;
    height: 95vh;
    width: 100vw;
}

.money-left, .player-count{
    display: flex;
}

.title{
    margin-right: 5px;
}

.from-market .card-text, .offer .card-text{
    border: orangered 2px dashed !important;
}

#winning-value:not(.win, .loss, .neutral){
    color: gray;
    user-select: none;
}

#market-button{
    cursor: pointer;
    position: fixed;
    right: 50%;
    height: 50px;
    width: 100px;
    z-index: 100;
    background-color: rgb(50, 50, 50);
    color: white;
    font-size: large;
    border-radius: 10px;
    border: solid 1px rgb(65, 65, 65);
}

#market-button:hover{
    background-color: rgb(65, 65, 65);
}

#market-button.top{
    top: 5px;
}

#market-button.buttom{
    bottom: 5px;
}

.from-player .card-text{
    background-color: aquamarine !important;
    border: orangered 2px dotted;
}

.time-left{
    font-size: 10px;
    color: #666;
    font-weight: 500;
    margin-bottom: 10px;
    text-align: center;
    margin-left: 5px;
    font-weight: bold;
}

.time-left.short{
    color: orangered;
}

#leagues{
    margin-left: 1%;
    min-width: 98%;
    text-align: center;
    background-color: rgb(35, 35, 35);
}

#market-sort{
    display: none;
    margin-left: 20px;
    background-color: black;
}

#sort-buttons{
    margin-left: 20px;
    display: flex;
    align-items: center;
    gap: 0px;
}

.sort-button{
    background-color: black;
    color: white;
    border: white 1px solid;
    cursor: pointer;
    height: 30px;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    padding: 20px;
    font-weight: 600;
}

.sort-button.active, .sort-button:hover, #show-position.active{
    background-color: white;
    color: black;
}


#show-position span.check{
    display: none;
    margin-right: 7px;
    font-size: 15px;
    font-weight: bold;
}

#show-position.active span.check{
    display: inline;
}

.sort-button:nth-child(1){
    border-start-start-radius: 10px;
    border-end-start-radius: 10px;
}

.sort-button:nth-child(4){
    border-start-end-radius: 10px;
    border-end-end-radius: 10px;
}

select{
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position-x: 100%;
    background-position-y: 2px;  
    height: 30px;
    color: white;
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;

}

select:focus{
    outline: none;
}

.price{
    display: flex;
    justify-content: center;
}

.card.blank{
    width: 100px;
    height: 78%;
    font-size: xx-large;
}

.market.area{
    height: 95vh;
}

.market .line .card{
    cursor: pointer;
}

.market .line{
    border-top: lightgrey 1px solid;
}

.overlay-window {
    position: fixed; /* Stays on top of everything else */
    top: 50%; /* Align vertically */
    right: 0%; /* Align horizontally */
    transform: translate(-5%, -50%); /* Center the window */
    width: 45vw; /* Covers half the width of the screen */
    height: 90vh;
    background-color: rgba(83, 83, 83, 1); /* Slightly transparent white */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); /* Add a shadow for depth */
    z-index: 999; /* High z-index to appear above everything else */
    border-radius: 8px; /* Optional rounded corners */
    padding: 20px; /* Optional padding */
    box-sizing: border-box; /* Include padding in width and height */
    color: white;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: black;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.close-button:hover {
    background: #303030;
}

.image {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.top-data{
    display: flex;
    justify-content: space-between;
    height: 30%;
}

.links{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50%;
}

.links button{
    width: 80%;
    height: 30%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 10px;
    border: solid 2px black;
    border-radius: 10px;
    cursor: pointer;
}

.links button:hover{
    border-width: 4px;
}

#open-player-button{
    background-color: #cc0000;
}

#open-team-button{
    background-color: #006d5f;
}

.links button img{
    display: block;
    max-width: 70%;
    max-height: 70%;
    width: auto;
    height: auto;
}

.links button svg{
    position: relative;
    right: 0;
}

#overlay-image {
    width: 70%;
    height: 70%;
    object-fit: cover;
}

#overlay-name{
    text-align: center;
    font-size: x-large;
}

.data-field{
    border: black 2px solid;
    border-radius: 10px;
    padding: 10px;
    background-color: gray;
    color: black;
    width: 40%;
}

.games-overview{
    width: 90%;
    display: flex;
    justify-content: space-evenly;
    overflow-x: scroll;
}

.games-overview::-webkit-scrollbar {
    display: none;
}

#match-events{
    display: flex;
    justify-content: center;
    height: 15px;
    width: 100%;
    align-items: center;
    margin: 0 auto;
    border-radius: 5px;
    background-color: #24dc84;
}

.match-event-icon{
    width: 10px;
    height: 10px;
    margin: 0 5px;
}

.player-data{
    display: flex;
    justify-content: space-around;
}

span.win{
    color: #24dc84;
    font-weight: bold;
}

span.loss{
    color: rgb(202, 0, 0);
    font-weight: bold;
}

.game-data{
    user-select: none;
    margin: 0 5px;
    text-align: center;
    font-size: small;
    border: black 1px solid;
    min-width: 90px;
    width: fit-content;
    padding: 5px;
    border-radius: 5px;
    background-color: rgb(50, 50, 50);
    color: white;
}

.game-points{
    font-weight: bold;
}

.game-points.exelent{
    color: #e1bc37;
}

.game-points.verygood{
    color: #24dc84;
}

.game-points.good{
    color: #9ddd49;
}

.game-points.medium{
    color: #ee8728;
}

.game-points.bad{
    color: rgb(202, 0, 0);
}


#match-events.exelent{
    background-color: #e1bc37;
}

#match-events.verygood{
    background-color: #24dc84;
}

#match-events.good{
    background-color: #9ddd49;
}

#match-events.medium{
    background-color: #ee8728;
}

#match-events.bad{
    background-color: rgb(202, 0, 0);
}


.game-result{
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-result img{
    width: 50%;
    height: 50%;
}

.game-score{
    width: 50%;
}

.gameday{
    margin-bottom: 4px;
}

.game-date{
    margin-top: 10px
}


.axis path,
.axis line {
    fill: none;
    shape-rendering: crispEdges;
}

.line {
    fill: none;
    stroke-width: 2px;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    border-radius: 3px;
    pointer-events: none;
}

#chart{
    margin-top: 10px;
    width: 100%;
    height: 55%;
}

#games-container{
    display: flex;
    margin: 30px auto;
}

#games-container button{
    margin: 0 5px;
    background-color: rgb(50, 50, 50);
    color: white;
    border-radius: 10px;
}

.trend-icon{
    height: fit-content;
    padding: 1px;
    border-radius: 25%;
    font-size: 10px;
    margin-left: 2px;
    font-weight: bold;
}

.trend-icon.up{
    background-color: #24dc84;
}

.trend-icon.down{
    background-color: rgb(255, 92, 92);
}
  
/* Login overlay styling */
#login-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 900;
}

/* Login window styling */
#login-window {
    width: 320px;
    color: #fff;
    text-align: center;
}

#login-window h2 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Form styling */
.input-container {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.input-container input {
    width: 100%;
    padding: 10px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #555;
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.input-container input:focus {
    border-bottom: 1px solid #fff;
}

.input-container label {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 1rem;
    color: #999;
    transition: 0.3s ease-in-out;
    pointer-events: none;
}

.input-container input:focus + label,
.input-container input:not(:placeholder-shown) + label {
    top: -15px;
    font-size: 0.8rem;
    color: #fff;
}

/* Button styling */
form button {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background-color: #333;
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

form button:hover {
    background-color: #555;
}


#login-error {
    color: #f00;
    margin-top: 10px;
    font-size: 0.9rem;
}

.nextMatchday{
    background-color: #bcbcbc;
    border-color: rgb(255, 69, 69);
    border-style: dashed;
    border-width: 2px;
}

#market-settings{
    display: flex;
}

#show-position{
    margin: 0 30px;
    background-color: black;
    color: white;
    font-size: 17px;
    border: white 1px solid;
    border-radius: 10px;
    width: 200px;
    cursor: pointer;
}

.button-overlay {
    position: absolute;
    top: -50%;
    left: 0;
    width: 100%;
    height: 25%;
    background-color: rgba(0, 128, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: top 0.3s ease;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.card:hover .button-overlay {
    top: 0;
}

.card .status {
    position: absolute;
    top: 10%;
    right: 0;
    color: white;
    cursor: all-scroll;
}

.sub .card.save img{
    background-color: rgb(161, 161, 161);
}

.card.save .button-overlay path{
    d: path("M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Z")
}

.field .card.from-market .button-overlay,
.sub .card.from-market .button-overlay {
    background-color: rgba(128, 0, 0, 0.7);
}

.field .card.from-market .button-overlay:hover,
.sub .card.from-market .button-overlay:hover {
    background-color: rgba(128, 0, 0, 0.9);
}

.sub .card:not(.from-market) .button-overlay{
    background-color: rgba(128, 128, 0, 0.7);
}

.sub .card:not(.from-market) .button-overlay:hover{
    background-color: rgba(128, 128, 0, 0.9);
}

.field .card:not(.from-market) .button-overlay{
    display: none;
}

.button-overlay:hover {
    background-color: rgba(0, 128, 0, 0.9);
}

.value-row{
    display: flex;
}

.value-row svg{
    height: 17px;
    cursor: pointer;
}

.value-row input{
    background: none;
    border: none;
    height: fit-content;
    padding: 0;
    margin: 0;
    max-width: fit-content;
    display: none;
}

.value-row input:focus{
    outline: none;
}

.value-row #value-title{
    margin-right: 5px;
}

.position-text{
    writing-mode: vertical-lr;
    color: white;
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: #222;
    height: 100%;
    text-align: center;
    margin: 0;
    padding: 5px;
}

.prob {
    position: absolute;
    top: 45%;
    height: 10px;
    left: 40%;
}

.prob-icon {
    color: white;
    border-radius: 50%;
    fill: white;
}

.prob-icon.p-1 {
    background-color: #0e6efc;
    font-variation-settings:
    'FILL' 1,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24
}

.prob-icon.p-2 {
    background-color: #24dc84;
}

.prob-icon.p-3 {
    background-color: #ea871d;
}

.prob-icon.p-4 {
    background-color: #e20000;
}

.prob-icon.p-5 {
    background-color: #2f292f;
}

.card .team-icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    position: relative;
    left: 0;
    top: 10px;
}

.profile-image{
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
    margin-top: 5px;
}

@media (max-width: 600px) {
    #market-button, #budget-expected {
        display: none;
    }
    .field .card-text{
        margin-top: -10px;
        background: rgba(106, 106, 106, 0.607);
        border: none;
        z-index: 10;
        min-width: 16vw;
        padding: 2px;
        border-top-right-radius: 0;
        border-top-left-radius: 0;
    }

    .field .card.from-player .card-text :not(.player-name){
        color: black;
    }
    .field .card-text div{
        color: white;
        font-size: 8px;
    }
    .field .card-text span{
        color: white;
    }
    .field .card-text .trend-icon, .field .card-text .time-left{
        display: none;
    }
    .field .prob {
        left: 45%;
        top: 48%;
    }
    .sub .prob {
        left: 42%;
        top: 48%;
    }
    .field .prob-icon{
        font-size: 10px;
    }
    .sub .prob-icon{
        font-size: 20px;
    }
    .field .player-name{
        font-size: 9px;
        margin-top: 0;
        width: 100%;
        background-color: rgba(86, 86, 86, 0.734);
        color: white;
        font-size: bold;
    }
    .sub{
        display: flex;
        flex-direction: row-reverse;
        height: 18vh;
        width: fit-content;
        max-width: 97%;
        overflow-x: scroll;
        padding: 0;
    }
    .field .line .card {
        width: 16vw;
        height: 100%;
        min-width: 0;
        margin: 0;
    }
    .sub .line:has(> :last-child:nth-child(1)){
        display: none;
    }

    .field .card img {
        /* clip-path: circle(45%); */
        /* background-color: #00e77e; */
        width: 16vw;
        height: 17vw;
    }
    
    /* #main-screen .button-overlay{
        display: none;
    } */
    .field .line{
        width: 100%;
    }
    .sub > div{
        height: 100%;
        width: fit-content;
        overflow: visible;
    }
    .sub .line{
        margin: 0;
        border: none;
    }
    .players{
        flex-direction: column;
        height: fit-content;
    }
    .field{
        width: 97%;
        height: 72vh;
    }
    body{
        margin: 0;
        overflow: hidden;
    }
    /* .market.area{
        display: none;
    } */
    .data{
        width: 90vw;
    }
    .player-count {
        top: 5px;
        right: 5px;
    }
    .overlay-window {
        width: 100vw;
        overflow-x: scroll;
        height: 100vh;
        transform: translate(0, -50%);
        border-radius: 0;
    }
    .player-data{
        flex-direction: column;
        /* align-items: center; */
        gap: 10px;
    }
    .data-field{
        width: 90%;
        height: fit-content;
    }
    .point-data{
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .point-data br{
        display: none;
    }
    #chart{
        height: 10vh;
        width: auto;
    }

    #screens {
        display: flex;
        flex-direction: row;
        overflow: scroll;
        scroll-snap-type: x mandatory;
    }

    #screens > div {
        width: 100vw;
        height: 100vh;
        scroll-snap-align: start;
    }

    .market.area {
        width: 100vw;
    }

    .button-overlay {
        top: 0 !important;
        width: 20%;
        height: 20%;
    }

    #market-settings{
        justify-content: space-around;
        /* position: relative; */
        /* bottom: -93vh; */
        /* height: 0; */
        /* z-index: 20; */
    }

    #sort-buttons, #show-position{
        margin: 0;
    }

    #show-position{
        padding: 10px;
        width: fit-content;
    }
}