﻿@import "./shared.scss";

Menu {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    height: 100%;
    width: 100%;
    pointer-events: all;
    padding: 50px;

    z-index: 200;

    // text-shadow: 2px 2px 0 black, 4px 4px 0 black;

    font-family: Segoe UI;

    &.hidden {
        display: none;
        pointer-events: none;
    }

    &:not(.main-menu) {
        background-color: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(1px);
    }
}

.menu-buttons {
    flex-direction: column;
    // gap: 20px;
    align-items: flex-start;
    justify-content: flex-end;
    width: 100%;
    // max-width: 1200px;
    // height: 90%;
    // flex-grow: 0;
    // flex-shrink: 0;
    height: auto;
    flex-wrap: wrap;
}

.menu-button {
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;

    font-family: "Lilian";
    font-size: 34px;
    // font-weight: bold;

    text-shadow: 2px 2px 0 black, 4px 4px 0 black;

    margin: 4px 2px;
    cursor: pointer;

    width: 800px;

    border-left: 15px solid transparent;

    // flex-direction: column;

    font-smooth: never;
    
    gap: 15px;

    flex-shrink: 0;

    .label { mask-image: url("/ui/text-greyscale2.png"); }
    
    .value {
        color: yellow;
    }

    small {
        font-size: 20px;
        font-weight: normal;
    }

    &.disabled {
        color: rgba(255, 255, 255, 0.5);
        cursor: not-allowed;
    }

    &:hover, &:focus, &.focused {
        border-left-color: white;
        background-color: rgba(0, 0, 0, 0.3);
        sound-in: "sounds/menu/button-hover.sound";
    }

    &:active {
        border-left-color: black;
        text-shadow: none;
        sound-in: "sounds/menu/button-click.sound";
    }
}

.menu-slider {
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    font-family: "Lilian";
    font-size: 34px;
    // font-weight: bold;

    text-shadow: 2px 2px 0 black, 4px 4px 0 black;
    font-smooth: never;
    margin: 4px 2px;
    // cursor: pointer;

    width: 800px;
    border-left: 15px solid transparent;
    flex-direction: row;
    flex-shrink: 0;
    gap: 20px;

    .label {
        mask-image: url("/ui/text-greyscale2.png");
    }

    small {
        font-size: 20px;
        font-weight: normal;
    }

    &:hover, &:focus, &.focused {
        border-left-color: white;
        background-color: rgba(0, 0, 0, 0.3);
        sound-in: "sounds/menu/button-hover.sound";
    }
}

.message {
    border: none;
    color: white;
    padding: 10px 20px;

    background-color: rgba(0, 0, 0, 0.5);

    gap: 0.2em;

    flex-wrap: wrap;
    
    width: 100%;

    // flex-direction: column;
    small {
        font-size: 20px;
        font-weight: normal;
    }

    br {
        flex-grow: 1;
        width: 100%;
    }

    &.text-right {
        align-items: flex-end;
        justify-content: flex-end;
    }
}

$bounce-speed: 1s;
$bounce-delay: 0.1s;

h1.title {
    font-family: "Lilian";
    
    text-transform: uppercase;
    font-smooth: never;
    
    font-size: 160px;
    font-weight: bold;
    font-style: italic;
    
    // color: white;
    color: linear-gradient(90deg, red, orange );
    
    padding: 0 32px;
    // margin-bottom: 20px;

    text-shadow: 6px 6px 0 black, 4px 4px 0 black;
    
    /*.label { 
        mask-image: url("/ui/text-greyscale2.png");
    }*/
    
    span:nth-child(1) {
        animation: title $bounce-speed ease-in-out infinite;
    }
    
    span:nth-child(2) {
        animation: title $bounce-speed 0.1s ease-in-out infinite;
    }
    
    span:nth-child(3) {
        animation: title $bounce-speed 0.2s ease-in-out infinite;
    }
    
    span:nth-child(4) {
        animation: title $bounce-speed 0.3s ease-in-out infinite;
    }
    
    span:nth-child(5) {
        animation: title $bounce-speed 0.4s ease-in-out infinite;
    }
    
    span:nth-child(6) {
        animation: title $bounce-speed 0.5s ease-in-out infinite;
    }
    
    span:nth-child(7) {
        animation: title $bounce-speed 0.6s ease-in-out infinite;
    }
}

@keyframes title {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0);
    }
}

.cars {
    display: flex;
    flex-direction: row;
    // justify-content: center;
    align-items: center;
    position: absolute;
    left: 50px;
    top: 50px;
    max-width: 1200px;
    flex-wrap: wrap;
    gap: 20px;
}

