/* Settings */
:root{
    --body-text-size: var(--fs-300);
    --fs-button-small: var(--fs-200);
    --fs-button-medium: var(--fs-200);

    --body-text-color: var(--clr-k-500);
    --headline-color: var(--clr-k-800);

    --section-border-radius:4px;
    --button-border-radius:2px; 

    --section-padding: var(--size-100);
    --device-padding: var(--size-300);
}

/* Default Inheritage */
body{
    background-color: var(--clr-k-200);

    font-family: var(--ff-secondary);
    font-size: var(--body-text-size);
    font-weight: var(--fw-100);
    line-height: 1.3;
    color: var(--clr-k-600);
}

h1,h2,h3,h4,h5,h6{
    font-family: var(--ff-primary);
    color: var(--headline-color);
    font-weight: var(--fw-200);

    text-wrap: balance;

    & > span.headline-row{
        display: block;
    }
}

h1{
    letter-spacing: -2px;
}

p{
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;

    text-wrap: pretty;
}

a{
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;

    cursor: pointer;

    display: inline;
    gap: inherit;
}


/* Buttons */
    /* Button Reset */
    button{
        border: none;
        margin: 0;
        padding: 0;
        width: auto;
        overflow: visible;
        cursor: pointer;

        background: transparent;

        outline:none;

        /* inherit font & color from ancestor */
        color: inherit;
        font: inherit;

        /* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */
        line-height: normal;
        text-align: inherit;
        text-wrap: nowrap;

        /* Corrects font smoothing for webkit */
        -webkit-font-smoothing: inherit;
        -moz-osx-font-smoothing: inherit;

        display: flex;
        align-items: center;
    }

    /* Remove excess padding and border in Firefox 4+ */
    &::-moz-focus-inner {
        border: 0;
        padding: 0;
    }

    /* My Buttons */
    button{
        display: flex;
        justify-content: center;

        border-radius: var(--button-border-radius);
        font-size: var(--button-font-size);
        font-weight: var(--fw-300);
        color: var(--clr-k-800);

        /* Button Sizes */
        &.small{
            padding: 8px 14px;
            font-size: var(--fs-button-small);

            &:has(img){
                padding-right: 16px;
                column-gap: 12px;
            }
        }

        &.medium{
            padding: 14px 24px;

            &:has(img){
                padding-right: 20px;
                column-gap: 8px;
            }             
        }

        /* Button Type */
        &.solid{
            color: white;

            &.primary{
                background-color: var(--clr-primary-900);

                &:disabled, &[disabled]{
                    background-color: var(--clr-primary-500);
                }
            }
            &.secondary{
                background-color: var(--clr-k-800);

                &:disabled, &[disabled]{
                    background-color: var(--clr-k-500);
                }
            }
        }

        &.outline{
            &.primary{
                border: 1px solid var(--clr-primary-900);
                color: var(--clr-primary-900);

                &:disabled, &[disabled]{
                    color: var(--clr-primary-500);
                    border-color: var(--clr-primary-500);
                }
            }
            &.secondary{
                border: 1px solid var(--clr-k-300);
                color: var(--clr-k-800);

                &:disabled, &[disabled]{
                    color: var(--clr-k-500);
                    border-color: var(--clr-k-300);
                }
            }
        }

        /* Full Width */
        &.full{
            width: 100%;
        }

        &:disabled, &[disabled]{
            cursor: not-allowed;
        }

        &.stop{
            background-color: var(--clr-r-500) !important;
        }

    }

    /* Input Fields */
    input{
        font-family: var(--ff-secondary);
        font-size: var(--fs-200);
        color: var(--clr-k-800);
        outline: none;
        border:none;
        max-width: 100%;

        &.search-bar{
            background-image: url(../materials/icons/icon-search.svg);
            background-position: calc(100% - 16px); 
            background-repeat: no-repeat;
        }
    }

