@font-face {
    font-family: "Open Sans";
    src: url('../../fonts/open-sans/OpenSans-Regular.ttf');
}

$background: #f5efe8;
$bad: #dc4e25;
$average: #eabe2a;
$good: #42a547;

// Цвета для строки статуса в панели состояния
// см. .dashboard-status-line*
$item-name-color: #fff !default;
$default: #6c757d !default;
$success: $good !default;
$warning: $average !default;
$danger: $bad !default;

.square {
    display: inline-block;
    float: left;
    height: 220px;
    width: 220px;
    background-color: $background;
    position: relative;
    margin: 8px;
    border-radius: 3px;
}

@mixin Xcentered {
    position: absolute;
    left: 50%;
    margin-right: -50%;
    transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
}

@mixin centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
}

@mixin zone {
    @include centered;
    border-radius: 100%;
    width: 130px;
    height: 130px;
}

.ring {
    @include centered;
    height: 160px;
    width: 160px;
    border-radius: 100%;
    border: 2px solid $background;
    top: 45%;
}

.wireless-zone {
    @include zone;
    background-color: $background;
}

.wired-zone {
    @include zone;
    background-color: white;
    top: 45%;
}

.flash {
    @include Xcentered;
    background: $bad url("../../icons/flash.svg") no-repeat;
    background-size: 12px 18px;
    background-position: 12px 6px, center;
    border-radius: 4px;
    width: 34px;
    height: 34px;
}

.wireless-zone + .flash {
    top: -11px;
}

.wired-zone + .flash {
    top: 14px;
}

.warning {
    background-color: $bad;
    .zone-type, .zone-number {
        color: white;
    }
    .low-temperature {
        color: lightskyblue;
    }
    .high-temperature {
        color: white;
    }

}

.repeater {
    position: relative;
    float: right;
    right: 10px;
    top: 10px;
    background-color: $good;
    width: 2.4em;
    text-align: center;
    border-radius: 5px;
    color: white;
    font-family: "Open Sans";
    font-size: 15px;
    font-weight: bold;
}

.offline {
    @extend .repeater;
    background-color: $bad;
}

.under-text {
    @include Xcentered;
    bottom: 0;
    list-style-type: none;
    -webkit-padding-start: 0;
    -moz-padding-start: 0;
}

.under-text.multiline {
    text-align: center;
}

.under-text.multiline li {
    float: none;
}

@mixin under-text {
    font-family: "Open Sans";
    font-size: 15px;
    line-height: 20px;
    color: $bad;
}

.under-alarm {
    @include under-text;
    @include Xcentered;
    bottom: 22px;
}

.under-alarm-second-line {
    @extend .under-alarm;
    bottom: 6px;
}

.under-text li {
    @include under-text;
    float: left;
    padding-left: 3px;
    padding-right: 3px;
}

.under-alarm + .under-text {
    margin-bottom: 5px;
}

/* если under-alarm занимает две строки, для under-text не остаётся места */
.under-alarm-second-line + .under-text {
    display: none;
}

ul.rielta-wired-zone-fault {
    position: relative;
    top: 80%;
}

.rielta-wired-zone-fault.under-text {
    li {
        display: inline;
    }

    li:after {
        content: ",";
    }

    li:last-child:after {
        content: "";
    }
}

.bad {
    background-color: $bad;
}

.average {
    background-color: $average;
}

.good {
    background-color: $good;
}

@for $i from 1 through 14 {
    .sector-#{$i} {
        background-image:
            linear-gradient(90deg + 12 * $i, transparent 50%, white 50%),
            linear-gradient(90deg, white 50%, transparent 50%);
    }
}

.sector-15 {
    background-image:
        linear-gradient(90deg, white 50%, transparent 50%);
}

@for $i from 16 through 20 {
    .sector-#{$i} {
        background-image:
            linear-gradient(-270deg + (12 * ($i - 15)), transparent 50%, $average 50%),
            linear-gradient(90deg, white 50%, transparent 50%);
    }
}

@for $i from 21 through 29 {
    .sector-#{$i} {
        background-image:
            linear-gradient(-270deg + (12 * ($i - 15)), transparent 50%, $good 50%),
            linear-gradient(90deg, white 50%, transparent 50%);
    }
}

.sector-30 {
    background-image: none;
}

.zone-number {
    font-family: "Open Sans";
    font-size: 60px;
    text-align: center;
    position: relative;
    top: 10%;
}

.zone-number .dual {
    font-size: 44px;
}

.zone-type {
    text-align: center;
    font-family: "Open Sans";
    font-size: 15px;
    color: #727272;
    position: relative;
    top: 4%;
}

.temperature {
    @extend .zone-type;
    color: black;
}

.rielta-wired-zone {
    @extend .zone-type;
    line-height: 1;
    top: 0;

    .serial-number {
        font-size: 13px;
        line-height: 1.6;
    }
}

.no-link {
    background-color: $bad;
    background-image: none;
}

.details {
    padding: 20px 15px;
    .header {
        font-weight: bold;
    }
    .fault {
        color: $bad
    }
    .normal {
        color: $good
    }
    .low-temperature {
        color: blue;
    }

    .high-temperature {
        color: $bad;
    }
}

/* в случае большого количества текста в метке всё остаётся слева */
.checkbox label.control-label {
    text-align: left;
}

.dashboard-status-line {
    display: block;
    padding-bottom: 10px;
}

.dashboard-status-line-item {
    display: inline-block;
    padding-right: 10px;
}

.dashboard-status-line-item-name {
    display: inline-block;
    padding: .25em .5em;
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    color: $item-name-color;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
    text-transform: uppercase;
}

.state-unknown {
    background-color: $default;
}

.state-success {
    background-color: $success;
}

.state-warning {
    background-color: $warning;
}

.state-danger {
    background-color: $danger;
}

.dashboard-status-line-item-state {
    display: inline-block;
    vertical-align: baseline;
}

/* текст, выводимый вместо содержимого таба панели состояния */
.tab-replacement-text {
    margin-top: 30px;
    text-align: center;
    font-weight: bold;
  }