.car-button {
    border: none;
    background-color: transparent;
    width: 250px;
    height: 250px;
    flex-shrink: 0;
    
    position: relative;

    &.disabled {
        // filter: grayscale(100%);
        cursor: not-allowed;

        img {
            opacity: 0.5;
        }
    }

    .locked-icon {
        position: absolute;
        top: 10px;
        left: 10px;
        color: white;
        font-size: 60px;
    }

    &:not(.disabled) {
        &:hover {
            background-color: rgba(229, 235, 253, 0.32);
            sound-in: "sounds/menu/button-hover.sound";
            cursor: pointer;
        }

        &:active {
            background-color: rgba(129, 154, 217, 0.32);
            sound-in: "sounds/menu/button-click.sound";
        }
    }
}

.cars .selected {
    background-color: rgba(129, 154, 217, 0.32);
}

.colors {

    width: 800px;
    height: 200px;
    flex-wrap: wrap;

    position: absolute;
    left: 50px;
    bottom: 250px;

    align-content: flex-end;

    gap: 2px;

    .color-button {
        flex-shrink: 0;
        width: 10%;
        height: 25%;
        cursor: pointer;
        // text-shadow: none;
        color: white;
        align-content: center;
        justify-content: center;

        border: 3px solid transparent;

        &:hover {
            sound-in: "sounds/menu/button-hover.sound";
            border-color: black;
        }

        &:active {
            sound-in: "sounds/menu/button-click.sound";
        }
    }

}

.leaderboard {

    flex-direction: column;
    flex-grow: 1;
    width: 100%;

    .rank {
        color: yellow;
        width: 100px;
    }

    .name {
        align-content: flex-start;
        align-items: flex-start;
        justify-content: flex-start;
        flex-grow: 1;
    }
    .me {
        color: lightgreen;
        .rank {
            color: lightgreen;
        }
    }
}

.issues {
    position: absolute;
    left: 50px;
    top: 50px;
    padding: 20px;
    flex-direction: column;
    color: white;
    font-family: Lilian;
    font-size: 30px;
    border: 5px solid white;
    border-radius: 10px;
    background-image-tint: red;
    h2 {
        font-size: 40px;
        font-weight: bold;
        font-family: "Lilian";
        gap: 15px;
        align-items: center;
        .icon {
           font-size: 35px;
        }
    }
}


/*.leaderboard {
    position: absolute;
    bottom: 150px;
    right: 50px;
    color: white;
    font-size: 22px;
    font-family: "Segoe UI Light";
    text-shadow: 1px 1px 0 black;

    flex-direction: column;

    h2 {
        font-family: Segoe UI;
        font-size: 30px;
        font-weight: bold;
        margin-bottom: 10px;
    }

    table {
        flex-direction: column;
        width: 400px;
    }

    column {
        display: flex;
        flex-direction: column;
        justify-content: center;
        // align-items: center;
        &.grow {
            flex-grow: 1;
        }

        gap: 10px;

        &.rank {
            font-weight: bold;
            // font-size: 15px;
        }
    }

    row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;

        &.me {
            color: yellow;
        }
    }
}*/

.levels {
    position: absolute;
    left: 50px;
    top: 50px;
    color: white;
    font-size: 30px;

    max-width: 1200px;
    flex-wrap: wrap;

    font-family: Roboto;

    .level-button {
        border: none;
        background-color: transparent;
        width: 300px;
        height: 350px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        
        position: relative;

        .preview {
            width: 70%;
            height: 60%;
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;
        }

        small {
            font-size: 20px;
            font-weight: normal;
        }

        &.disabled {
            // filter: grayscale(100%);
            cursor: not-allowed;

            .preview {
                opacity: 0.5;
            }

            span, small {
                color: rgba(255, 255, 255, 0.8);
            }
        }

        .locked-icon {
            position: absolute;
            top: 10px;
            left: 10px;
            color: white;
            font-size: 60px;
        }

        &:not(.disabled) {

            &:hover {
                background-color: rgba(203, 211, 225, 0.32);
                sound-in: "sounds/menu/button-hover.sound";
                cursor: pointer;
            }

            &:active {
                // background-color: rgba(129, 154, 217, 0.32);
                sound-in: "sounds/menu/button-click.sound";
            }

        }

        &.selected {
            background-color: rgba(46, 66, 117, 0.32);
        }
    }
}

.notice {
    border: none;
    color: white;
    padding: 15px 32px;

    font-family: "Kode Mono";
    font-size: 30px;
    // font-weight: bold;

    margin: 4px 2px;

    width: 800px;

    border-left: 15px solid transparent;

    background-color: rgba(194, 89, 89, 0.3);

    // flex-direction: column;
    small {
        font-size: 20px;
        font-weight: normal;
    }
}

