/*
 * 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.
 */



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

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

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

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

a {
    color: #00e;
}

a:visited {
    color: #551a8b;
}

a:hover {
    color: #06e;
}

/*
 * 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;
}

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


@font-face {
    font-family: ATGRubrik;
    src: url(../assets/fonts/atgrubrik-webfont.woff) format("woff"),
         url(../assets/fonts/atgrubrik-webfont.ttf) format("truetype");
    font-weight: 400;
    font-style: normal
}



body {
    background-color: #ececed;

    display: flex;
    flex-direction: column;

    font-family: Roboto;
    font-size: 14px;
}

.top {
    background-color: #1a3f87;    
}

header {
    width: 100%;
    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    padding: 20px 20px;
    padding-bottom: 0px;
}
header p {
    max-width: 600px;

    margin-left: auto;
    margin-right: auto;

    margin-top: 20px;
    margin-bottom: 30px;

    color: white;
}
header .logos {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logos img.atg-logo {
    width: 50px;
}
.logos .flags {
}

.logos .flags img {
    display: inline-block;
    float: left;
    height: 24px;
    margin-left: 5px;
    /*border: 2px solid rgba(255, 255, 255, 0.4);*/
    /*box-shadow: 2px 2px 0px 0px rgba(0,0,0,0.3);*/
}

.logos .flags img.selected {
    opacity: 0.5;
}

img.elitloppet-logo {
    margin-top: 44px;
    width: 250px;
}

nav {
    width: 100%;
    max-width: 500px;
    display: flex;

    justify-content: center;
    align-items: center;

    margin-bottom: 31px;
    padding-left: 22px;
    padding-right: 22px;

    margin-left: auto;
    margin-right: auto;
}

nav ul {
    width: 100%;
    list-style-type: none;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;

    margin: 0;
    padding: 0;
    padding: 3px;

    background-color: #032363;
    border-radius: 2px;
}

nav li {
    display: inline-block;
    width: 100%;
    height: 100%;
    align-items: center;
    line-height: 28px;

    margin-top: 0;

    font-family: Roboto;
    font-weight: 500;
    color: white;
    font-size: 14px;

    text-align: center;

    background-color: transparent;

    border-radius: 2px;
}

nav li.selected {
    /*margin-top: 5px;
    margin-bottom: 2px;*/
    color: #2a3e50;
    background-color: white;
    box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.1);
}

#selectors {
    margin: 0 auto;
    margin-top: 30px;
    margin-bottom: 30px;
    display: flex;
    flex: 1;
    width: 100%;

    flex-direction: column;

    justify-content: center;
    align-items: center;
}

#selectors div.sel-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

select  {
    width: 200px;
    height: 34px;

    display: inline-block;
    outline: 0;
    overflow: hidden;

    background: white;
    color: #2a3e50;
    border: white;

    margin-left: 10px;
    padding-left: 2px;
    padding-right: 2px;

    text-align: center;

    -moz-border-radius: 0px;
    -webkit-border-radius: 0px;
    border-radius: 0px;
}

select option {
    /*border: 1px solid #000;
    background: #010;*/
}

#measureInputs {
    height: 40px;
    margin: 0 auto;
    margin-bottom: 50px;
}

label {
    color: #2a3e50;
    margin-bottom: 5px;
    margin-right: 15px;
}

label > span {
    display: inline-block;
    width: 40px;
    text-align: right;
}

input {
    height: 35px;
    width: 100px;
    margin-bottom: 5px;
    margin-left: 5px;

    background-color: white;
    color: #2a3e50;
    border: none;
    border-bottom: 1px solid white;
    text-align: right;

    font-size: 16px;

    padding-left: 10px;
}

.calculate {
    box-sizing: border-box;
    height: 35px;
    width: 75px;

    margin-left: 15px;

    border: 0;
    background-color: white;
    color: #EC068D;

    margin-top: 0px;
    margin-bottom: 5px;

    /*box-shadow: 7px 7px 0px 0px rgba(0,0,0,0.3);*/

    outline: none;
}
.calculate:active {
    /*box-shadow: 2px 2px 0px 0px rgba(0,0,0,0.3);*/
    background-color: #cecece;
}

.output {
    max-width: 600px;
    min-height: 500px;

    display: flex;
    flex-direction: column;

    margin-left: auto;
    margin-right: auto;

    margin-bottom: 50px;

    color: white;
}

.output span.toplistHeader {
    font-family: ATGRubrik;
    width: 100%;
    text-align: left;

    margin-top: 50px !important;
    margin-bottom: 30px;

    padding-left: 12px;

    font-size: 18px;
    color: #2a3e50;
    text-transform: uppercase;
}
.output span.toplistHeader:first-child {
    margin-top: 10px;
}

