:root { 
    --main-bg-color: white;
    --primary-color: #0562EE;        
    --main-font-family: Arial, Helvetica, sans-serif;
    --button-selected-bg-color: #27CC95;
    --z-index-header: 1000;
    --z-index-footer: 1000;
    --z-index-action: 2000;
    --z-index-embedded: 3000;
    --z-index-alert: 9000;
    --vp-width: 100vw;
    --vp-height: 100vh;
    --loader-period: 1s;
    --bottom-button-icon-size: 2rem;
    --bottom-button-label-size: 0.75rem;
    --tutorial-text-size: 1.5em;
	--tutorial-footer-fixed-bottom: 16px;
}

@media screen /* and (min-width:320px) and (max-width:960px)*/ and (orientation: landscape) {
    :root {
        --vp-width: 100vh;
        --vp-height: 100vw;
    }
}

:root {
    --header-bar-height: calc(0.2 * var(--vp-width));
    --bottom-bar-height: calc(0.2 * var(--vp-width));
    --bottom-icon-size: 2rem;
    --header-icon-size: 2rem;
    --bottom-button-icon-bottom-offset: calc(0.4 * var(--bottom-bar-height));
    --bottom-button-label-bottom-offset: calc(0.2 * var(--bottom-bar-height));
    --history-item-min-height: calc(0.3 * var(--vp-width));
    --history-item-image-height: calc(0.2 * var(--vp-width));
}

*, *:before, *:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    background-color: var(--main-bg-color);
    color:black;
    font-family: var(--main-font-family);
    font-size: 17px;
}

#orientation-wrapper{
    position: absolute;
    top: 0;
    left: 0;
    width: var(--vp-width);
    height: var(--vp-height);
    background-color: var(--main-bg-color);
}

@media screen /* and (min-width:320px) and (max-width:960px)*/ and (orientation: landscape) {
    #orientation-wrapper {
        transform: rotate(-90deg);
        transform-origin: top right;
        left: -100vh;
        top: 0;
    }
}

html {
    left: 0%;
    top: 0%;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    touch-action: pan-x pan-y;
}
/* to compute device diagonal in inches */
#dpi {
    display: block;
    height: 1in;
    width: 1in;
    position: fixed;
    top: 0;
    left:0%;
    z-index: -1000;
    background-color: transparent;
}

div.pageblock {
    width: var(--vp-width);
}

#url-container {
    position: absolute;
    width: var(--vp-width);
    height: 100%;
    top: 0;
    z-index: var(--z-index-embedded);
}

#url-container .url-container-close {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 48px;
    font-size: xx-large;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}

#url-container > iframe {
    width: var(--vp-width);
    height: 100%;
}

#tutorial-bloc1, #index-bloc1, #camera-bloc1, #history-bloc1 {
    position: fixed;
    top: 0;
    height: var(--header-bar-height);
    z-index: var(--z-index-header);
}

#tutorial-bloc2, #index-bloc2, #camera-bloc2, #history-bloc2 {
    position: fixed;
    top: 0;
    height: 100%;
    max-height: 100%;
    text-align: center;
}

#tutorial-bloc3, #index-bloc3, #camera-bloc3, #history-bloc3 {
    position: fixed;
    bottom: 0;
    height: var(--bottom-bar-height);
    z-index: var(--z-index-footer);
    overflow: visible;
    text-align:center;
}

#lottie-player {
    margin: auto;
    max-width: calc(0.5*var(--vp-height));
}

a.bt-camera, a.bt-history {
    width: 50%;
    height: 100%;
    display: inline-block;
    text-align: center;
}


a.bt-camera {
    position:absolute;
    left:0;
}
a.bt-history {
    position:absolute;
    right:0;
}

a.bt-camera i, a.bt-history i {
    color: var(--primary-color);
    background-color: transparent;
    font-size: var(--bottom-button-icon-size);
    position: absolute;
    bottom: var(--bottom-button-icon-bottom-offset);
    transform: translateX(-50%);
}

a.bt-camera .bt-label, a.bt-history .bt-label {
    display: inline-block;
    background: transparent;
    position: absolute;
    bottom: var(--bottom-button-label-bottom-offset);
    font-size: var(--bottom-button-label-size);
    color: var(--primary-color);
    transform: translateX(-50%);
    display: inline-block;
    width: inherit;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

a.bt-camera.active, a.bt-history.active {
    background-color: var(--button-selected-bg-color);
}

#index-bloc2 img {
    max-height: 100%;
    max-width: 90%;
    width: auto;
    height: auto;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}

#camera #bloc1 {
    display: none;
}

#camera .big-button {
    position: fixed;
    background-color: transparent;
    width: var(--bottom-icon-size);
    height: var(--bottom-icon-size);
    cursor: pointer;
    bottom: calc(1.25 * var(--bottom-bar-height));
}

#camera .big-button-icon {
    position: static;
    background-color: transparent;
    color: var(--primary-color);
    font-size: var(--bottom-icon-size);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#camera #takePhotoButtonId {
    padding: 36px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #00000040;
    border-radius: 50%;
    border: 2px solid white;
}

#camera #importPhotoButtonId {
    padding: 36px;
    left: 0;
}

#camera #camera-tutorial {
    padding: 36px;
    right: 0;
    top: 0
}
#camera #camera-switch {
    padding: 36px;
    right: 0;
}

#camera #selectPhotoInDeviceAlbum {
    display: none;
}

