body {
    margin: 0px;
    padding: 0px;
    background: #000;
    font-family: Arial;
}

#vid_container {
    position: fixed;
    top: 0;
    left: 0;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

#gui_controls {
    position: fixed;
    background-color: #111; /*rgba(255, 0, 0, 0.5);*/
    z-index: 2;
    bottom: 0;
}

#video_overlay {
    position: fixed;
    display: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    z-index: 10;
    background-color: #111;
}

#focus_overlay{
    width: 60%;
    position: absolute;
    z-index: 15;
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
}

#text_info{
    position: absolute;
    z-index: 15;
    display: block;
    top: 85%;
    margin-left: 20px;
    margin-right: 20px;
    text-align: center;
    color: white;
    font-weight: bold;
}

#cam_logo{
    position: absolute;
    z-index: 15;
    display: block;
    top: 8%;
    margin-right: 20px;
    width: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loader {
    display: none;
    position: absolute;
    z-index: 20;
    top: calc(50% - (100px / 2));
    left: calc(50% - (100px / 2));
    transform: translate(-50%, -50%); 
    width: 100px;
    height: 100px;
    border: 4px solid #Fff;
    animation: loader 2s infinite ease;
}

.loader-inner {
    vertical-align: top;
    display: inline-block;
    width: 100%;
    background-color: #fff;
    animation: loader-inner 2s infinite ease-in;
    z-index: 20;
}

.select-result-plate{
    text-align: center;
    color: white;
    font-weight: bold;
    margin-left: 20px;
    margin-right: 20px;
}

@keyframes loader {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(180deg);
    }

    50% {
        transform: rotate(180deg);
    }

    75% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes loader-inner {
    0% {
        height: 0%;
    }

    25% {
        height: 0%;
    }

    50% {
        height: 100%;
    }

    75% {
        height: 100%;
    }

    100% {
        height: 0%;
    }
}

/*  Button style from: 
    https://googlesamples.github.io/web-fundamentals/fundamentals/media/mobile-web-video-playback.html */

button {
    outline: none;
    position: absolute;
    color: white;
    display: block;
    opacity: 1;
    background: transparent;
    border: solid 2px #fff;
    padding: 0;
    text-shadow: 0px 0px 4px black;
    background-position: center center;
    background-repeat: no-repeat;
    pointer-events: auto;
    z-index: 2;
}

#takePhotoButton {
    left: calc(50% - 40px);
    top: calc(50% - 40px);
    width: 80px;
    height: 80px;
    background-image: url('../img/ic_photo_camera_white_48px.svg');
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
}

#takePhotoButton:active {
    background-color: #fff;
}

#backToCamera {
    display: none;
    left: calc(50% - 40px);
    top: calc(50% - 40px);
    width: 80px;
    height: 80px;
    background-image: url('../img/ic_arrow_left_white_48px.svg');
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
}

#toggleFullScreenButton {
    display: none;
    width: 64px;
    height: 64px;
    background-image: url('../img/ic_fullscreen_white_48px.svg');
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
}

#toggleFullScreenButton[aria-pressed='true'] {
    background-image: url('../img/ic_fullscreen_exit_white_48px.svg');
}

#switchCameraButton {
    display: none;
    width: 64px;
    height: 64px;
    background-image: url('../img/ic_camera_rear_white_36px.svg');
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
}

#switchCameraButton[aria-pressed='true'] {
    background-image: url('../img/ic_camera_front_white_36px.svg');
}

/* Result Container */
#result_container{
    display: none;
}

.res_plate{
    display: inline-block;
}

.res_plate img{
    width: 100%;
}

.frame{
    width: 100%;
    height: 110px;
    position: relative;
    display: inline-block;
}

.frame img{
    max-height: 100%;  
    max-width: 100%; 
    position: absolute;  
    top: 0;  
    bottom: 0;  
    left: 0;  
    right: 0;  
    margin: auto;
}

.res_es_2_gr{
    width: 49%;
}


.res_es_2_gr img{

}

.res_es_2_mm{
    width: 49%;
}

.res_es_2_mm img{
    max-height: 100px;
}

.resulting_plate{
    margin-top: 20px;
}

.resulting_plate img{
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    max-height: 100px;
}

.plate_actions{
    text-transform: uppercase;
    max-width: 100%;
    font-size: 25px;
    color: white;
    border: 2px solid white;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    padding: 15px;
}


@media screen and (orientation: portrait) {
    /* portrait-specific styles */

    /* video_container (video) doesn't respect height... 
         so we will fill it in completely in portrait mode
    */
    #vid_container {
        width: 100%;
        height: 80%;
    }

    #result_container{
        width: 100%;
        height: 80%;
    }

    #gui_controls {
        width: 100%;
        height: 20%;
        left: 0;
    }

    #switchCameraButton {
        left: calc(20% - 32px);
        top: calc(50% - 32px);
    }

    #toggleFullScreenButton {
        left: calc(80% - 32px);
        top: calc(50% - 32px);
    }
}

@media screen and (orientation: landscape) {
    #vid_container {
        width: 80%;
        height: 100%;
    }

    #result_container{
        width: 80%;
        height: 100%;
    }

    #vid_container.left {
        left: 20%;
    }

    /* we default to right */
    #gui_controls {
        width: 20%;
        height: 100%;
        right: 0;
    }

    /* for the lefties */
    #gui_controls.left {
        left: 0;
    }

    #switchCameraButton {
        left: calc(50% - 32px);
        top: calc(18% - 32px);
    }

    #toggleFullScreenButton {
        left: calc(50% - 32px);
        top: calc(82% - 32px);
    }
}