ul.res {
    width: 100%;
    background-color: white;
    color: #2a3e50;
    margin: 0 auto;
    padding: 0;

    font-family: Roboto;
    font-size: 14px;

    list-style-type: none;
}

ul.res li {
    width: 100%;

    display: flex;
    flex-wrap: wrap;

    min-height: 112px;
    max-height: 112px;

    margin: 0;
    padding: 0;
    padding-top: 12px;
    padding-left: 12px;
    padding-right: 12px;

    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

ul.res li.with-chart {
    min-height: 200px;
    max-height: 200px;
    padding-bottom: 12px;
}

ul.res li.header {
    min-height: 40px;
    max-height: 40px;
    background-color: white;
    color: #556473;
    text-transform: uppercase;
    font-size: 11px;

    align-content: flex-end;
    padding-bottom: 6px;

    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

ul.res li:last-child {
    /*border-bottom: 1px solid rgba(256, 256, 256, 0.2);*/
}

ul.res li div {
    display: flex;
}

ul.res li div.row {
    flex-direction: row;
}

ul.res li div.full-width {
    width: 100%;
}

ul.res li.header {
}

ul.res li.header div {
    font-family: Roboto;
    font-weight: 500;
    border: none;
}

ul li div.startNumber {
    font-family: Roboto;
    font-weight: 700;
    min-width: 22px;
    max-width: 22px;

    padding-left: 7px;
    margin-left: 10px;
    margin-right: 12px;
}

ul li div.startName {
    min-width: 180px;
    max-width: 180px;
    font-weight: 700;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
ul li div.startName .horse {
    margin-bottom: -1px;
}
ul li div.startName .driver {
    color: #556473;
}

ul li div.stat {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
}


ul li div.startName span.horse {
    text-transform: uppercase;
}
ul li div.startName span.driver {
    font-weight: 400;
}

ul li div.scratched {
    text-decoration: line-through;
}

ul li div.data-header {
    color: #7f8b96;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 10px;
    flex-wrap: nowrap;
}

ul li div.data-point {
    min-width: 110px;
    max-width: 110px;
}

ul li div.short {
    min-width: 40px;
    max-width: 40px;
}

ul div.place {
    margin-left: auto;
    justify-content: flex-end;
    min-width: 50px;
    max-width: 50px;
}

ul li div.text {
    min-width: 210px;
    max-width: 210px;

    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 20px;
}



.inaccuracies {
    font-size: 0.9em;
    margin: 80px auto;
    max-width: 500px;
    text-align: center;
}

ol {
    list-style: none;
    text-align: left;
}


/* CSS Loading spinner */

.lds-ellipsis {
  display: inline-block;
  position: relative;
  width: 64px;
  height: 64px;
}
.lds-ellipsis div {
  position: absolute;
  top: 27px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #aaa;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
  left: 6px;
  animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
  left: 6px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
  left: 26px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
  left: 45px;
  animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}
@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(19px, 0);
  }
}





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

/* Prevent callout */

.noselect {
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
}


.nocallout {
    -webkit-touch-callout: none;
}

.pressed {
    background-color: rgba(0, 0, 0, 0.7);
}

/* A hack for HTML5 contenteditable attribute on mobile */

textarea[contenteditable] {
    -webkit-appearance: none;
}

/* A workaround for S60 3.x and 5.0 devices which do not animated gif images if
   they have been set as display: none */

.gifhidden {
    position: absolute;
    left: -100%;
}

/*
 * Image replacement
 */

.ir {
    background-color: transparent;
    background-repeat: no-repeat;
    border: 0;
    direction: ltr;
    display: block;
    overflow: hidden;
    text-align: left;
    text-indent: -999em;
}

.ir br {
    display: none;
}

/*
 * 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 helper
 * Used to contain floats: h5bp.com/q
 */

.clearfix:before,
.clearfix:after {
    content: "";
    display: table;
}

.clearfix:after {
    clear: both;
}

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

@media only screen and (min-width: 800px) {
    /* Style adjustments for viewports that meet the condition */
    nav li {
        width: 150px;
    }
}

@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
       only screen and (min-resolution: 144dpi) {
    /* Style adjustments for viewports that meet the condition */
}

.startlineLabel {
    cursor: pointer;
    margin: 0;
    font-style: italic;
}

#startline {
    width: 15px;
    height: 15px;
    cursor: pointer;
    margin: 0;
    margin-bottom: 20px;
    margin-left: 5px;
    position: relative;
    top: 3px;
}