html, body {
    height: 100%;
}

body {
    width: 70%;
    margin: auto;
    text-shadow: 0 0 10px #000000;
}

#wrapper {
    position: relative;
    height: inherit;
    width: calc(100% - 200px);
    position: relative;
    float: right;
}


#content {
    width: 100%;
    position: absolute;
    background-color: #333;
}

img, video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

video {
    width: 125%;
    margin-left: -12.5%;
}

.carousel {
    height: 500px;
}


    .carousel.carousel-slider .carousel-item {
        min-height: unset;
    }

.carousel-item h4 {
    display: none;
}

#title {
    position: absolute;
    top: 0;
    color: white;
    margin-top: 0;
    line-height: 65px;
    width: 100%;
    text-shadow: 0 0 20px #000000;
}

.camera-open #camera_fallback, .img-open #camera_fallback {
    display: none;
}

#camera_fallback {
    height: 100%;
    width: 100%;
    position: absolute;
    background: #333;
}

    #camera_fallback h4 {
        color: white;
        width: 100%;
        font-size: 25px;
    }


.text-protect {
    background-color: rgba(0,0,0,0.4);
}

#border_box {
    display: block;
    left: 0;
    top: 0;
    position: absolute;
    border-style: solid;
    background-color: transparent;
    height: 100%;
    width: 100%;
    position: absolute;
    border-color: rgba(0,0,0,0.4);
    border-top-width: 65px;
    border-bottom-width: 65px;
    border-right-width: 80px;
    border-left-width: 60px;
    pointer-events: none;
}


.nav-wrap {
    position: absolute;
    bottom: 0;
    /*width: calc((100% - 62px - 82px ) * .55);*/
    height: 65px;
    font-size: 16px;
    color: white;
}

.picker-open .nav-wrap {
    /*display:none;*/
}

.nav-wrap.prev {
    color: white;
    margin-left: 18%;
    left: 0;
}

.nav-wrap.next {
    margin-right: 25%;
    right: 0;
}

.nav-wrap .material-icons {
    vertical-align: middle;
    width: 18px
}

#prev_tab {
    margin-right: auto;
}

#next_tab {
    margin-left: auto;
}

#prev_tab_name {
    margin-left: 5px;
}



.fullscreen-icon {
    position: absolute;
    left: 0;
    top: 0;
    margin: 12px;
    z-index: 2;
}

#picker {
    height: inherit;
    width: 200px;
    float: left;
    margin: auto;
}

.picker-icon {
    color: white;
    font-size: 40px;
    color: white;
}

#picker_toggle {
    display: none;
}

#picker_buttons {
    padding: 3px;
    background-color: rgba(0,0,0,0.3);
    overflow-y: scroll;
    width: 100%;
    scroll-behavior: smooth;
    height: 500px;
}

.box {
    position: relative;
    width: 100%;
    padding: 10px;
}



    .box:before {
        content: "";
        display: block;
        padding-top: 120%; /* initial ratio of 1:1*/
    }

.box-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 28px 12px;
}

.photo-container {
    width: 100%;
    height: 100%;
    background-size: contain;
    opacity: 0.85;
    /*background-repeat:no-repeat;*/
}

    .photo-container.selected {
        opacity: 1;
    }

        .photo-container.selected .picker-button {
            border-color: rgba(255,255,0,.7);
            border-width: 2px;
            border-style: solid;
        }

.picker-button {
    position: relative;
    background: linear-gradient(to bottom right, rgba(44,44,44,0.5), rgba(44,44,44,0.2));
    /*background: rgba(44,44,44,0.5);*/
    height: 100%;
    width: 100%;
    color: white;
    border-radius: 2px;
    font-size: 13px;
    word-wrap: break-word;
    text-transform: uppercase;
    position: relative;
    justify-content: center;
}

    .picker-button span {
        color: white;
        position: absolute;
        bottom: 0;
        right: 0;
        background-color: rgba(0,0,0,.5);
        width: 100%;
        height: 20px;
    }


    .picker-button.transparent {
        background: unset;
    }

#picker_buttons .thumbnail-icon {
    position: absolute;
    color: rgb(64,255,64);
    color: rgba(64,255,64,0.8);
    background-color: transparent;
    top: 1px;
    right: 1px;
    width: unset;
    height: unset;
    font-size: 15px;
    text-shadow: none;
}

#add_btn {
    border-radius: 20px;
    background: unset;
}

    #add_btn.picker-button h6 {
        color: white;
        font-size: 18px;
    }




#photo_control {
    color: white;
    font-size: 16px;
    float: right;
    display: flex;
    align-items: center;
    position: absolute;
    right: 15%;
    height: 500px;
    width: 80px;
}

.camera-button {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    width: 60px;
    line-height: 20px;
}


.camera-open #take_photo {
    display: block;
    margin: auto;
    height: 60px;
    width: 60px;
    border-radius: 30px;
    background-color: lightgray;
    border-width: 4px;
    border-style: solid;
    border-color: white;
}

.camera-open #native_camera {
    display: block;
}

