/*
 * HTML5 Boilerplate
 *
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */
@font-face {
  font-family: 'Ubuntu Condensed';
  font-style: normal;
  font-weight: 400;
  src: local('Ubuntu Condensed'), local('UbuntuCondensed-Regular'), url('../fonts/ubuntu.woff') format('woff');
}
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  src: local('Lato Regular'), local('Lato-Regular'), url('../fonts/lato.woff') format('woff');
}
@font-face {
  font-family: 'Bitter';
  font-style: normal;
  font-weight: 400;
  src: local('Bitter-Regular'), url('../fonts/bitter.woff') format('woff');
}
@font-face {
  font-family: 'Titillium Web';
  font-style: normal;
  font-weight: 400;
  src: local('Titillium Web'), local('TitilliumWeb-Regular'), url('../fonts/titillium.woff') format('woff');
}
@font-face {
  font-family: 'Cantarell';
  font-style: normal;
  font-weight: 400;
  src: local('Cantarell Regular'), local('Cantarell-Regular'), url('../fonts/cantarell.woff') format('woff');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto Regular'), local('Roboto-Regular'), url('../fonts/roboto.woff') format('woff');
}

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html,
button,
input,
select,
textarea {
    color: #222;
}

body {
    font-size: 1em;
    line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight: h5bp.com/i
 * These selection declarations have to be separate.
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: transparent;
    text-shadow: none;
}

::selection {
    background: transparent;
    text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between images and the bottom of their containers: h5bp.com/i/440
 */

img {
    vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Chrome Frame prompt
   ========================================================================== */

.chromeframe {
    margin: 0.2em 0;
    background: #ccc;
    color: #000;
    padding: 0.2em 0;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

$app_width: 280px;
$app_height: 450px;

body {
    font-family: "Ubuntu Condensed";
}
body.ubuntufont {
    .city, .forecast > div {
        text-transform: uppercase;
    }
    .city {
        letter-spacing: -2px;
    }
    .stats .left {
        letter-spacing: -7px;
    }
}
body.lato {
    font-family: "Lato";
}
body.bitter {
    font-family: "Bitter";
}
body.titillium {
    font-family: "Titillium Web";
    .stats .left {
        letter-spacing: -8px;
    }
}
body.cantarell {
    font-family: "Cantarell";
    .city {
        letter-spacing: -2px;
    }
    .stats .left {
        letter-spacing: -8px;
    }
}
body.roboto {
    font-family: "Roboto";
}

body.drag {
    -webkit-app-region: drag;
}

#error {
    position: absolute;
    width: 100%;
    padding-top: 50px;
    top: 30px;
    bottom: 0;
    height: 200px;
    z-index: 2000000001;
    background: #2f75af;
    color: #fff;
    display: none;
    text-align: center;
    font-family: 'Ubuntu Condensed';
}

#background {
    width: $app_width;
    height: $app_height;
    position: relative;
    background: #fff;
    overflow: hidden;
}
#credits, #pro {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    top: 0;
    overflow-x: auto;
    color: #444;
    z-index: 10;
    font-size: 15px;
    padding: 20px;
    font-family: 'Ubuntu Condensed';
    background: #f7f7f7;
    -webkit-animation: 500ms ease credits-show 1;
    -webkit-transform-origin: left;
    -webkit-transform-style: preserve-3d;
    -webkit-transform: perspective(600px) rotateY(-90deg);

    &.show {
        -webkit-transform: perspective(600px) rotateY(0deg);
    }
    &.anim {
        -webkit-transition: 500ms ease all;
    }

    strong {
        letter-spacing: -1px;
    }


    img {
        cursor: pointer;
    }

    ul {
        padding-left: 1.5em;
    }
    h1, h2 {
        margin-top: 0.3em;
        margin-bottom: 0.2em;
        color: #222;
        letter-spacing: -1px;
    }
    p {
        margin-top: 0;
    }
    a {
        text-decoration: none;
        color: #444;

        &:hover {
            text-decoration: underline;
        }
    }
}

#credits::-webkit-scrollbar-track {
    background: #f7f7f7;
}
#pro {
    img {
        float: left;
        margin-right: 80%;
        margin-bottom: 10%;
    }
    h1 {
        font-size: 30px;
    }
    font-size: 16px;
    text-align: center;

    textarea {
        font-family: monospace;
        font-size: 12px;
        resize: none;
        border: 1px solid #ccc;
        width: 85%;
        height: 70px
    }

    a {
        color: #fff;
        &:hover {
            text-decoration: none;
        }
    }
    .activated {
        margin-top: 5px;
        color: green;
        display: none;
    }
}

