/* Settings */
:root{
    --body-text-size: var(--fs-300);
    --button-font-size: var(--fs-200);

    --body-text-color: var(--clr-k-600);
    --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);
}

/*CSS Reset*/
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    text-decoration: none;
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    font-style: italic;
    background-repeat: no-repeat;
    background-size: cover;
    shape-margin: 1rem;
}

h1,h2,h3,h4,h5,h6{
    font-family: var(--ff-primary);
    color: var(--headline-color);
    font-weight: var(--fw-200);

    text-wrap: balance;
    letter-spacing: -1px;

    & > 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;

        padding: 8px 20px;
        border-radius: var(--button-border-radius);
        font-size: var(--button-font-size);
        font-weight: var(--fw-200);

        &:has(img){
            padding-left: 16px;
            column-gap: 8px;
        }

        &.primary{
            background-color: var(--clr-b-900);
            color: white;
        }

        &.secondary{
            background-color: white;
            border: 1px solid var(--clr-k-300);
            color: var(--clr-k-800);
        }
    }

    /* 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(../icons/icon-search.svg);
            background-position: calc(100% - 16px); 
            background-repeat: no-repeat;
        }
    }

 

/* Layout */
main{
    position: relative;
    display: flex;
    flex-direction: column;

    height: 100dvh;
    max-width: 480px;

    margin: auto;

    overflow: visible;

    & > .wrapper{
        display: flex;
        flex-direction: column;

        height: 100%;
        padding: var(--section-padding);
        overflow: scroll;
    }

    &:has(nav) > .wrapper{
        padding-bottom: 0;
    }
}

nav{
    padding: var(--section-padding);

    display: flex;
    flex-direction: column;
    gap: var(--section-padding);
    width: 100%;
    max-width: 480px;

    & > .nav-links{
        display: flex;
        justify-content: space-between;
        border-radius: var(--section-border-radius);
        padding: var(--size-050);

        width: 100%;
        background-color: white;

        /* filter: drop-shadow(0 0 32px #0C0C0D1A)
                drop-shadow(0 0 8px #0C0C0D0D); */

        & > li{
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            gap: var(--size-050);

            padding-bottom: var(--size-100);
            padding-top: var(--size-200);

            border-radius: var(--button-border-radius);
            width: 100%;

            & > p{
                font-size: var(--fs-200);
                font-family: var(--ff-secondary);
                color: var(--body-text-color);
                font-weight: var(--fw-100);
            }

            & > svg > path{
                fill: var(--clr-k-800);
            }

            &.active{
                background-color: var(--clr-b-100);

                & > p{
                    font-weight: var(--fw-300);
                    color: var(--clr-b-900);
                }
                & > svg > path{
                    fill: var(--clr-b-900);
                }
            }
        }
    }
}

