/*
 * Wind-it stylesheet
 * ------------------
 *
 * Sumary:
 *
 *  1. Global
 *  2. Header
 *  3. Data presentation
 *  4. Remote actions
 *  5. Map
 *  6. Decorations
 *  7. Media queries
 *
 *
 * Main colors:
 *
 *  - yellow:       #FFDD00
 *  - dark grey:    #7F7F7F
 *  - middle grey:  #EDEDED
 *  - light grey:   #F7F7F7
 *  - dark green:   #B5E655
 *  - light green:  #CEED93
 *  - white:        #FFFFFF
 *  - black:        #000000
 */



/*
 * 1. Global
 */

* {
    box-sizing: border-box;
}

html, body {
    font-size: 15px;
    margin: 0px;
}

body,
svg text {
    font-family: raleway, Arial, sans-serif;
    color: #7F7F7F;
    fill: #7F7F7F;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #F7F7F7;
    padding-bottom: 25px;
}

section {
    background-color: #FFFFFF;
    margin-top: 25px;
    margin-bottom: 25px;
    padding: 15px;
    width: 45%;
}

section *:first-child {
    margin-top: 0;
}

section.graph {
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: normal;
    color: #000000;
    text-transform: uppercase;
}

a {
    font-weight: bold;
    color: #7F7F7F;
    text-decoration: dashed;
}

a:hover {
    color: #DCBF00;
    text-decoration: underline;
}

#content {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-left: -25px;
}

#content > * {
    flex-grow: 1;
    min-width: 500px;
    margin-left: 25px;
}

.container {
    width: 1200px;
    margin: auto;
    padding-left: 25px;
    padding-right: 25px;
}

.yellow {
    color: #DCBF00;
}

.errorlist {
    /* Used by django.contrib.auth forms */
    color: #ef2929;
}

/*
 * 2. Header
 */

header {
    width: 100%;
    background-color: #F7F7F7;
}

#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#header nav ul {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

#header nav ul li a {
    display: block;
    padding: 15px;
    color: #7F7F7F;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: normal;
}

#header nav ul li a:hover {
    color: #000000;
    background-color: #EDEDED;
}

header h1 {
    width: 100%;
    text-align: center;
    font-size: 1.6em;
    background-color: #FFDD00;
    margin: 0;
    padding: 25px;
}

/*
 * 3. Data presentation
 */

dt {
    margin-bottom: 10px;
}

dt::after {
    content: ':';
}

dd {
    margin-bottom: 20px;
}

table {
    margin: auto;
    border-collapse: collapse;
    min-width: 50%;
}

table tr:nth-child(odd) {
    background-color: #EEE;
}

table tr:nth-child(even) {
    background-color: #F9F9F9;
}

table thead tr:nth-child(n) {
    background-color: transparent;
}

table tr:hover {
    background-color: #DDD;
}

table td {
    padding: 10px 15px;
}

table th {
    padding: 15px;
    padding-top: 0px;
}

.data td:nth-child(2) {
    padding-right: 0;
    font-weight: bold;
    text-align: right;
}

.data td:nth-child(3) {
    text-align: left;
}

.click {
    cursor: pointer;
}

.center {
    text-align: center;
}

.circle {
    display: inline-block;
    height: 15px;
    width: 15px;
    background-color: #999;
    border-radius: 100%;
    margin-bottom: -3px;
}

.circle.green {
    background-color: #73d216;
}

.circle.border-green {
    background-color: rgba(115, 210, 22, 0.2);
    border: 2px solid #73d216;
}

.circle.orange {
    background-color: #fcaf3e;
}

.circle.red {
    background-color: #ef2929;
}

.green {
    color: #73d216;
}

.orange {
    color: #fcaf3e;
}

.red {
    color: #ef2929;
}

.left-padding {
    padding-left: 15px;
}

#energy_synoptic {
    display: flex;
    justify-content: space-between;
}

.arc {
    fill: none;
    stroke: #eee;
    stroke-width: 4px;
}

.today {
    font-weight: bold;
}

.yesterday {
    fill: #AFAFAF;
}

.right-anchor {
    text-align: end;
    text-anchor: end;
}

#gsm_level line {
    stroke-width: 4px;
    stroke: #eee;
}

#gsm_level .active {
    stroke: #fd0;
}

