/**
 * This file is used in index.html when the mobile application starts.
 * - *app* and *blink* classes defines the style for the app loader image.
 * - *retry-button* and *app-error* is used when an error occurs while updating
 * the application. If an error occurs, *app-error* will replace *app*.
 * - the logo (saved in img/logo.png) is set as background of the DOM elements
 * which contains *app* or *app-error* class.
 *
 * See eliom_loader.ml and index.html for more information.
 */

/* ------------------------------------------------------------- */
/* Defines rules for the animation. It is used by *blink* class. */

@keyframes fade {
    from { opacity: 1.0; }
    50% { opacity: 0.4; }
    to { opacity: 1.0; }
}

@-webkit-keyframes fade {
    from { opacity: 1.0; }
    50% { opacity: 0.4; }
    to { opacity: 1.0; }
}

* {
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
}

body {
    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
    background-color:#FFFFFF;
    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
    height:100%;
    margin:0px;
    padding:0px;
    width:100%;
}

/* --------------------- */
/* app and error classes */

/* Portrait layout (default) */
.app,                  /* text area height */
.app-error{
    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
    position:absolute;             /* position in the center of the screen */
    left:50%;
    top:50%;
    height:50px;                   /* text area height */
    width:225px;                   /* text area width */
    text-align:center;
    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with text) */
    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area height */
                                   /* offset horizontal: half of text area width */
    font-size: 16px;
}

/* Landscape layout (with min-width) */
@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
    .app {
        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image height */
        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
    }
    .app-error {
        padding:40px 0px 75px 420px;  /* padding-top + padding-bottom + text area = image height */
        margin:-90px 0px 0px -450px;  /* offset vertical: half of image height */
                                      /* offset horizontal: half of image width and text area width */
    }
}

/* -------------------------------- */
/* This class is the fade animation */

.blink {
    animation:fade 3000ms infinite;
    -webkit-animation:fade 3000ms infinite;
}

/* --------------------------------------------------------------- */
/* Style for the retry button when an error occurs while updating */

#retry-button {
    width: 100%;
    display: block;
    margin-top: 1.8rem;
    margin-bottom: 1.8rem;
    background-color: #64b5f6;
    color: white;
    height: 35px;
    border: none;
    font-size: 16px;
}