#camera_on, #photo_taken {
    top: 6px;
    margin-right: 10px;
}

#camera_on {
    color: rgba(255,0,0,.8);
}

    #camera_on .material-icons {
        font-size: 36px;
    }

.camera-open #camera_on {
    display: block;
}

#photo_taken {
    text-shadow: 0 0 10px rgba(0,0,0,.3);
    color: rgb(64,212,64);
}

    #photo_taken .material-icons {
        font-size: 36px;
    }

.img-open #photo_taken {
    display: block;
}

#take_photo:active {
    background-color: lightyellow;
    border-color: yellow;
}

#delete_photo, #cancel_retake {
    top: 21%;
}

.img-open #delete_photo,
.img-open #retake_photo,
.img-open #edit_photo {
    display: block;
}

.retake-photo #cancel_retake {
    display: block;
}

#flashlight {
    display: none;
    /*display:block;*/ /*debug mode...*/
    bottom: 21%;
    color: lightgray;
    opacity: 0.8;
    width: 40px;
}

    #flashlight .icon {
        font-size: 30px;
        margin-right: 2px;
    }

    #flashlight.on {
        color: white;
        opacity: 1;
    }

#edit_photo,
#photo_control #native_camera {
    bottom: 21%;
}

.camera-open.flashlight #flashlight {
    display: block;
}

.camera-open.flashlight #native_camera {
    display: none;
}

#finished {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}



.pic-modal {
    height: 100%;
    width: 100%;
    max-height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0, 0.9);
    overflow-x: hidden;
    text-align: center;
    opacity: 0;
    transition: 0.2s;
}

    .pic-modal.open {
        height: 100%;
        opacity: 1;
        z-index: 1001;
    }

    .pic-modal .modal-content {
        position: relative;
        width: 100%;
        height: 100%;
        text-align: center;
        z-index: 1002;
    }

    .pic-modal .fullscreen-icon {
        z-index: 1004;
        margin: 8px;
    }

    .pic-modal h4 {
        position: absolute;
        width: 100%;
        height: 55px;
        line-height: 55px;
        margin: 0;
        color: white;
        z-index: 1003;
    }

    .pic-modal img {
        position: absolute;
        height: 100%;
        /*height: calc(100% - 10px);*/
        top: 0;
        bottom: 0;
        /*width: calc(100% - 10px);*/
        width: 100%;
        left: 0;
        right: 0;
        object-fit: contain;
        z-index: 1002;
    }


    .pic-modal .modal-buttons {
        position: absolute;
        width: 100%;
        bottom: 0;
        z-index: 1003;
    }

        .pic-modal .modal-buttons a {
            color: white;
            height: 60px;
            line-height: 55px;
            font-size: 16px;
        }

.modal-buttons a.left {
    margin-left: 20%;
}

.modal-buttons a.right {
    margin-right: 20%;
}

.modal-buttons .material-icons {
    vertical-align: text-bottom;
}



@media only screen and (max-width: 1200px) {
    body {
        width: 100%;
    }

    #photo_control {
        right: 0;
    }
}

/* LANDSCAPE MODE */
@media only screen and (max-height: 450px), only screen and (max-height: 600px) and (min-width: 450px), only screen and (max-height: 700px) and (min-width: 600px), only screen and (max-height: 800px) and (min-width: 700px), only screen and (max-height: 900px) and (min-width: 800px), only screen and (max-height: 1000px) and (min-width: 900px), only screen and (max-height: 1100px) and (min-width: 1000px), only screen and (max-height: 1200px) and (min-width: 1100px) {
    html, body {
        width: 100%;
        background-color: #333;
    }

    #wrapper {
        height: 100%;
        width: 100%;
        position: relative;
        float: left;
    }

    #content {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .picker-open #title {
        right: 10px;
    }

    .picker-open #content {
        width: calc(100% - 175px);
        overflow: hidden;
        right: 0;
        position: absolute;
        transition: 0.3s;
    }

    .carousel {
        height: 100%;
    }

    .carousel {
        height: 100%;
    }


    #picker {
        position: absolute;
        left: 0;
        width: 44px;
        height: 100%;
        /*background: linear-gradient( to right, rgba(0, 0, 0, 0.5), rgba(0,0,0,0.2));*/
        /*background:rgba(0,0,0,0.3);*/
    }

    .picker-open #picker {
        width: 219px;
        transition: 0.3s;
    }

    #picker_toggle {
        width: 35px;
        height: 100%;
        display: block;
        float: right;
        display: flex;
        align-items: center;
    }


    #picker_buttons {
        display: none;
        margin: auto;
        height: 100%;
        width: 175px;
        padding-left: 3px;
        float: left;
        background: #151515;
    }

    .picker-open #picker #picker_buttons {
        display: block;
    }

    #photo_control {
        height: 100%;
        position: absolute;
        right: 0;
        margin-right: 0;
        width: 80px;
    }



    #retake_photo {
        position: absolute;
        left: 0;
        right: 0;
        margin: auto;
    }

    @media only screen and (max-height: 1000px) and (max-width: 1000px) {
        .picker-open #picker {
            width: 194px;
        }

        .picker-open #content {
            width: calc(100% - 150px);
        }

        #picker_buttons {
            width: 150px;
        }
    }
}