#picture-container {
    position: fixed;
    width: var(--vp-width);
    height: var(--vp-height);
    top: 0;
    bottom: 0;
    left: 0%;
    z-index: var(--z-index-action);
}
#picture-info {
    display: block;
    position: relative;
    height: 100%;
    min-height: 30em;
}
#picture-title {
    width: 100%;
    height: 7%;
    font-size: 1.4em;
    background: #ebebeb;
    text-align: center;
}

#picture-title .picture-info-close {
    position: absolute;
    left: 0;
    top: 0;
    font-size:1.2em;
    color: white;
    background-color: transparent;
    width: 48px;
    height: 48px;
    line-height: 48px;
    /* font-size: xx-large; */
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    text-align: center;
    cursor: pointer;
}

#picture-actions {
    background-color: #e0e0e0;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    overflow-y: auto;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding-bottom: 128px;
    position:relative;
}
#picture-actions .picture-action {
    box-sizing: content-box;
    color: white;
    background: rgba(48,48,48,0.6);
    background-repeat: no-repeat;
    padding: 10px;
    margin: 10px;
    text-align: center;
    cursor: pointer;
    position:relative;
}
#picture-actions .picture-action .picture-action-text {
    background-color: transparent;
    width: 96%;
    position:absolute;
    left:2%;
}
#picture-actions .picture-action .picture-action-icon {
    background-color: transparent;
    background-size: 32px;
    background-position: 1% center;
    width: 96%;
    height: 96%;
    background-repeat: no-repeat;
    position:absolute;
    left:2%;
    top:2%;
}

#history .history-header {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    justify-content: space-between;
    background-color: var(--primary-color);
    padding: 0 32px;
    height: 100%;
}

#history .history-title {
    background-color: transparent;
    color: white;
    font-size: 1.5rem;
}

#history #history-list {
    height: 100%;
    overflow-y: auto;
    padding-bottom: 96px;
}

#history #history-list-container {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
}

#history .history-delete-button {
    background-color: var(--primary-color);
    font-size: var(--header-icon-size);
    color: white;
    cursor: pointer;
}

#history .history-item {
    display: inline-block;
    width: 45%;
    min-height: var(--history-item-min-height);
    height: auto;
    margin: 16px 8px;
    cursor:pointer;
    background-color: var(--main-font-family);
    box-shadow: 4px 4px 8px 2px gray;
}

#history .history-item-image-title {
    display: flex;
    flex-flow: column nowrap;
    align-items: start;
    position: relative;
    margin: 8px;
}

#history .history-item-image {
    width: 100%;
    height: var(--history-item-image-height);
    align-self: center;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-clip: content-box;
}

#history .history-item-title {
    width: 100%;
    margin: 8px 0;
    background-color: transparent;
    text-align: start;
    font-size: 1rem;
}

#history .history-item-date {
    width: 100%;
    margin: 8px 0;
    background-color: transparent;
    text-align: start;
    font-style: italic;
    color: gray;
    font-size: 1rem;
}

.video-container {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    object-fit: cover;
}

.load-spinner {
    background-color: transparent;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 64px;
    height: 64px;
    -webkit-animation: loader-spin var(--loader-period) linear infinite; /* Safari */
    animation: loader-spin var(--loader-period) linear infinite;
    position: absolute;
    top: 40%;
    left: 50%;
    z-index: var(--z-index-alert);
    display: none;
  }
  
  /* Safari */
  @-webkit-keyframes loader-spin {
    0% { -webkit-transform: translate(-50%, -50%) rotate(0deg); }
    100% { -webkit-transform: translate(-50%, -50%) rotate(360deg); }
  }
  
  @keyframes loader-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
  }
  
.ui-dialog {
    z-index:9999 !important;
    background:#fff !important;
    border:none !important;
    color:var(--primary-color) !important;
    border-radius: 5px;
}
.ui-dialog-titlebar, .ui-dialog-title, .ui-dialog-content {
    background:none !important;
    color:var(--primary-color) !important;
}
.ui-dialog-titlebar {
    border:none;
    border-bottom:1px solid var(--primary-color); 
}
.ui-dialog-buttonpane {
    border:none;
    border-top:1px solid var(--primary-color); 
    background:none !important;
}
.ui-button {
    border:1px solid var(--primary-color);
    background:#fff !important;
    color:var(--primary-color) !important;
    font-weight:bold;
}

.ui-button:active {
    border:1px solid var(--button-selected-bg-color);
    color:var(--button-selected-bg-color) !important;
}

.ui-dialog-titlebar, .ui-resizable-handle {
    display:none !important;
}
.ui-widget-overlay {
    z-index:9998 !important;
    background: #000;
    opacity: 0.7;
}

lottie-player {    
    background: transparent;
}

.tutorial-anim {
    height: 50%;
    background: transparent;
}

.tutorial-footer {
	position: fixed;
	bottom: var(--tutorial-footer-fixed-bottom);
	height: 40%;
    background:transparent;
}

.tutorial-text-container {
    display: flex; 
    height: 70%; 
    width: 100%; 
    justify-content: center; 
    align-items: center;
    background-color: transparent;
}

.tutorial-text {
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-style: italic;
    font-size: var(--tutorial-text-size);
    color: var(--primary-color);
    background-color: transparent;
}

.tutorial-button-container {
    display: flex; 
    height: 30%; 
    width: 100%; 
    justify-content: center; 
    align-items: center;
    background-color: transparent;
}
.tutorial-button-next {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 512px;
    min-width: 50%;
    background-color: transparent;
    padding: 16px;
    outline: none;
}

.tutorial-button-next:active {
    background-color: var(--button-selected-bg-color);
}
.tutorial-button-next:focus {
    border: none; 
}
