/* First-time-use overlay styling */
.first-time-use {
    background: linear-gradient(165deg, rgb(56,140,204) 0%, rgb(48,44,116) 100%);
    color: white;
    justify-content: left;
    align-items: start;
    text-align: left;
    width: 67%; /* RESULTS SHOULD TAKE 2/3 of the width by default*/
    /* => INPUTS TAKE 1/3 by default */
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    color: white;
    font-size: clamp(1rem, 2vw, 1.75em);
    white-space: nowrap;
    overflow-y: auto;  
}

.first-time-content {
    max-width: 80%;
    padding: 2rem;
}

.first-time-content h2 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}
.first-time-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

/* Add separator line after h3 in first-time-use */
.first-time-content h3:after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3); 
    margin: 1.5rem 0;
}

.first-time-content p {
    font-size: 1.2rem;
    line-height: 1.6;
    white-space: normal; /* Allow text wrapping */
    color: rgb(240, 238, 238);
}

.first-time-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.first-time-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.step-number {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.first-time-button {
    background: white;
    color: rgb(48,44,116);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.first-time-button:hover {
    background: rgba(255,255,255,0.9);
    transform: scale(1.05);
}

.results-content {
    display: flex;
    flex-direction: row; /* Horizontal layout */
    flex-wrap: wrap; /* Wrap on small screens */
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

#desiredRange, #fullCharge, #stateOfCharge{
    font-size: 2.5em;
    font-weight: bold;
}

#currentOperatingRange, #energyToFullCharge, #energyNeededForRange{
    font-size: larger;
    font-weight: bold;
}

.left-side, .middle, .right-side {
    flex: 1;
    min-width: 250px;
    padding: 10px;
    box-sizing: border-box;
}

.oikea-puoli-sivusta{
    width: 67%; /* RESULTS SHOULD TAKE 2/3 of the width by default*/
    /* => INPUTS TAKE 1/3 by default */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto; /* This enables scrolling of right side of page */
    display: flex;
    color: white;
    font-size: clamp(1rem, 2vw, 1.75em);
}

#desiredRange{
    white-space: nowrap;;
}

.oikea-puoli-sivusta h1{
    margin: 0; /* Remove default margin from header1s*/
    font-size: clamp(1rem, 1.8vw, 1.5em);
    white-space: nowrap;  
}

.oikea-puoli-sivusta h5{
    font-size: clamp(0.8rem, 1.2vw, 1.5em);
    white-space: nowrap;
}

.spaced-div{
    margin-bottom: 30px;
}

.left-side, .middle, .right-side{
    display: flex;
    flex-direction: column;
    width: 33%;
    padding: 2vw;
}

.multiple-options{
    flex-direction: column;
}

