/*  =================
    Table of Contents
    =================
    
    1. Map page
    2. Hole page
    3. Scorecard
    
*/

/*  =================
    1. Map page
    ================= */

.map {
    grid-column: 1 / 4;
    grid-row: 3 / 5;
    position: relative;
}

/* We will hide this for portrait and set to block for landscape */
.mapLandscape {
    display: block;
    height: fit-content;
}

/* We will hide this for landscape and set to block for portrait */
.mapPortrait {
    display: none;
}

.mapLandscape svg,
.mapPortrait svg {
    position: absolute; /* Need to have absolute positioning because there are 2 svg elements - the map and the backgorund which need to sit on top of one another */
    /* Center it */
    top: 0;
    left: 50%;
    transform: translate(-50%, 0);
}

.mapLandscape svg {
    height: 100%;
    max-width: 100%;
}

.mapPortrait svg {
    width: 100%;
    max-height: 100%;
}

.map .background {
    /* Set the backgorund to be behind the map */
    z-index: -1;
}

svg a {
    -webkit-tap-highlight-color: rgba(127, 127, 127, 0.25); /* Change the blue box when clicking on a hole */
}

.roundButtons {
    position: absolute;
    top: 25%;
    left: 75vw;
    display: flex;
    flex-direction: column;
    row-gap: 0.5em;
    font-size: 16px;
}

.roundButtonWrapper {
    display: flex;
    align-items: center;
    align-self: flex-end;
    width: max-content;
}

.roundButtonWrapper img {
    /* filter: invert(15%) sepia(33%) saturate(4848%) hue-rotate(258deg) brightness(96%) contrast(129%); */
    height: 0.75em;
}

.roundButtonWrapper.smallImage img {
    height: 0.65em;
}

.roundButtonContent {
    font-size: 1em;
    color: var(--black);
    background: var(--orange1);
    margin: 0;
}

.roundButtonWrapper .unfinished {
    background: var(--grey2);
}

.finishRoundButtonWrapper .finished {
    background: var(--orange2);
}

.roundButtonContent img {
    padding-right: 0.5em;
}


/*  =================
    2. Hole page
    ================= */

.holeForm {
    grid-template-rows: 0.5fr minmax(3em, auto) 0.5fr minmax(3em, auto) 1fr;
    /* There are grid columns in the margin to set the max width of the fields */
    grid-template-columns: 1fr 50fr 50fr 1fr;
}

.holeContentWrapper {
    grid-row: 2;
}

.formHoleTitle {
    font-weight: bold;
    font-size: 1.5em;
    margin-bottom: 0.5em;
}

.formHoleDetails {
    list-style-type: none;
    padding-left: 1em;
}

.formHoleDetails span {
    color: var(--blue1);
}

.formHoleDetails .personalBest {
    color: var(--grey2);
}

.formHoleDetails .personalBest span {
    color: var(--blue2);
}

.formHoleDetails .yards {
    padding-top: 0.5em;
}

.formHoleDiagram {
    width: 70%;
    max-width: 40vh; /* Canonot set a max height here, so using the aspect ratio instead (which is consistent across all formHoleDiagrams) */
    margin: auto;
    padding-top: 1em;
    padding-bottom: 2em;
}

.holeForm .formLabel {
    margin: auto;
    width: max-content;
    font-size: 0.7em;
    color: var(--grey2);
}

.formInput .numberIncrement {
    margin-left: auto;
    margin-right: auto;
    width: max-content;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
}

.formInput .numberIncrement input {
    text-align: center;
    width: 4em;
}

.numberIncrement .incrementer {
    background-color: var(--orange2);
    padding: 0.25em;
    padding-left: 0.4em;
    padding-right: 0.4em;
    margin: 0.25em;
}

.numberIncrement .incrementer a {
    
}

.numberIncrement .incrementer img {
    transform: translate(0, 0.15em);
}