/* Input Fields */
    input{
        padding: var(--size-200);
        background-color: var(--clr-k-100);
        border: 1px solid var(--clr-k-200);

        font-size: var(--fs-150);
        font-weight: var(--fw-200);

        &:focus{
            border: 1px solid var(--clr-primary-500);
        }
    }
 

/* Layout */
main{
    position: relative;
    display: flex;
    flex-direction: column;

    height: 100dvh;
    max-width: 480px;

    margin: auto;

    overflow: visible;

    & > .main-cont{
        display: flex;
        flex-direction: column;

        height: 100%;
        padding: var(--section-padding);
        overflow: hidden;

        & > .wrapper{
            display: flex;
            flex-direction: column;
            justify-content: space-between;

            height: 100%;
            padding: var(--size-300);
            background-color: white;
            overflow-y: scroll;


            & > .station-container{
                display: flex;
                flex-direction: column;

                & > .station-data{
                    padding-bottom: var(--size-650);
                    border-bottom: 1px solid var(--clr-k-200);
                    padding-top: var(--size-300);

                & > .adress{
                    font-size: var(--fs-300);
                    font-weight: var(--fw-300);
                    color: var(--headline-color);

                    padding-bottom: var(--size-050);
                }

                & > .station-labels{
                    display: flex;
                    flex-wrap: wrap;
                    gap: var(--size-100);
                    padding-top: var(--size-300);

                    & > .label{
                        display: flex;
                        gap: var(--size-100);
                        align-items: center;

                        padding-inline: var(--size-200);
                        padding-block: var(--size-050);
                        background-color: var(--clr-k-100);
                        border: 1px solid var(--clr-k-300);

                        font-weight: var(--fw-300);
                        color: var(--headline-color);
                        text-wrap: nowrap;

                        & > img{
                            height: 12px;
                        }
                    }
                }
                }
                
                & > .station-control{
                    display: flex;
                    flex-direction: column;
                    gap: var(--size-500);

                    padding-block: var(--size-650);

                    & > h2{
                        font-size: var(--fs-200);
                        font-weight: var(--fw-300);
                    }

                    & > .socket-container{
                        display: flex;
                        flex-direction: column;
                        gap: var(--size-100);

                        & > button.socket{
                            width: 100%;
                            display: flex;
                            justify-content: space-between;

                            padding: var(--size-300);
                            background-color: white;
                            border: 1px solid var(--clr-k-300);
                            border-radius: var(--section-border-radius);                            

                            & > .data{
                                display: flex;
                                flex-direction: column;
                                gap: var(--size-100);

                                & > .status{
                                    display: flex;
                                    align-items: center;
                                    gap: var(--size-100);                                    

                                    &::before{
                                        content: '';
                                        width: 8px;
                                        height: 8px;
                                        border-radius: var(--button-border-radius);   
                                        background-color: var(--clr-k-800);                                     

                                    }

                                    &::after{
                                        content: 'Content';
                                        color: var(--body-text-color);
                                        font-size: var(--fs-150);
                                    }
                                }
                            }
                        }

                        & > button.socket.unavailable{
                            background-color: var(--clr-k-100);
                            cursor: not-allowed;

                            & > img{
                                display: none;
                            }

                            & .status::before{
                                background-color: var(--clr-r-500);
                            }
                            & .status::after{
                                content: 'Unavailable';
                            }
                            
                        }

                        & > button.socket.available{
                            filter: drop-shadow(0 0 16px rgba(0, 0, 0, 0.08));

                            & .status::before{
                                background-color: var(--clr-g-500);
                            }
                            & .status::after{
                                content: 'Available';
                            }
                            
                        }
                    }
                }
            }

            & > .charging-control{
                display: flex;
                flex-direction: column;
                justify-content: end;

                height: 100%;
                padding-bottom: var(--size-650);

                & > .charging-data{
                    display: flex;
                    flex-direction: column;
                    padding-block: var(--size-650);

                    & > div{
                        display: flex;
                        justify-content: space-between;
                        padding-block: var(--size-400);
                        border-bottom: 1px solid var(--clr-k-200);

                        & > .label{
                            font-size: var(--fs-200);
                            font-weight: var(--fw-100);
                        }

                        & > .value{
                            font-size: var(--fs-200); 
                            font-weight: var(--fw-300);
                            color: var(--clr-k-800);

                            &.price{
                                font-size: var(--fs-400);
                            }
                        }
                    }
                }

                &:not(:has(button)){
                    padding-bottom: 0;

                    & > .charging-data{
                    padding-block: var(--size-300);
                        
                        & > div:last-child{
                            border-bottom: none;
                        }
                    }
                } 
            }

            & > .register-cont{
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                gap: var(--size-650);
                height: 600px;

                padding-bottom: var(--size-650);

                & .data{
                    display: flex;
                    flex-direction: column;
                    gap: var(--size-300);
                    align-items: self-start;

                    padding: var(--size-300);
                    background-color: var(--clr-k-100);

                    & > p{
                        color: var(--body-text-color);
                        font-size: var(--fs-200);
                        font-weight: var(--fw-200);
                    }
                }

                & > form.register{
                    display: flex;
                    flex-direction: column;
                    padding-top: var(--size-300);


                    & > .input-field{
                        width: 100%;
                        display: flex;
                        flex-direction: column;
                        gap: var(--size-100);
                        padding-bottom: var(--size-400);

                        &:last-of-type{
                            padding-bottom: var(--size-650);
                        }

                        & > label{
                            font-size: var(--fs-200);
                            font-weight: var(--fw-200);
                            color: var(--clr-k-800);
                        }

                        &:after{
                            content: 'Login Error Message';
                            color: var(--clr-r-500);
                            font-size: var(--fs-100);
                            font-weight: var(--fw-200);
                            padding-left: var(--size-100);

                            display: none;
                        }
                    }
                }
            }

            & > .report-problem{
                display: flex;
                flex-direction: column;

                & > h2{
                    font-size: var(--fs-300);
                    font-weight: var(--fw-300);
                }

                & > form{
                    display: flex;
                    flex-direction: column;
                    gap: var(--size-100);
                    justify-content: space-between;

                    padding-block: var(--size-300) var(--size-650);

                    & > .form-container{
                        display: flex;
                        flex-direction: column;
                        gap: var(--size-100);

                        & > .radio-field{
                            display: flex;

                            border: 1px solid var(--clr-k-200);
                            padding: var(--size-300) var(--size-200);

                            color: var(--clr-k-800);
                            font-weight: var(--fw-200);

                            & > label{
                                width: 100%;
                            }

                            & > input{
                                position: absolute;
                                opacity: 0;
                                cursor: pointer;
                                height: 0;
                                width: 0;

                                &:checked + span.radio > span{
                                    background-color: var(--clr-primary-900);
                                }
                            }

                            & > span.radio{
                                display: flex;
                                align-self: center;
                                align-items: center;
                                justify-content: center;

                                width: 24px;
                                aspect-ratio: 1 / 1;
                                background-color: var(--clr-k-300);
                                border: 1px solid var(--clr-k-400);                         
                                border-radius: 50%;

                                & > span{
                                    width: 16px;
                                    aspect-ratio: 1 / 1;
                                    background-color: var(--clr-k-300);
                                    display: block;
                                    border-radius: 50%;
                                }
                            }

                            &:has(#else:checked) + textarea{
                                display: block;
                            }
                        }

                        & > textarea{
                            width: 100%;
                            height: 120px;
                            display: none;

                            border: 1px solid var(--clr-k-200);
                            border-radius: var(--button-border-radius);
                            resize: none;
                            padding: var(--size-300);
                            outline: none;

                            font-family: var(--ff-primary);
                            font-size: var(--fs-150);
                            color: var(--clr-k-800);

                            &:focus, &:focus-visible, &:focus-within{
                                border-color: var(--clr-primary-500);
                            }
                        }
                    }

                    & > .button-cont{
                        display: flex;
                        flex-direction: column;
                        gap: var(--size-100);
                        justify-content: flex-end;

                        padding-top: var(--size-650);                
                    }
                }


            }

            & > .error{
                display: flex;
                flex-direction: column;
                height: 100%;
                justify-content: center;
                gap: var(--size-300);

                & > h2{
                    font-size: var(--fs-400);
                    color: var(--clr-k-800);
                }
            }

        }
    }
}