.optionTextWrapper{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.option-text{
    font-size: 0.5em;
    text-align: right;
    display: inline-flex;
    align-items: center;
    margin-left: auto; /* Push to the right */
}
.option-span {
    font-size: 0.5em;
    text-align: right;
    display: inline-flex;
    margin-left: 5px;
}

.comparison-bar{
    height: 5px;
    width: 100%;
    border-radius: 10px;
    background-color: fuchsia;
}

.header-wrapper {
    display: flex;
    column-gap: 5px;
    align-items: baseline;
}

.results-tooltip-wrapper{
    display: flex;
    column-gap: 10px;
    align-items: center;
}

.header-span{
    font-size: 0.8em;
    color: lightgray;
    text-align: right;
    display: inline-flex;
    margin-left: 5px;
    display: none;
}

.left-side{
    background: linear-gradient(165deg, rgb(56,140,204) 0%, rgb(64,84,180) 100%);
}
.middle{
    background: linear-gradient(165deg, rgb(40,76,124) 0%, rgb(48,44,116) 100%);
}
.right-side{
    background: linear-gradient(165deg, rgb(64,100,188) 0%, rgb(64,52,172,1) 100%);
}

/* Inputs and results wrap when screen not wide enough */
@media screen and (max-width: 900px) {
    /*Possible fix to firsttimeuse scrolling being weird, remove scrolling from body when overlay is active */
    /* body:has(.first-time-use:not([style*="display: none"])) {
        overflow: hidden;
        width: 100%;
        height: 100%;
    }    */
    /*^^ commented 23.4.2025 - the above seemingly no longer required? */

    .first-time-use{
        height: 100%;
        width: 100%;
        z-index: 1000; /*Oikea-puoli-sivusta 999z-index, */   
    }
    
    .first-time-content {
        padding: 0 0 50px 0; /* Some padding for bottom so button is not at the screens edge in some cases */
        max-width: 90%; /* Adjust for mobile */
        margin: 0 auto; /* Center horizontally */
    }
    .first-time-content h2 {
        font-size: 5vh;
        margin-bottom: 0px;
    }
    .first-time-content h3 {
        font-size: 4vw;
        margin-bottom: 0px;
        text-transform: uppercase;
    }
    .first-time-content p {
        font-size: 4.5vw;
        line-height: 1.6;
        white-space: normal; /* Allow text wrapping */
        color: rgb(240, 238, 238);
    }
    .first-time-steps {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-bottom: 5px
    }
    .first-time-step {
        display: flex;
        align-items: center;
        gap: 5px;
        text-align: left;
        font-size: 3vw;
    }

    .results-content {     
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: scroll; /* This part makes it possible to swipe the results in mobile view */ 
        position: relative;
        scroll-snap-type: x mandatory;
        border-bottom-left-radius: 45px;
        border-bottom-right-radius: 45px;
        box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.3);
    }

    .mobile-divider-line{
    
        border-bottom: 1px solid rgb(160,180,220);
        margin-bottom: 15px;
    }

    .swipe-dots{
        /* position: absolute;
        top: 10px; */
        margin-top: auto;
        align-self: center;
        align-items: center;
        display: flex;
        gap: 0.5rem;
        z-index: 10;
    }

    .swipe-dots .dot{
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background-color: #ccc;
    }

    .left-side .swipe-dots .dot:nth-child(1),
    .middle .swipe-dots .dot:nth-child(2),
    .right-side .swipe-dots .dot:nth-child(3) {
    background-color: #333;
    }

    .left-side, .middle, .right-side {
        min-width: 100vw;
        padding: 2vh 4vh 2vh 4vh; /* Slightly more on sides */
        display: flex;
        flex-direction: column;
        justify-content: center;
        /*align-items: center;*/
        scroll-snap-align: start;

        /* min-height: 30vh; */ /* If too compact uncomment */
        max-height: 50vh;
        padding-bottom: 20px;
    }

    .oikea-puoli-sivusta {
        width: 100%;
        background-color: rgb(228, 228, 228); /* This matches the colour showing behind the rounded corners of results to the colour of input background */
        font-size: 1rem;
        display: flex;
        flex-wrap: wrap;
        z-index: 999;
        height: auto;
    }

    .oikea-puoli-sivusta h1 {
        font-size: 1em;
        margin-bottom: 0px;
    }

    .oikea-puoli-sivusta h5 {
        margin-top: 10px;
        font-size: 1em;
        margin-bottom: 5px;
        white-space: nowrap;
    }

    .header-wrapper{ 
        width: 50%;
        flex-wrap: wrap;
    }

    #header-span.header-span{
        /* white-space: wrap; */
        margin: 0;
    } 

    .mobile-comparison-wrapper{
        display: flex;
        flex-direction: row;
        align-items: baseline;
    }

    .comparison-bar{
        width: 50%;
    }

    .optionTextWrapper {
        margin-bottom: 5px;
        margin-right: 5px;
        width: 50%
    }

    .option-span{
        font-size: 0.75em;
    }

    .results-mobile-wrapper {
        display: flex;
        align-items: baseline;
    }

    #currentOperatingRange, #energyToFullCharge, #energyNeededForRange{
        margin-left: auto;
        margin-right: 0;
        margin-bottom: 0;
    }

    #desiredRange, #fullCharge, #stateOfCharge{
        font-size: 1.5em;
        font-weight: bold;
    }

    .spaced-div{
        margin-bottom: 5px; /* Increase this to make the gaps between different results bigger in their columns */
        margin-left: auto;
        margin-right: 0;
    }

}