
@font-face {
    font-family: 'Roboto Light';
    src: url(fonts/Roboto-Light.ttf);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

html, body {
    height: 100%;
    position: relative;
}

html {
    overflow: hidden;
}

body {
    overflow: hidden;
    color: #fff;
    background: #2C2C2C;
    font-family: 'Roboto Light', Helvetica, Arial, sans-serif;
}

a {
    color: #e58f33;
}

.error {
    border-radius: 0.2rem;
    box-shadow: 0px 1px 1px rgba(0,0,0,0.5);
    color: rgb(255, 255, 255);
    background: rgba(197, 65, 51,0.5);
    padding: 1rem;
    z-index: 100;
}

.small {
    font-size: 1rem;
}

.large {
    font-size: 1.5rem;
}

#app {
    border: 0 none;
}

#ghostCanvasContainer, #canvasContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#canvasContainer {
    text-align: center;
}

#canvasContainer:before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -0.25em;
}

#canvasContainer canvas {
    image-rendering: crisp-edges;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    -ms-interpolation-mode: nearest-neighbor;
    display: inline-block;
    vertical-align: middle;
}

#additionalControls {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
}

#additionalControls > div input {
    padding: 0 0.5rem;
    max-height: 2rem;
}

#additionalControls.active {
    display: table;
    z-index: 10;
}

#additionalControls > div {
    display: table-cell;
    vertical-align: middle;
}

#prevFilter {
    float: left;
}

#nextFilter {
    float: right;
}

#ghostCanvasContainer {
    -webkit-transition: 0.8s ease-out;
    transition: 0.8s ease-out;
    opacity: 1;
    -webkit-transform: translate(0, 0);
    transform: translate(0, 0);
}

#ghostCanvasContainer canvas {
    display: block;
    margin: 0 auto;
}

#ghostCanvasContainer.faded_out {
    /* Why 2rem? For making it look as if we're moving the image into the Gallery button */
    -webkit-transform: translate(calc(-50% + 2rem), calc(-50% + 1rem)) scale3d(0.01, 0.01, 1) rotateZ(-300deg);
    transform: translate(calc(-50% + 2rem), calc(-50% + 1rem)) scale3d(0.01, 0.01, 1) rotateZ(-300deg);
    opacity: 0;
}

#flasher {
    background: rgba(255, 255, 255, 0.5);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.on_animation {
    -webkit-animation-duration: 0.4s;
    -webkit-animation-name: flash_it;
    animation-duration: 0.4s;
    animation-name: flash_it;
}

@keyframes flash_it {
    from {
        opacity: 0;
    }

    75% {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@-webkit-keyframes flash_it {
    from {
        opacity: 0;
    }

    75% {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

x-appbar {
    background: rgba(30, 30, 30, 0.8);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    width: 100%;
}
    x-appbar > * {
        z-index: 0;
    }

x-appbar header {
    width: 100%;
}

x-appbar header:after {
    display: none;
}

button {
    font-family: inherit;
    font-size: 80%;
    background-color: transparent;
    color: #fff;
    border: none;
    background-repeat: no-repeat;
    transition: 0.3s background;
}

#btnGallery {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 1;
    margin: 0.45rem 0.5rem;
    padding: 0.5rem 1.0rem;
    transition: opacity 0.8s;
    background-image: url(../img/icons/icn-back-arrow@2x.png);
    background-size: 0.88rem 1.2rem;
    background-position: left center;
    cursor: pointer;
}

h1 {
    font-weight: normal;
    font-size: 1.8rem;
    padding: 0.25rem 0 0.6rem;
    text-align: center;
    width: 100%;
}

h1 span {
    color: #e58f33;
}

#app x-deck {
    width: 100%;
    height: 100%;
}

#app x-card {
    overflow-y: auto;
}

x-card footer {
    position: absolute;
    bottom: 0;
    text-align: center;
    width: 100%;
    z-index: 100;
    padding: 0.5rem 0;
    background: rgba(30, 30, 30, 0.8);
}

x-card footer > * {
    vertical-align: middle;
}

x-card footer button {
    margin: 0 1rem;
    min-width: 2rem;
    min-height: 2rem;
}



#gallery p {
    text-align: center;
    color: #ccc;
}

#gallery .loading:before {
    content: "";
    background-image: url(spinner.gif);
    background-repeat: no-repeat;
    background-position: 8px 50%;
    padding-left: 32px;
}

#galleryContainer {
    height: 100%;
    overflow-y: scroll;
    padding: 0 0.5rem;
}

#galleryContainer div div {
    height: 10rem;
    width: 10rem;
    background-color: #ccc;
    background-position: 50% 50%;
    background-size: cover;
    display: inline-block;
    margin: 1rem 0.5rem 0.5rem 0.5rem;
    border-radius: 2px;
    border: 1px solid #222;
}

#galleryCoachMarks {
    padding: 1rem;
    color: #ddd;
    opacity: 0; /* initially hidden */
    width: 90%;
}

#galleryCoachMarks p {
    margin-bottom: 1rem;
}

#galleryCoachMarks .imgMarker img {
    max-height: 6rem;
    opacity: 0.5;
}

#galleryCoachMarksCamera, #galleryCoachMarksFilePicker {
    max-height: 1rem;
    opacity: 0.5;
    vertical-align: middle;
}

#btnCamera, #btnPicker, #btnFilePicker {
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

/* btnCapture is a class and not an id because we have 2 buttons that look the same */
/* TODO: refactor all identically looking buttons into classes */
#btnCamera {
    background-image: url(../img/icons/icn-camera@2x.png);
    background-size: 100% 100%;
}