.controls {
    position: absolute;
    bottom: 50px;
    right: 50px;
    color: white;
    font-size: 35px;
    font-family: "Lilian";
    text-shadow: 2px 2px 0 black;
    font-smooth: never;

    gap: 50px;

    div {
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: center;

        img {
            width: 50px;
            height: 50px;
        }
    }

}

/*.car-stats {
    position: absolute;
    top: 50px;
    right: 50px;
    color: white;
    font-size: 40px;
    font-family: "Roboto";
    text-shadow: 1px 1px 0 black;

    gap: 10px;
    flex-direction: column;
    align-content: flex-end;
    justify-content: flex-end;
    align-items: flex-end;

    h2 {
        font-size: 60px;
        font-weight: bold;
        font-family: "Rubik Mono One";
        gap: 10px;
    }

    ul {
        flex-direction: column;
        gap: 10px;

        li {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 30px;

            strong {
                font-weight: bold;
            }
        }
    }

}*/

.challenges {
    position: absolute;
    top: 50px;
    left: 50px;
    color: white;
    font-size: 25px;

    gap: 10px;
    width: 1000px;

    flex-direction: column;

    /* .challenge-button {
         flex-direction: column;
 
         padding: 15px;
         background-color: rgba(0, 0, 0, 0.5);
 
         font-family: Roboto;
         // text-shadow: none;
 
         gap: 5px;
 
         h3 {
             font-size: 30px;
             font-weight: bold;
             gap: 10px;
             align-items: center;
         }
 
         &:hover {
             background-color: rgba(0, 0, 0, 0.6);
             sound-in: "sounds/menu/button-hover.sound";
             cursor: pointer;
         }
 
         &:active {
             background-color: rgba(0, 0, 0, 0.3);
             sound-in: "sounds/menu/button-click.sound";
         }
 
         &.selected {
             background-color: rgba(224, 209, 28, 0.3);
         }
 
 
     }*/

}



/*.info-box {

    color: white;
    font-size: 25px;

    width: 500px;
    flex-direction: column;

    align-content: flex-end;
    justify-content: flex-end;
    align-items: flex-end;

    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(1px);

    padding: 20px;

    gap: 5px;

    h2 {
        font-size: 30px;
        font-weight: bold;
        font-family: "Rubik Mono One";
    }

    ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;

        li {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 30px;

            strong {
                font-weight: bold;
            }
        }
    }

    table {
        flex-direction: column;
        width: 100%;
    }

    column {
        display: flex;
        flex-direction: column;
        justify-content: center;
        // align-items: center;
        &.grow {
            flex-grow: 1;
        }

        gap: 10px;

        &.rank {
            font-weight: bold;
            // font-size: 15px;
        }
    }

    row {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;

        &.me {
            color: yellow;
        }
    }

}*/

.unlock-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 20px;
    gap: 0.3em;
    background-color: rgb(219, 168, 38);
    color: white;
    text-shadow: 2px 2px 2px #d27535;
    // flex-shrink: 0;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    align-content: center;

    transform: rotate(-4deg);

    &:hover {
        background-color: rgb(149, 110, 70);
        sound-in: "sounds/menu/button-hover.sound";
        transform: rotate(-6deg);
    }

    &:active {
        background-color: rgb(219, 168, 38);
        sound-in: "sounds/menu/button-click.sound";
        transform: rotate(-2deg);
    }

    &.error {
        background-color: rgb(205, 53, 53);
        color: #f6e6e6;
    }

    .icon {
        font-size: 25px;
    }

    span {
        font-size: 20px;
        font-weight: bold;
    }
}

.sbux-button {
    position: absolute;
    bottom: 10px;
    left: 10px;
    
    height: 32px;
    width: 32px;
    
    opacity: 1;
    
    cursor: pointer;
    
    align-items: center;
    justify-content: center;
    
    img {
        width: 100%;
        height: 100%;
        background-size: contain;
    }
    
    transition: transform 0.2s;
    
    &:hover {
        transform: scale(1.1);
    }
    
}
    
.social {
    position: absolute;
    bottom: 120px;
    right: 50px;
    color: white;
    font-size: 30px;
    font-family: "Lilian";
    text-shadow: 1px 1px 0 black;

    ul {
        flex-direction: column;
        gap: 5px;
    }

    ul li {
        gap: 10px;
    }
}

credits {
    h3 {
        font-size: 30px;
        font-weight: bold;
        font-family: "Lilian";
    }
}