#metrics-form,
#export-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#metrics-form input[type="checkbox"] {
    display: none;
}

#metrics-form input[type="checkbox"] + label {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin: 0.2rem;
    background-color: #F7F7F7;
}

#metrics-form input[type="checkbox"]:checked + label {
    background-color: #CEED93;
}

#plot {
    display: none;
    height: 600px;
    max-height: 100vh;
    padding: 1.5rem;
    background-color: white;
}

#plot .spinner,
#plot p {
    margin: auto;
}

.spinner {
  width: 80px;
  height: 80px;
  background-color: #FFDD00;
}

.spinner.animate {
  animation: sk-rotateplane 2.2s infinite ease-in-out;
}

@keyframes sk-rotateplane {
  0% { transform: perspective(120px) }
  50% { transform: perspective(120px) rotateY(180deg) }
  100% { transform: perspective(120px) rotateY(180deg)  rotateX(180deg) }
}

/*
 * 4. Remote actions
 */

#remote_actions td:last-child {
    text-align: center;
}

#remote_actions .running,
#remote_actions .action_transmitted,
#remote_actions .transmission_error {
    cursor: default;
}

#remote_actions .action_transmitted,
#remote_actions .action_transmitted:hover {
    background-color: #CEED93;
}

#remote_actions .transmission_error,
#remote_actions .transmission_error:hover {
    background-color: #ED9393;
}

.running .status {
    display: inline-block;
    vertical-align: middle;
    width: 1em;
    height: 1em;
    border-radius: 0.5em;
    background-color: #7F7F7F;

    -webkit-animation: bounce 1.0s infinite ease-in-out;
    animation: bounce 1.0s infinite ease-in-out;
}

@-webkit-keyframes bounce {
    0%, 100% { -webkit-transform: scale(0.0) }
    50% { -webkit-transform: scale(1.0) }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(0.0);
        -webkit-transform: scale(0.0);
    } 50% {
        transform: scale(1.0);
        -webkit-transform: scale(1.0);
    }
}

/*
 * 5. Map
 */

#mapid {
    height: 50vh;
}

.leaflet-control-attribution {
    opacity: 0.7;
}

.leaflet-container .leaflet-control-attribution a {
    color: black;
}

/*
 * 6. Decorations
 */

.corner-bottom-right,
.corner-bottom-left,
.corner-top-left {
    position: relative;
}

.corner-bottom-right::after,
.corner-bottom-left::after,
.corner-top-left::before {
    content: '';
    position: absolute;
    opacity: 0.6;
    width: 70px;
    height: 70px;
}

.corner-bottom-right::after {
    border-bottom: 10px solid #FFDD00;
    border-right: 10px solid #FFDD00;
    bottom: -10px;
    right: -10px;
}

.corner-bottom-left::after {
    border-bottom: 10px solid #FFDD00;
    border-left: 10px solid #FFDD00;
    bottom: -10px;
    left: -10px;
}

.corner-top-left::before {
    border-top: 10px solid #FFDD00;
    border-left: 10px solid #FFDD00;
    top: -10px;
    left: -10px;
}

/*
 * 7. Media queries
 */

@media screen and (max-width: 1200px) {
    .container {
        width: 100%;
    }
}

@media screen and (max-width: 800px) {
    #header {
        flex-direction: column;
        justify-content: center;
    }

    #logo {
        padding: 10px 0;
    }
}


@media screen and (max-width: 550px) {
    #content > * {
        min-width: unset;
    }

    .container {
        padding: 0px 10px;
    }

    #header nav ul {
        flex-direction: column;
    }

    #header nav ul li {
        text-align: center;
    }

    table tr {
        display: flex;
        flex-wrap: wrap;
    }

    table tr td {
        display: inline-block;
        width: 100%;
        text-align: center;
    }

    .data tr td {
        width: 50%;
    }

    .data tr td:first-child,
    .data tr td:last-child {
        width: 100%;
    }

    #energy_synoptic {
        flex-wrap: wrap;
        justify-content: center;
    }

    #energy_synoptic svg {
        margin-bottom: 20px;
    }

    #energy_synoptic svg:first-child {
        display: none;
    }

    #energy_synoptic svg:last-child {
        margin-bottom: 0px;
    }

    section {
        width: 100%;
    }
}