/*  this is a separate button for taking the photo */
.btnCapture {
    background-image: url(../img/icons/icn-take-photo@2x.png);
    background-size: 100% 100%;
    margin-left: auto;
    margin-right: auto;
    min-width: 4.5rem;
    min-height: 3rem;
}

button.hidden {
    display: none;
}

/* button for going to the uploader screen */
#btnPicker {
    background-image: url(../img/icons/icn-filepicker@2x.png);
    background-size: 100% 100%;
}

/* button for uploading a new photo */
#btnFilePicker {
    background-image: url(../img/icons/icn-filepicker@2x.png);
    background-size: 100% 100%;
}


#details > div {
    height: 100%;
    overflow-y: auto;
    width: 100%;
    text-align: center;
}

/* First div inside details is for showing the current picture number,
 * and total number of pictures */
#details > div > div {
  padding: 0.6rem;
  font-size: 0.8rem;
  opacity: 0.5;
}

#details footer button {
    border: none;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    width: 1rem;
    height: 0.8rem;
}

#btn_delete {
    background-image: url(../img/icons/icn-trash@2x.png);
}

#btn_download {
    background-image: url(../img/icons/icn-download@2x.png);
}

#btn_share {
    background-image: url(../img/icons/icn-share@2x.png);
}

#galleryUploading, #showImgur {
    padding: 5%;
    background: #fff;
    color: #000;
}

#camera {
    text-align: center;
}

.controls {
    position: absolute;
    z-index: 100;
}

#camera header {
    top: 0;
    width: 100%;
}

#videoControls {
    opacity: 0;
    display: none;
    transition: opacity 0.3s;
    background: rgba(0, 0, 0, 0.3);
    padding-top: 3rem;
}

#videoControls progress {
    border-width: 0;
    background: rgba(0, 0, 0, 0.8);
    height: 4px;
    vertical-align: middle;
}

progress::-moz-progress-bar {
    background: #e58f33;
}

#progressLabel span {
    padding: 0.25rem 0;
    transition: all 0.5s;
}

.rendering #progressLabel span {
    background-image: url(spinner.gif);
    background-repeat: no-repeat;
    background-position: 8px 50%;
    padding-left: 32px;
}

#videoControls input {
    max-width: 24px;
    max-height: 24px;
    vertical-align: middle;
}

#videoControls.rendering progress, #videoControls.rendering input {
    display: none;
}

#cameraCoachMarks {
    color: #ddd;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 1em;
    padding: 1em;
    opacity: 0;
    transition: opacity 1s;
    font-size: 1.0rem;
    list-style-type: none;
    list-style-position: inside;
    width: 90%;
    max-width: 600px;
    line-height: 1.6;
}

#cameraCoachMarks li {
    background-repeat: no-repeat;
    background-position: 0 12px;
    background-size: 48px 48px;
    padding-left: 64px;
    padding-top: 12px;
    padding-bottom: 25px;
}

#press {
    background-image: url(../img/icons/icn-coachmark-press.png);
}

#arrows {
    background-image: url(../img/icons/icn-coachmark-arrows.png);
}

#cameraCoachMarks li + li {
    margin-top: 2rem;
}

#camera footer > div {
    margin: 0 auto;
    vertical-align: middle;
}

#camera footer button {
    vertical-align: middle;
}

#switchVideoContainer {
    vertical-align: middle;
    display: inline-block;
}

#switchVideo {
    opacity: 0;
    transition: opacity 1s;
    border-color: #333;
    border-width: 1px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1rem;
    vertical-align: middle;
    text-shadow: 0 0 2px #000;
    text-transform: uppercase;
    color: #aaa;
    border-radius: 1rem;
}

#switchVideo, #switchVideo[checked], #switchVideo .x-switch-background {
    background: #222;
}

.x-switch-text {
    padding: 0.2rem 0.40rem;
}

.x-switch-knob {
    background: #e58f33;
    width: 1rem;
    border-radius: 1rem;
}

#filePicker {
    background: #fff;
    color: #000;
    padding: 1rem;
    border-radius: 0.5rem;
    z-index: 200;
    width: 90%;
    max-width: 30rem;
    border-radius: 2px;
}

#filePicker header {
    font-size: 1.25rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

#filePicker input[type=file] {
   font-size: 0.875rem;
   display: block;
   padding: 1rem 0;
   border: none;
   background: transparent;
}


#filePicker button {
    background-color: #e58f33;
    margin: 0rem 0 0.5rem 0;
    padding: 1rem 0;
    width: 100%;
    text-align: center;
    font-size: 0.875rem;
    border-radius: 2px;   
}

/* Add padding to some cards so that their content is not initially obscured by the fancy and     translucent app bar */

#galleryContainer, #details {
    padding-top: 3rem;
}


x-deck > x-card:not([selected]):not([leaving]) {
    display: none;
    pointer-events: none;
}

/* Overwriting the defaults to have a nice transition when closing the file picker */
x-modal {
    transition: opacity 0.5s;
    opacity: 1;
}

x-modal[hidden] {
    display: block;
    opacity: 0;
}

x-modal[hidden] input, x-modal[hidden] button {
    pointer-events: none;
}



/* Since the canvas where the processed images are shown is behind everything else,
 * we'll make the browser ignore mouse events in the deck, but explicitly allow them
 * on the input elements we care about
 */
#app > section, #additionalControls {
    -webkit-pointer-events: none;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

#switchVideo, #gallery, #details, #btnVideoCancel, #btnVideoDone, #cameraCoachMarks, #filePicker, #btnFilePicker, .btnCapture, #additionalControls > div * {
    -webkit-pointer-events: auto;
    pointer-events: auto;
}

.non_selectable {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-pointer-events: none;
    pointer-events: none;
}

.modal {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
}