header{
    padding-bottom: var(--section-padding);
    padding-top: var(--size-650);
    display: flex;
    flex-direction: column;

    border-bottom: 1px solid var(--clr-k-300);
    
    & .headline{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;

        padding-inline:var(--size-050);
        padding-bottom: var(--size-500);

        & h2{
            font-size: var(--fs-400);
        }
    }

    & .search-cont{

        & input{
            width: 100%;
            padding: 12px 16px;
            border-radius: var(--button-border-radius);
            background-color: white;
        }
    }
}

    .device-card{
        background-color: white;
        border-radius: var(--section-border-radius);
        padding: var(--device-padding);

        & > .device-label-cont{
            display: flex;
            flex-wrap: wrap;
            gap: var(--size-100);

            padding-bottom: var(--size-300);

            & > *{
                padding: 
                    var(--size-050)
                    var(--size-100)
                    var(--size-050)
                    var(--size-100);
                display: flex;
                align-items: center;
                justify-content: center;
                gap: var(--size-050);

                border-radius: 2px;

                font-size: var(--fs-100);
                font-weight: var(--fw-300);
            }

            & > .session-active{
                color: var(--clr-g-500);

                background-color: var(--clr-g-100);
                border: 1px solid var(--clr-g-500);

                &:after{
                    content: 'Active';
                }
            }

            & > .session-time,
            & > .session-kwh{
                color: var(--body-text-color);

                background-color: var(--clr-k-100);
                border: 1px solid var(--clr-k-300);

                &:before{
                    display: flex;
                    content: '';

                    width: 4px;
                    aspect-ratio: 1 / 1;

                    border-radius: 2px;
                    background-color: var(--clr-g-500);
                }
            }

            & > .session-finished{
                color: var(--body-text-color);

                background-color: var(--clr-k-100);
                border: 1px solid var(--clr-k-300);  
                
                &:after{
                    content: 'Session Finished';
                }
            }
        }

        & > .device-header{
            display: flex;
            column-gap: var(--size-300);
            align-items: center;
            padding-block: var(--size-300) var(--size-650);

            & > .device-adress{
                font-size: var(--fs-400);
                font-weight: var(--fw-200);
                color: var(--clr-k-800);

                display: flex;
                flex-direction: column;
                row-gap: var(--size-050);

                & > .location{
                    display: flex;
                    column-gap: var(--size-100);

                    font-size: var(--fs-200);
                    color: var(--body-text-color);

                    & > img{
                        width: 14px;
                    }
                }
            }
        }

        & > .button-cont{
            display: flex;
            gap: var(--size-100);

            & > button{
                width:100%;
            }
        }

        & > .device-details{
            display: flex;
            flex-direction: column;

            padding-top: var(--size-650);

            &:last-child{
                padding-top: var(--size-300);

                & > ul{
                    padding-bottom: 0;
                }
            }

            & > .details-header{
                display: flex;
                justify-content: space-between;

                background-color: var(--clr-k-200);
                padding: var(--size-100) var(--size-200);

                cursor: pointer;

                & > p{
                    font-size: var(--fs-300);
                    font-weight: var(--fw-300);
                    color: var(--clr-k-800);                
                }

                & > img{
                    width: var(--size-200);
                    transform: rotate(180deg);
                    transition: all .2s ease-in-out;
                }
            }

            & > ul{
                display: flex;
                flex-direction: column;
                row-gap: var(--size-650);

                padding-inline: var(--size-100);
                padding-block: var(--size-650);

                &.hidden{
                    padding-top: 0;

                    & > li {
                        display: none;
                    }
                }

                & > li{
                    display: flex;
                    justify-content: space-between;

                    column-gap: var(--size-300);

                    & > p:nth-child(1){
                        font-size: var(--fs-200);
                    }

                    & > p:nth-child(2){
                        font-size: var(--fs-300);
                        font-weight: var(--fw-300);
                        color: var(--clr-k-800);
                        
                        text-align: end;
                        overflow-wrap: anywhere;             
                    }

                    & > p.label{
                        font-size: var(--fs-100);
                        font-weight: var(--fw-200);
                         
                        padding: var(--size-050) var(--size-100);
                        border: 1px solid;
                        border-radius: 2px;

                        &.evse{
                            background-color: var(--clr-b-100);
                            border-color: var(--clr-b-900);
                            color: var(--clr-b-900);
                        }

                        &.false{
                            background-color: var(--clr-r-100);
                            border-color: var(--clr-r-500);
                            color: var(--clr-r-500);
                        }

                        &.true, &.active{
                            background-color: var(--clr-g-100);
                            border-color: var(--clr-g-500);
                            color: var(--clr-g-500);
                        }
                        &.finished{
                            background-color: var(--clr-k-100);
                            border-color: var(--clr-k-300);
                            color: var(--body-text-color);
                        }                        
                    }
                }
            }


        }

        & > .device-details.closed{
            & > ul{
                display: none;
            }

            & > .details-header > img{
                transform: rotate(0);
            }            
        }
    }


.login-cont{
    background-color: white;
    padding: var(--size-500);

    width: 100%;
    height: 100%;
    overflow:scroll;

    display: flex;
    flex-direction: column;
    gap: var(--size-900);

    justify-content: space-between;
    align-items: start;
    align-self: stretch;

    & > div{
        display: flex;
        flex-direction: column;
        gap: var(--size-650);

        width: 100%;
        
        & > .login-text-block{
            width: 100%;
            border: none;
            color: var(--body-text-color);
            font-family: var(--ff-secondary);

            padding-bottom: var(--size-650);

            align-items: center;

            & > h1{
                font-size: 3rem;
                line-height: 1;
                color: var(--clr-b-900);
                padding-bottom: var(--size-100);
            }
        }

        & > form{
            display: flex;
            flex-direction: column;

            width: 100%;

            & > .input-field{
                display: flex;
                flex-direction: column;

                padding-bottom: var(--size-100);
                
                & > p{
                    font-size: var(--fs-100);
                    font-weight: var(--fw-300);
                    color: var(--body-text-color);

                    padding-bottom: var(--size-100);
                }
            
                & > input{
                    width: 100%;
                    height: 2.5rem;
                    background-color: var(--clr-k-100);
                    border: 1px solid var(--clr-k-200);

                    padding: var(--size-300);
                }
            }

            & > .button-cont{
                display: flex;
                flex-direction: column;
                gap: var(--size-100);

                padding-top: var(--size-500);

                & > button{
                    width: 100%;
                }
            }
        }
    }


    & > .login-footer{
        padding-top: var(--size-300);
        border-top: 1px solid var(--clr-k-200);

        font-size: var(--fs-100);
        font-family: var(--ff-secondary);
        color: var(--body-text-color);
        text-align: center;

        display: flex;
        justify-content: center;
    }
}