img {
    -webkit-user-drag: none;
    cursor: default;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

#container {
    width: 100%;
    height: 100%;

    -webkit-touch-callout: none;
    -webkit-user-select: none;

    -webkit-transition-property: background-color;
    -webkit-transition-duration: 300ms;
    -webkit-transition-timing-function: ease;

    ul {
        padding: 0;
        margin: 0;
        list-style-type: none;
        -webkit-transition: 300ms opacity ease;

        &.transparent {
            opacity: 0;
        }
    }

    li {
        position: absolute;
        top:0;
        left:0;
        visibility: hidden;

        &.current {
            visibility: visible;
        }
    }
}

.middle {
    width: $app_width;
    height: $app_height;
    overflow: auto;
    color: #fff;
}

.top {
    text-align: center;
    height: 20%;

    //Crazy Flexbox Shit.
    display: -webkit-box;
    -webkit-box-orient: vertical;
    display: -webkit-flex;
    -webkit-flex-direction: column;
}
.padding {
    height: 30px;
}
#panel {
    height: 30px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    color: #fff;

    -webkit-transition: 300ms ease opacity;

    &.dim {
        opacity: 0.3;

        .sync {
            opacity: 0;
            cursor: default;
        }
    }

    &.error .sliderControls, &.error .sync {
        display: none;
    }

    .sliderControls {
        position: absolute;
        top: 3px;
        right: 7px;

        img {
            height: 21px;
            margin-left: 4px;
            cursor: pointer;
            -webkit-transition: 150ms ease opacity;

            &:hover {
                opacity: 0.6;
            }
        }
    }

    .sync {
        right: 50px;
        width: 13px;
        position: absolute;
        height: 30px;
        -webkit-transition: 300ms ease opacity;

        &.pulse {
            -webkit-animation: pulse 800ms linear infinite;
        }

        &:hover {
            opacity: 0.6;
        }
    }
    .sync img {
        cursor: pointer;
        width: 16px;
        height: 16px;
        padding: 7px 0;
    }
    .settings {
        right: 76px;
        width: 13px;
        position: absolute;
        height: 30px;
        -webkit-transition: 300ms ease opacity;

        &:hover {
            opacity: 0.6;
        }

        img {
            cursor: pointer;
            width: 17px;
            height: 17px;
            padding: 7px 0;
        }
    }
    .close, .minimize {
        font-family: monospace;
        font-size: 18px;
        width: 30px;
        height: 30px;
        display: inline-block;
        text-align: center;
        font-weight: bold;
        background: rgba(0,0,0,0.05);
        cursor: default;
        position:absolute;
        -webkit-transition: 200ms ease background;

        &:hover {
            background: rgba(0,0,0,0.2);
        }

    }
    .close {
        line-height: 34px;
        left: 0;
    }
    .minimize {
        left: 30px;
        line-height: 38px;
    }
    div {
        -webkit-app-region: no-drag;
    }
}

.city {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    position: relative;
    letter-spacing: -1px;

    div {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;

        &:before {
          content: '';
          display: inline-block;
          height: 100%;
          vertical-align: middle;
        }
        a {
            text-decoration: none;
            color: #fff;
        }
        span {
            display: inline-block;
            cursor: pointer;

            &:hover {
                &::after {
                    position: absolute;
                    color: rgba(255,255,255,0.5);
                    content: "\00A0\221E";
                }
            }
        }
    }
}

.weather {
    height: 30%;
    text-align: center;
    box-sizing: border-box;

    img {
        height: 100%;
    }
}
.stats {
    height: 25%;
    font-size: 0;

    .left, .right {
        width: 50%;
        height: 100%;
        display: inline-block;
        font-size: 13px;
        vertical-align: top;
        position: relative;
    }

    .right > div, .left div {
        position: absolute;
        height: 100%;
        top: 0;

        &:before {
            content: '';
            display: inline-block;
            height: 100%;
            vertical-align: middle;
        }
    }

    .left {
        text-align: right;
        letter-spacing: -6px;

        div {
            right: 5%;

            span {
                display: inline-block;
                cursor: default;
            }
        }
    }
    .right > div {
        left: 5%;
    }
    .right > div > div {
        display: inline-block;
        position: relative;
        top: 8%;
        line-height: 1.25;
        letter-spacing: -2px;
    }
}
.forecast {
    height: 23%;
    display: -webkit-box;
    display: -webkit-flex;

    & > div {
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        display: -webkit-box;
        display: -webkit-flex;
        -webkit-box-orient: vertical;
        -webkit-flex-direction: column;
        text-align: center;
        letter-spacing: -1px;

        & > span {
            display: block;
            cursor: default;
        }

        span.day {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            cursor: default;
        }
        span.code {
            -webkit-box-flex: 2;
            -webkit-flex: 2;
            cursor: default;

            img {
                height: auto;
                width: 65%;
            }
        }
        span.temp {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            cursor: default;
        }
    }
}