header{
    padding: var(--section-padding);
    display: flex;
    flex-direction: column;

    & .logo{
        width: 80px;
        align-self: center;
    }

    & > .wrapper{
        display: flex;
        flex-direction: column;
        gap: var(--size-300);

        background-color: white;
        padding: var(--size-300);
        border-radius: var(--section-border-radius);

        & > nav{
            display: flex;
            justify-content: space-between;

            & > .lang-menu{
                display: flex;
                align-items: center;
                gap: var(--size-050);

                position: relative;
                padding: 8px 12px;
                border: 1px solid var(--clr-k-300);
                border-radius: var(--button-border-radius);

                & p{
                    font-size: var(--fs-200);
                    font-weight: var(--fw-300);
                    color: var(--clr-k-800);
                }

                & > .dropdown{
                    position: absolute;
                    z-index: 99;
                    top: calc(100% + var(--size-100));
                    /* top: -1px; */
                    left: -1px;

                    border: 1px solid var(--clr-k-300);
                    border-radius: var(--button-border-radius);
                    padding: 8px 12px;
                    background-color: white;

                    display: none;
                    flex-direction: column;
                    gap: var(--size-200);

                    &.is-open{
                        display: flex;
                    }

                    & > div{
                        display: flex;
                        gap: var(--size-050);

                        & > img{
                            max-width: fit-content;
                        }
                    }
                }
            }
        }

        & > .status{
            display: grid;
            grid-template-columns: 64px auto;
            gap: var(--size-300);
            align-items: center;
            padding-top: var(--size-300);
            border-top: 1px solid var(--clr-k-200);

            & > .progress{
                --size: 64px;
                --half-size: calc(var(--size) / 2);
                --stroke-width: 8px;
                --radius: calc((var(--size) - var(--stroke-width)) / 2);
                --circumference: calc(var(--radius) * pi * 2);
                --dash: calc((var(--progress) * var(--circumference)) / 100);
                animation: progress-animation 5s linear 0s 1 forwards;
                position: relative;

                & > circle{
                    cx: var(--half-size);
                    cy: var(--half-size);
                    r: var(--radius);
                    stroke-width: var(--stroke-width);
                    fill: none;
                    stroke-linecap: round;
                }

                & > .bg{
                    stroke: var(--clr-k-200);
                }

                & > .fg{
                    transform: rotate(-90deg);
                    transform-origin: var(--half-size) var(--half-size);
                    stroke-dasharray: var(--dash) calc(var(--circumference) - var(--dash));
                    transition: stroke-dasharray 0.3s linear 0s;
                    stroke: var(--clr-primary-900);
                }

                @property --progress {
                    syntax: "<number>";
                    inherits: false;
                    initial-value: 0;
                }

                @keyframes progress-animation {
                    from {
                        --progress: 0;
                    }
                    to {
                        --progress: 100;
                    }
                }

                & > text{
                    font-size: var(--fs-200);
                    font-weight: var(--fw-300);
                    fill: var(--clr-k-500);
                    text-anchor: middle;
                    dominant-baseline: middle;
                }
            }
            
            & > .headline{
                display: flex;
                flex-direction: column;
                gap: var(--size-050);

                & > h2{
                    font-size: var(--fs-200);
                    font-weight: var(--fw-300);
                }
                & > p{
                    font-size: var(--fs-200);
                }
            }
        }

    }
}

footer{
    display: flex;
    flex-wrap: wrap;
    gap: var(--size-100);
    padding-top: var(--size-650);
    border-top: 1px solid var(--clr-k-200);

    & > button{
        min-width: fit-content;
    }
}