.map{
    display: flex;
    flex-direction: column;
    justify-content: end;

    width: 100vw;
    height: 100dvh;
}

.nav-map {
    z-index: 500;
}

.user-img {
    width: 48px;
    aspect-ratio: 1 / 1;
    border-radius: 100%;
    background-image: url('../img/blue.png');
    background-repeat: no-repeat;
}

ul.account-settings > li > a {
    display:flex;
    align-items: center;
    gap: var(--size-100);
    cursor: pointer;

    padding: var(--size-200);

        & > p{
        font-size: var(--fs-300);
        color: var(--clr-k-800);
    }
}

.no-devices {
    height: 50%;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.body-cont {
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-items: center;
    row-gap: 20px;
    margin-top: 15px;
}

.body-qr-cont {
    width: 50%;
}

.body-p {
    font-size: initial;
}


/*preloader*/
.preloader {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background-color: #fff;
    z-index: 999999;
    background-image: none !important;
    opacity: 0.5;
}

    .preloader .inner {
        width: 99px;
        height: 99px;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
    }

        .preloader .inner > div {
            border-radius: 50%;
            position: absolute;
            -webkit-animation-name: circle_rotate;
            animation-name: circle_rotate;
            -webkit-animation-iteration-count: infinite;
            animation-iteration-count: infinite;
            -webkit-animation-timing-function: linear cubic-bezier(0.075, 0.82, 0.165, 1);
            animation-timing-function: linear cubic-bezier(0.075, 0.82, 0.165, 1);
            -webkit-animation-duration: 2s;
            animation-duration: 2s;
        }

        .preloader .inner .line1 {
            width: 100%;
            height: 100%;
            -webkit-transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            transform: rotate(45deg);
            border-top: 6px solid #1F7CEA;
            border-left: 6px solid rgba(116, 14, 175, 0);
            border-right: 6px solid rgba(116, 14, 175, 0);
            border-bottom: 6px solid rgba(116, 14, 175, 0);
            -webkit-animation-delay: 0s;
            animation-delay: 0s;
        }

        .preloader .inner .line2 {
            width: 70%;
            height: 70%;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            -webkit-transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            transform: rotate(45deg);
            border-top: 6px solid #7EC0EE;
            border-left: 6px solid rgba(151, 38, 216, 0);
            border-right: 6px solid rgba(151, 38, 216, 0);
            border-bottom: 6px solid rgba(151, 38, 216, 0);
            -webkit-animation-delay: 0.25s;
            animation-delay: 0.25s;
        }

        .preloader .inner .line3 {
            width: 40%;
            height: 40%;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            margin: auto;
            -webkit-transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            transform: rotate(45deg);
            border-top: 6px solid #1F7CEA;
            border-left: 6px solid rgba(190, 112, 235, 0);
            border-right: 6px solid rgba(190, 112, 235, 0);
            border-bottom: 6px solid rgba(190, 112, 235, 0);
            -webkit-animation-delay: 0.5s;
            animation-delay: 0.5s;
        }

@-webkit-keyframes circle_rotate {
    50%, 100% {
        -webkit-transform: rotate(405deg);
        transform: rotate(405deg);
    }
}

@keyframes circle_rotate {
    50%, 100% {
        -webkit-transform: rotate(405deg);
        transform: rotate(405deg);
    }
}

.marker-cluster-small {
    background-color: #33DD88aa !important;
    color: #6F6F6F;
}

    .marker-cluster-small div {
        background-color: #33DD88 !important;
    }

.marker-cluster-medium {
    background-color: #FFC120aa !important;
    color: #6F6F6F;
}

    .marker-cluster-medium div {
        background-color: #FFC120 !important;
    }

.marker-cluster-large {
    background-color: #FF6B6Baa !important;
    color: #6F6F6F;
}

    .marker-cluster-large div {
        background-color: #FF6B6B !important;
    }

.btn-contact {
    padding-left: 10px;
}

.device-return-message {
    padding: 8px 20px 16px 10px;
    font-size: 0.875rem;
    color: green;
}