.holeButtonWrapper {
    grid-row: 4;
    font-size: 0.75em;
}

.holeButtons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 1em;
    row-gap: 0.5em;
    justify-content: center;
}

.hiddenFormInput {
    display: none;
}

.formHoleButtonPrev,
.formHoleButtonNext {
    min-width: 6em !important;
}

.formHoleButtonPrev img {
    padding-right: 0.5em;
    filter: invert(85%) sepia(33%) saturate(0%) hue-rotate(337deg) brightness(100%) contrast(73%);
    height: 0.75em;
}

.formHoleButtonNext img {
    padding-left: 0.5em;
    filter: invert(85%) sepia(33%) saturate(0%) hue-rotate(337deg) brightness(100%) contrast(73%);
    height: 0.75em;
}

.formHoleButton,
.formHoleFinishButton {
    min-width: auto !important;
}

.formHoleButton img,
.formHoleFinishButton img {
    padding-right: 0.5em;
    filter: invert(85%) sepia(33%) saturate(0%) hue-rotate(337deg) brightness(100%) contrast(73%);
    height: 0.75em;
}

.holeButtonBreak {
    flex-basis: 100%;
    height: 0;
}

.formHoleFinishButton {
    background-color: var(--orange2) !important;
    color: var(--black) !important;
}

.formHoleFinishButton img {
    filter: initial;
}


/*  =================
    3. Scorecard
    ================= */

.scorecardButtonWrapper {
    position: absolute;
    top: 7em;
    left: 3em;
    transform: translate(0, 0);
    display: flex;
    align-items: center;
    justify-content: left;
}

.scorecardButtonContent {
    color: var(--black);
    background: var(--grey2);
    margin: 0;
}

.scorecardButtonContent img {
    height: 0.75em;
    filter: initial;
}

.scorecardTableButtonContent {
    background: var(--grey2);
}

.scorecard {
    position: absolute;
    background-color: var(--grey1);
    width: 30%;
    height: fit-content;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    flex-direction: column;
    box-shadow: 2px 2px 5px var(--grey1);
    padding: 1em;
    display: none;
    z-index: 9999;
}

.scorecard table {
    height: fit-content;
    border-color: var(--grey3);
    margin: initial;
}

.scorecard table a {
    color: var(--grey3);
    text-decoration: none;
}

.scorecard .tableWrapper {
    position: relative;
    max-width: calc(75vw - 2em);
}

.scorecard .tableWrapper td {
    min-width: 4.5em;
}

.scorecard .tableWrapper td:first-child {
    min-width: 1em;
}

.tableWrapper .tableScroll {
    overflow-x: auto;
    overflow-y: hidden;
}

.scorecardTotal {
    color: var(--blue2);
}

.scorecardButtonDeleteWrapper {
    margin: auto;
    width: max-content;
    padding-top: 1.5em;
}


/*  =================
    101. Portrait media changes
    ================= */

@media screen and (orientation:portrait)
{
    .mapLandscape {
        display: none;
    }

   .mapPortrait {
        display: block;
    }

   .scorecardButtonWrapper {
        top: initial;
        bottom: 0.75em;
        left: 0.75em;
    }

    .scorecard {
        width: 75vw;
    }

   .roundButtons {
        top: 6em;
        left: 50%;
        transform: translate(calc(-50% - 6.5em));
        font-size: 0.85em;
    }

    .roundButtonWrapper {
        align-self: flex-start;
    }
}

/*  =================
    102. Desktop media changes
    ================= */

@media screen and (min-width: 1000px) {
    .holeForm {
        grid-template-columns: 1fr 250px 250px 1fr; /* Consistent form field width above a certain screen width */
    }
    
    .startRoundButtonWrapper,
    .finishRoundButtonWrapper {
        position: absolute;
        display: none;
    }

    .scorecardButtonWrapper {
        top: initial;
        bottom: 0.75em;
        left: 50%;
        transform: translate(calc(-50% - 15em));
    }
}