*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url("images/tennisballcursor.png") 12 12, auto; /* custom tennis ball cursor */
    font-family: "Roboto Condensed", sans-serif;
}

/* page layout */
body{
    width: 100vw;
    height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    background-image: url("images/tenniscourtclay.png"); /* background image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* title */
h1{
    font-size: 8vh;
    font-weight: bold;
    color: #5b0f00;
    margin-top: 8vh;
    margin-bottom: 1vh;
    text-align: center;
}

/* court area (main content container) */
.court-area{
    width: 68vw;
    height: 58vh;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2vh 2vw;

}

/* toolbar (contains the "Generate Lineups" button and the message when no lineup is present) ── */
.toolbar{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2vw;
    margin-bottom: 3vh;
    flex-wrap: wrap;
}

.generate-btn{
    background: white;
    border: 2px solid #5b0f00;
    padding: 2vh 2vw;
    font-size: 2vh;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    color: #5b0f00;
    margin-top: 2vh;
    margin-bottom: 0.5vh;
    width: fit-content;
}

.generate-btn:hover{
    background: #f0f0f0;
}

/* message displayed before "Generate Lineups" is clicked */
.hint-msg{
    color: white;
    font-size: 2.2vh;
    margin-top: 1vh;
}

/* scrollable pair cards row that contains all the pair cards */
.cards-row{
    display: flex;
    flex-direction: row;
    gap: 3vw;
    overflow-x: auto; /* horizontal scroll when cards overflow */
    overflow-y: hidden;
    padding-bottom: 1vh;
    height: 100%;
    align-items: flex-start;
}

/* custom scrollbar */
.cards-row::-webkit-scrollbar{
    height: 1vh;
}

.cards-row::-webkit-scrollbar-track{
    background: #ddd;
}

.cards-row::-webkit-scrollbar-thumb{
    background: #5b0f00;
}

/* pair card */
.pair-card{
    background: #e8b4a0;
    border: 2px solid #5b0f00;
    min-width: 20vw;
    max-width: 20vw;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2vh 1.5vw;
    flex-shrink: 0; /* prevents cards from shrinking when the row is full */
    text-align: center;
}

/* pair number in terms of ranking */
.pair-rank{
    font-size: 2vh;
    color: #85200c;
    font-style: italic;
    align-self: flex-start;
}

.pair-player-name{
    font-size: 3vh;
    font-weight: bold;
    color: #5b0f00;
    word-break: break-word;
}

/* '+' symbol between the player names */
.pair-plus{
    font-size: 2.8vh;
    font-weight: bold;
    color: #a61c00;
}

.pair-compat{
    font-size: 1.9vh;
    color: #85200c;
}

/* "View More" button on each pair card */
.view-more-btn{
    background: transparent;
    border: none;
    font-size: 2vh;
    color: #5b0f00;
    font-family: 'Roboto Condensed', sans-serif;
}

.view-more-btn:hover{
    color: #a61c00;
}

/* bottom bar containing the "Back" and "Information" buttons */
.bottom-bar{
    width: 88%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5vh 2vw;
    margin-top: auto;
    margin-bottom: 6.5vh;
}

.bottom-btn{
    background: white;
    border: 2px solid #5b0f00;
    padding: 1vh 2.5vw;
    font-size: 1.8vh;
    font-family: 'Roboto Condensed', sans-serif;
    color: #5b0f00;
}

.bottom-btn:hover{
    background: #f0f0f0;
}

/* popups */
/* darkened backdrop behind popups */
.overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

/* popup is visible when the open class is added through javascript */
.overlay.open{
    display: flex;
}

.popup-box{
    background: white;
    border: 2px solid #5b0f00;
    padding: 3vh 3vw;
    width: 40vw;
    min-width: 300px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto; /* enables scrolling if the popup content overflows vertically */
}

.popup-box h2{
    font-size: 2.5vh;
    font-weight: bold;
    margin-bottom: 2vh;
    color: #5b0f00;
}

.close-btn{
    position: absolute;
    top: 1vh;
    right: 1vw;
    background: none;
    border: none;
    font-size: 2.2vh;
    color: #5b0f00;
}

/* "View More" popup*/
/* displays player names side by side with a '+' in between them */
.view-pair-names{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5vw;
    margin-bottom: 2vh;
    font-size: 3vh;
    font-weight: bold;
    color: #5b0f00;
}

.view-plus{
    font-size: 3vh;
    color: #a61c00;
}

.compat-score{
    font-size: 2.3vh;
    color: #85200c;
    margin-bottom: 2vh;
    text-align: center;
}

/* creates a three column grid: player A stat | label | player B stat */
.stat-compare-header{
    display: grid;
    grid-template-columns: 1fr 28% 1fr;
    gap: 0.5vw;
    font-size: 2.3vh;
    font-weight: bold;
    color: #5b0f00;
    margin-bottom: 0.5vh;
    text-align: center;
}

.stat-compare-row{
    display: grid;
    grid-template-columns: 1fr 28% 1fr;
    gap: 0.5vw;
    align-items: center;
    padding: 0.5vh 0;
    border-bottom: 2px solid #eee;
}

/* player A stat value (red) */
.stat-val-left{
    text-align: right;
    color: #c0392b;
    font-size: 2.1vh;
}

/* player B stat value (blue) */
.stat-val-right{
    text-align: left;
    color: #2471a3;
    font-size: 2.1vh;
}

.stat-label-mid{
    text-align: center;
    color: black;
    font-size: 1.9vh;
}

/* displays each player's play style below their names */
.play-style-row{
    display: flex;
    justify-content: space-between;
    margin-top: 1.5vh;
    font-size: 1.9vh;
    color: black;
    font-style: italic;
}