//Other crap
input[type=checkbox] {
    border: 2px solid #222;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin: 0;
    background: #333;
    background-size: 90%;
    background-repeat: no-repeat;
    background-position: 50%;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #222;
}

::-webkit-scrollbar-thumb {
    background: #555;
}

//Settings

@-webkit-keyframes opacity {
0% {opacity: 0;}
100% {opacity: 1;}
}
@-webkit-keyframes pulse {
0% {opacity: 0;}
50% {opacity: 1;}
100% {opacity:0;}
}
@-webkit-keyframes spinning {
0% { -webkit-transform: rotate(0deg);}
100% {-webkit-transform: rotate(360deg);}
}
@-webkit-keyframes deletion {
    0% {
        -webkit-transform: translateX(0%);
        height: 23px;
        padding: 2px 0;
    }
    50% {
        -webkit-transform: translateX(-130%);
        height: 23px;
        padding: 2px 0;
    }
    100% {
        -webkit-transform: translateX(-130%);
        height: 0;
        padding: 0;
    }
}

#settings {
    -webkit-app-region: no-drag;
    background: #333;
    font-family: "Ubuntu Condensed";
    color: #fff;
    box-sizing: border-box;
    overflow-y: auto;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    .locationSettings {

        ul {

            padding: 0;
            margin: 0;

            li {

                &.sortable-placeholder {
                    height: 21px;
                }

                &.placeInput {

                    font-size:0;
                    position: relative;

                    input {
                        outline: 0;
                        background: #333;
                        color: white;
                        font-family: "Ubuntu Condensed";
                        font-size: 15px;
                        border: 0;
                        height: 17px;
                        padding: 5px 30px 5px 20px;
                        position: relative;
                        margin-left: -20px;
                        width: 100%;
                    }

                    .status {
                        display: inline-block;
                        width: 27px;
                        height: 27px;
                        vertical-align: top;
                        position: absolute;
                        top: 0;
                        right: 0;
                        font-size: 15px;
                        color: #fff;
                        -webkit-animation: 600ms ease showinput 1;

                        &.thinking {
                            background: url(../img/sync.svg) no-repeat 50% 50%;
                            background-size: 14px;
                            -webkit-animation: spinning 1200ms linear infinite;

                        }
                        &.error::before {
                            content: "\2715";
                            text-align: center;
                            position: absolute;
                            width: 27px;
                            height: 27px;
                            line-height: 27px;
                        }
                        &.success {
                            cursor: pointer;
                            border: 2px solid #222222;
                            padding: 1px 5px;
                            height: 22px;
                            text-align: center;
                            margin-top: 1px;

                            &:hover {
                                background: #444;
                            }

                            &:active {
                                background: #222;
                            }

                            &::after {
                                content: "Add";
                            }
                        }
                    }
                }

                .delete {
                    float: right;
                    padding: 0 5px;
                    font-size: 14px;
                    cursor: pointer;
                    -webkit-animation: 150ms ease opacity 1;
                }

                font-size: 15px;
                list-style-type: none;
                padding: 2px 0;
                -webkit-transition: 300ms ease -webkit-transform;

                &.deleting {
                    -webkit-animation: 500ms ease deletion 1;
                    -webkit-transform: translateX(-130%);
                    height: 0;
                    padding: 0;
                }
            }
        }
    }

    .wrapperTwenty {
        padding: 10px 20px 20px;
    }
    .pro {
        position: relative;
        top: 5px;
    }
}

select {
    background-color: #444;
    -webkit-appearance: none;
    color: #fff;
    outline: 0;
    border-radius: 0;
    border: 2px solid #222222;
    padding: 5px 10px;
    font-family: "Ubuntu Condensed";
    margin: 5px 0;
    width: 150px;
    font-size: 17px;
    background-image: url(../img/right.svg);
    background-repeat: no-repeat;
    background-position: 128px;
    background-size: 14px;
}

