/* Colour palette */
/* F6F1F1 */
/* AFD3E2 */
/* 19A7CE */
/* 146C94 */

/* Variables */
:root{
    --border: #146C94;
    --border-radius: 5px;
    --font-family-base: Arial, sans-serif;
    --flash-color: #F7FFF5;
}

/* Webkit animations */
@-webkit-keyframes in {
    0% { -webkit-transform: scale(0) rotate(12deg); opacity: 0; visibility: hidden;  }
    100% { -webkit-transform: scale(1) rotate(0); opacity: 1; visibility: visible; }
  }
  
  @keyframes in {
    0% { transform: scale(0) rotate(12deg); opacity: 0; visibility: hidden;  }
    100% { transform: scale(1) rotate(0); opacity: 1; visibility: visible; }
  }
  
  @-webkit-keyframes out {
    0% { -webkit-transform: scale(1) rotate(0); opacity: 1; visibility: visible; }
    100% { -webkit-transform: scale(0) rotate(-12deg); opacity: 0; visibility: hidden; }
  }
  
  @keyframes out {
    0% { transform: scale(1) rotate(0); opacity: 1; visibility: visible; }
    100% { transform: scale(0) rotate(-12deg); opacity: 0; visibility: hidden;  }
  }

  .flash {
    animation: flash 0.5s ease-out;
    animation-iteration-count: 1;

    -moz-animation: flash 0.5s ease-out;
    -moz-animation-iteration-count: 1;
  
    -webkit-animation: flash 0.5s ease-out;
    -webkit-animation-iteration-count: 1;
  
    -ms-animation: flash 0.5s ease-out;
    -ms-animation-iteration-count: 1;
  }
  
  @keyframes flash {
      0% { background-color: transparent; }
      50% { background-color: var(--flash-color); }
      100% { background-color: transparent; }
  }
  
  @-webkit-keyframes flash {
      0% { background-color: transparent; }
      50% { background-color: var(--flash-color); }
      100% { background-color: transparent; }
  }
  
  @-moz-keyframes flash {
      0% { background-color: transparent; }
      50% { background-color: var(--flash-color); }
      100% { background-color: transparent; }
  }
  
  @-ms-keyframes flash {
      0% { background-color: transparent; }
      50% { background-color: var(--flash-color); }
      100% { background-color: transparent; }
  }

/* Base app styling */
body {
    margin: 0;
    padding: 0;
    background-color: #F6F1F1;
    font-family: var(--font-family-base);
}

#camera {
    /* Width is the smallest of: 500px, screen width, or the width that keeps
       height (width*1.5) + button (55px) within the viewport height. */
    width: min(500px, 100vw, calc((100dvh - 55px) / 1.5));
    margin: 0 auto;
    margin-bottom: 75px;
    text-align: center;
    position: relative;
    /* Stack video and button so button is always visible at the bottom */
    display: flex;
    flex-direction: column;
}

#flash{
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    display: none;
    border-radius: 10px;
}

video{
    /* border-radius: 10px 10px 0 0; */
    background-color: black;
    object-fit: cover;
    /* Fill all available height inside #camera, leaving room for the button */
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: block;
}

.flipped{
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
}

.button{
    font-size: 1.5em;
    padding: 15px;
    background-color: #146C94;
    color: white;
    font-weight: bold;
    border: 0;
    border-radius: 0 0 10px 10px;
    width: 100%;
    margin-top: -5px;
    flex: 0 0 auto;
}

#canvas {
    display: none;
}

/* Reel and feed styling */
.reel{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 10px auto;
    max-width: 500px;
	max-height: 750px;
	aspect-ratio: 500/750;
    background-color: #FFFFFF;
    border-radius: var(--border-radius);
}

.photo {
    width: calc(50% - 10px);
    margin: 0px;
    height: 200px;
    padding-bottom: 0;
    object-fit: none;
}

.grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0px;
    max-width: 600px;
}

.grid-photo {
    max-width: 50%;
    max-height: 350px;
	/*margin-right: 5px;*/
    padding-bottom: 0;
    object-fit: contain;
}

.grid-caption {
    /*margin-bottom: 20px;*/
    text-align: center;
	height: 50px;
	font-size: 25px;
	width: auto;
	font-family: 'Brush Script MT', cursive;
}

.container{
    /*margin: 20px auto;*/
    text-align: center;
}

/* Printbutton styling */
.printButton{
    font-size: 1em;
    padding: 10px;
    background-color: #146C94;
    color: white;
    font-weight: bold;
    width: 100%;
    border: 0px;
    margin-top: -20px;
    border-radius: 0 0 10px 10px;
}

.printButtonContainer{
    margin: 0 auto;
    margin-bottom: 20px;
    max-width: 500px;
}


@media only screen and (max-width: 800px) {
    #cameraSwitchButton{
        position: absolute;
        right: 1%;
        top: 1%;      /* top of the video, not bottom — avoids overlap with Take Photo */
        z-index: 11;
    }
}

@media only screen and (min-width: 800px) {
    #cameraSwitchButton{
        display: none;
    }
    /*.reel{
        max-width: 500px;
    }*/
}

/* Succesbox styling */
#succesBox{
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    background-color: #AFD3E2;
    text-align: center;
    display: none;
    border-radius: var(--border-radius);
    font-size: 0.5em;
    z-index: 10;
}

#succesBox.show{
    -webkit-animation: in 700ms ease both;
    animation: in 700ms ease both;
}

#succesBox.hide {
    -webkit-animation: out 700ms ease both;
    animation: out 700ms ease both;
}

#succesBox > img{
    height: 240px;
    width: 240px;
    border: 5px solid var(--border);
    border-radius: var(--border-radius);
}

img.reel {
	width: 101%;
}

/* Previous photos (from cookies) */
#oldFeed {
    margin: 20px auto;
    max-width: 500px;
    text-align: center;
}

.oldFeedTitle {
    font-family: var(--font-family-base);
    color: #146C94;
    font-size: 1.2em;
    margin-bottom: 10px;
}

img.reelHistory {
    width: 100%;
    display: block;
    margin: 10px auto;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.confirm{
    display: grid;
    grid-template-columns: 33.33% 33.33% 33.33%;
    background-color: #AFD3E2; 
    border-radius: 0 0 10px 10px;
    margin-top: 20px;
}

.cancelButton, .confirmButton{
    font-size: 1em;
    padding: 10px;
    color: white;
    font-weight: bold;
    width: 100%;
    border: 0px;
    margin-top: -20px;
}

.cancelButton{
    background-color: #F74F31;
    border-radius: 0 0 0 10px;
}

.confirmButton{
    background-color: #21C552;
    border-radius: 0 0 10px 0;
}

.confirm .sureText{
    padding-top: 10px;
    background-color: #AFD3E2;
    width: 100%;
    margin-top: -20px;
}