/* PORTRAIT MODE */
@media only screen and (max-width: 450px), only screen and (max-width: 600px) and (min-height: 500px), only screen and (max-width: 700px) and (min-height: 600px), only screen and (max-width: 800px) and (min-height: 700px), only screen and (max-width: 900px) and (min-height: 800px), only screen and (max-width: 1000px) and (min-height: 900px), only screen and (max-width: 1100px) and (min-height: 1000px), only screen and (max-width: 1200px) and (min-height: 1100px) {
    html, body {
        width: 100%;
        background-color: #333;
    }

    #wrapper {
        height: 100%;
        width: 100%;
    }

    #content {
        height: 100%;
    }

    #border_box {
        border-top-width: 65px;
        border-right-width: 0;
        border-left-width: 0;
        border-bottom-width: 44px;
        height: calc(100% - 80px);
        height: calc(100% - 92px);
    }

    .ios #border_box {
        height: calc(100% - 92px);
    }

    .picker-open #border_box {
        height: 100%;
    }

    #bottombox {
        height: 60px;
    }

    #leftbox, #rightbox {
        display: none;
    }


    #title {
        right: 0;
    }

    #camera_on, #photo_taken {
        margin-right: 0;
    }

    .nav-wrap {
        width: 45%;
        height: 44px;
        bottom: 80px;
        bottom: 92px;
    }

    .ios .nav-wrap {
        bottom: 92px;
    }

    .picker-open .nav-wrap {
        bottom: 0;
    }

    #prev_tab, #next_tab {
        display: block;
        width: 100%;
    }

    #next_tab_name, #prev_tab_name {
        display: block;
        /*width: 70%;*/
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-wrap.prev {
        margin-left: 0;
    }

    .nav-wrap.next {
        margin-right: 0;
    }

    .navigation {
        z-index: 10; /* keeps the nav buttons in front of the picker */
    }


    .picker-open #content {
        width: 100%;
        overflow: hidden;
        height: calc(100% - 218px);
        height: calc(100% - 230px);
        transition: 0.3s;
    }


    .picker-open.ios #content {
        height: calc(100% - 230px);
    }

    .carousel {
        height: 100%;
    }

    .carousel-item h4 {
        margin-bottom: 40px;
        margin-left: 0;
    }

    #prev_tab {
        float: left;
        color: white;
        margin-left: 10px;
        left: 0;
    }

    #next_tab {
        float: right;
        color: white;
        margin-right: 10px;
        right: 0;
    }

    #picker {
        height: 40px;
        width: 100%;
        position: absolute;
        bottom: 0;
        bottom: 80px;
        bottom: 92px;
    }

    .ios #picker { 
        bottom: 92px;
    }

    .picker-open #picker {
        height: 178px;
        transition: 0.3s;
    }

    .picker-open.ios #picker {
        bottom: 92px;
    }


    #picker_toggle {
        height: 39px;
        width: 100%;
        display: block;
        float: left;
    }


    #picker_toggle_icon {
        margin: auto;
    }

    #picker_buttons {
        display: none;
    }

    .picker-open #picker #picker_buttons {
        width: auto;
        height: calc(100% - 40px);
        display: block;
        margin-top: 40px;
        background-color: rgba(0,0,0,0.4);
        transition: 0.3s;
        overflow-x: scroll;
        overflow-y: hidden;
        white-space: nowrap;
    }

    .box {
        width: 182px;
        height: 122px;
        display: inline-block;
    }

    .box-content {
        padding: 12px 28px 2px;
    }

    .box:before {
        padding-left: 100%; /* initial ratio of 1:1*/
        padding-top: unset;
    }

    .ios #photo_control {
        padding: 0 0 12px;
        height: 92px;
    }

    #photo_control {
        width: 100%;
        position: absolute;
        bottom: 0;
        height: 80px;
        height: 92px;
        padding: 0 0 12px;
        margin-right: 0;
        background: linear-gradient(to bottom, rgba(0,0,0,.6), rgba(0,0,0,.4), rgba(0,0,0,.4), rgba(0,0,0,.6))
    }

        #photo_control .camera-button {
            margin: auto;
            bottom: unset;
            top: unset;
        }

        #photo_control #cancel_retake, #photo_control #delete_photo {
            right: unset;
            left: 8px;
        }

        #photo_control #edit_photo {
            right: unset;
            left: 23.5%;
        }

        #photo_control #flashlight {
            right: 22.5%;
            left: unset;
            height: 42px;
        }

        #photo_control #native_camera {
            right: 21.5%;
            left: unset;
            height: 42px;
            top: unset;
            bottom: unset;
        }

        #photo_control #finished {
            right: 8px;
            left: unset;
        }



    .pic-modal .modal-buttons a {
        color: white;
        margin-right: 20px;
        margin-left: 20px;
    }
}