.toggleswitch.measurement {
    font-family: "ClimaconsRegular";
    font-size: 32px;
    margin-top: 5px;
}
.measurement span {
    padding: 0 7px 5px 10px;
}

.toggleswitch {
    margin-top: 10px;

    span {
        display: inline-block;
        line-height: 1;
        vertical-align: top;
        -webkit-transition: 150ms ease background-color;
        cursor: default;
        box-sizing: border-box;
        width: 44px;

        border: 2px solid #222;
        border-right: 0;
        background-color: #333;
        cursor: default;

        img {
            height: 20px;
            position: relative;
            left: -2px;
            top: -1px;
        }

        &.selected, &:hover {
            background-color: #555;
        }

        &:last-child {
            border-right: 2px solid #222;
        }

    }

    &.speed span {
        line-height: 35px;
        padding: 0 7px;
        box-sizing: border-box;
        height: 41px;
        text-align: center;
    }
}
.measurement span[data-type=k] {
    font-family: "Ubuntu Condensed";
    font-size: 18px;
    line-height: 36px;
    height: 41px;
    padding: 0px 14px 0px;
    vertical-align: top;
    font-weight: bold;
    cursor: default;
}

.launcher {
    margin-top: 10px;
}
label {
    margin-left: 5px;
    vertical-align: top;
}
input[type=checkbox]:checked{
    background-image: url(../img/tick.svg);
}
.color.boxes {
    font-size: 0;
    margin-top: 10px;
    display: inline-block;
    border: 2px solid #333;

    span {
        height: 14px;
        width: 14px;
        display: inline-block;
        border: 4px solid rgba(0,0,0,0.4);
        cursor: default;

        &[data-color=gradient] {
            background: -webkit-linear-gradient(#0071B2, #D6411B);
            border: 0;
            height: 22px;
            width: 22px;
            border-right: 2px solid #333;
            cursor: default;
        }
    }
}

label.color {
    margin: 0;
    padding-top: 5px;
    display: inline-block;
}

.color.toggleswitch {
    margin-top: 5px;

    span {
        width: auto;
        height: 33px;
        line-height: 29px;
        padding: 0 10px;
    }
}

.btn {
    cursor: default;
    text-transform: uppercase;
    border: 2px solid #222;
    background: #333;
    color: white;
    -webkit-transition: 150ms ease background;
    font-family: "Ubuntu Condensed";
    font-size: 18px;
    padding: 3px 15px;
    letter-spacing: -1px;
    margin-top: 10px;
    display: inline-block;
    text-decoration: none;
    &:hover {
        background: #555;
    }
}

/* ================
   OS Specific Stuff
   ================ */
.chrome {
    #panel .close, #panel .minimize, .launcher {
        display: none;
    }
}

/* Pre hide sections with JavaScript on
--- */
#accordion {
    padding-top: 30px;
}

#accordion h3 {
    margin: 0;

    a {
        padding: 5px 15px;
        background: #222;
        letter-spacing: -1px;
        font-size: 18px;
        display: block;
        color: #fff;
        text-decoration: none;
        text-transform: uppercase;
        font-weight: normal;
    }
}

#accordion h3 + div {
    height: 0px;
    padding: 0px;
    overflow: hidden;
    background: #333;
    display: block!important;
    -webkit-transform: translateZ(0);
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    -ms-transition:all 0.3s ease;
    transition: all 0.3s ease;
}
#accordion .content {
  padding: 10px 15px;
}

#accordion h3.open + div {
  background: #333;
}

#proAdvert {
    padding: 10px 15px 20px;

    p {
        margin: 0;
    }
}




/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Image replacement
 */

.ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
    /* IE 6/7 fallback */
    *text-indent: -9999px;
}

.ir:before {
    content: "";
    display: block;
    width: 0;
    height: 100%;
}

/*
 * Hide from both screenreaders and browsers: h5bp.com/u
 */

.hidden {
    display: none !important;
    visibility: hidden;
}

/*
 * Hide only visually, but have it available for screenreaders: h5bp.com/v
 */

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element to be focusable
 * when navigated to via the keyboard: h5bp.com/p
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
}

/*
 * Hide visually and from screenreaders, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/*
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */

.clearfix {
    *zoom: 1;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   Theses examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
    /* Style adjustments for viewports that meet the condition */
}

@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (min-resolution: 144dpi) {
    /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid required HTTP connection: h5bp.com/r
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: #000 !important; /* Black prints faster: h5bp.com/s */
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links for images, or javascript/internal links
     */

    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* h5bp.com/t */
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 0.5cm;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
