/*
 * Copyright (C) 2013 Glyptodon LLC
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

* {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

input[type=checkbox], input[type=text], textarea {
    -webkit-tap-highlight-color: rgba(128,192,128,0.5);
}

input[type=submit], button {
    -webkit-appearance: none;
}

body {
    background: #EEE;
    font-family: FreeSans, Helvetica, Arial, sans-serif;
    padding: 0;
    margin: 0;
}

#manage {
    display: none;
}

.admin #manage {
    display: inline-block;
}

button#manage {

    background-image: url('../images/action-icons/guac-config.png');
    background-repeat: no-repeat;
    background-size: 1em;
    background-position: 0.5em 0.45em;

    padding-left: 1.8em;

}

div#login-ui {
    height: 100%;
    width: 100%;
    position: fixed;
    left: 0;
    top: 0;
    display: table;
}

@keyframes shake-head {
    0%   { margin-left:  0.25em; margin-right: -0.25em; }
    25%  { margin-left: -0.25em; margin-right:  0.25em; }
    50%  { margin-left:  0.25em; margin-right: -0.25em; }
    75%  { margin-left: -0.25em; margin-right:  0.25em; }
    100% { margin-left:  0.00em; margin-right:  0.00em; }
}

@-webkit-keyframes shake-head {
    0%   { margin-left:  0.25em; margin-right: -0.25em; }
    25%  { margin-left: -0.25em; margin-right:  0.25em; }
    50%  { margin-left:  0.25em; margin-right: -0.25em; }
    75%  { margin-left: -0.25em; margin-right:  0.25em; }
    100% { margin-left:  0.00em; margin-right:  0.00em; }
}

p#login-error {
    display: none;
}

.error p#login-error {
    display: block;

    position: fixed;
    left: 0;
    right: 0;
    top: 0;

    padding: 1em;
    margin: 0.2em;

    background: #FDD;
    border: 1px solid #964040;
    -moz-border-radius: 0.25em;
    -webkit-border-radius: 0.25em;
    -khtml-border-radius: 0.25em;
    text-align: center;
    color: #964040;
}

.error #login-form {
    animation-name: shake-head;
    animation-duration: 0.25s;
    animation-timing-function: linear;
    -webkit-animation-name: shake-head;
    -webkit-animation-duration: 0.25s;
    -webkit-animation-timing-function: linear;
}

div#login-logo {
    position: relative;
    bottom: 0;
    display: inline-block;
    vertical-align: middle;
}

div#login-dialog-middle {
    width: 100%;
    display: table-cell;
    vertical-align: middle;
    text-align: center;
}

div#login-dialog {

    max-width: 75%;
    text-align: left;

    display: inline-block;
}

div#login-dialog h1 {
    margin-top: 0;
    margin-bottom: 0em;
    text-align: center;
}

div#login-dialog #buttons {
    padding-top: 0.5em;
    text-align: right;
}

input[type="submit"]#login, button#login {

    background-image: url('../images/guacamole-logo-64.png');
    background-repeat: no-repeat;
    background-size: 1.5em;
    background-position: 0.5em 0.25em;

    padding-left: 2.5em;

}

div#login-dialog #login-fields {
    
    vertical-align: middle;

    padding: 1em;
    border-top: 1px solid #999;
    border-bottom: 1px solid #999;

}

div#login-dialog th {
    text-shadow: 1px 1px white;
}

div#login-dialog #login-fields input {
    border: 1px solid #777;
    -moz-border-radius: 0.2em;
    -webkit-border-radius: 0.2em;
    -khtml-border-radius: 0.2em;
    border-radius: 0.2em;
    width: 100%;
}

div#login-dialog #login-fields img.logo {
    position: fixed;
    margin: 10px;
    left: 0;
    bottom: 0;
    opacity: 0.1;
    z-index: -1;
}

div#version {
    text-align: center;
    font-style: italic;
    font-size: 0.75em;
    color: black;
    opacity: 0.5;

    padding: 0.5em;
}

img {
    border: none;
}

img#license {
    float: right;
    margin: 2px;
}

div#connection-list-ui h1 {
    
    margin: 0;
    padding: 0.5em;

    font-size: 2em;
    vertical-align: middle;
    text-align: center;

}

div#connection-list-ui h2 {

    padding: 0.5em;
    margin: 0;
    font-size: 1.5em;

    font-weight: lighter;
    text-shadow: 1px 1px white;

    border-top: 1px solid #AAA;
    border-bottom: 1px solid #AAA;
    background: #DDD;
    
}

div#connection-list-ui img {
    vertical-align: middle;
}

div#logout-panel {
    padding: 0.45em;
    text-align: right;
    float: right;
}

.history-unavailable div#recent-connections {
    display: none;
}

div#recent-connections,
div#clipboardDiv,
div#settings,
div#all-connections {
    margin: 1em;
    padding: 0;
}

#all-connections .list-buttons {
    text-align: center;
    padding: 0;
}

div#recent-connections {
    text-align: center;
}

#no-recent {

    color: black;
    text-shadow: 1px 1px white;
    opacity: 0.5;
    
    font-size: 2em;
    font-weight: bolder;
}

div#recent-connections div.connection {
    -moz-border-radius: 0.5em;
    -webkit-border-radius: 0.5em;
    -khtml-border-radius: 0.5em;
    border-radius: 0.5em;
    display: inline-block;
    padding: 1em;
    margin: 1em;
    text-align: center;
    max-width: 75%;
    overflow: hidden;
}

.group,
.connection {
    cursor: pointer;
}

.connection:hover {
    background: #CDA;
}

.group,
.connection .name {
    color: black;
    font-weight: normal;
    padding: 0.1em;
}

.connection .thumbnail {
    margin: 0.5em;
}

.connection .thumbnail img {
    border: 1px solid black;
    box-shadow: 1px 1px 5px black;
    max-width: 75%;
}

div#all-connections .connection {
    display: block;
    text-align: left;
}

div#recent-connections .connection .thumbnail {
    display: block;
}

div#all-connections .connection {
    padding: 0.1em;
}

div#recent-connections .protocol {
    display: none;
}

.caption * {
    vertical-align: middle;
}

.caption .name {
    margin-left: 0.25em;
}

#clipboardDiv textarea {
    width: 100%;
    border: 1px solid #AAA;
    -moz-border-radius: 0.25em;
    -webkit-border-radius: 0.25em;
    -khtml-border-radius: 0.25em;
    border-radius: 0.25em;
    white-space: pre;
}

#settings dt {
    border-bottom: 1px dotted #AAA;
    padding-bottom: 0.25em;
}

#settings dd {
    margin: 1.5em;
    margin-left: 2.5em;
    font-size: 0.75em;
}