.dmt-no-touch {

    .dmt-speedtest {
        .dmt-chart-wrapper {
            .dmt-chart-settings {
                .dmt-chart-time {
                    .dmt-chart-zoom {
                        span {
                            &:hover {
                                border: 1px solid $light-blue;
                                cursor: pointer;
                            }
                        }
                    }
                }
            }
        }
    }

}

body {
    &.aside-open {
        .menu-content {
            .dmt-content-wrapper {
                @include flexbox-align(column, center, center, center);

                &.dmt-netroute {
                    .dmt-animation-wrapper {
                        height: 335px;
                    }
                }
            }
        }
    }

    &:not(.aside-open) {
        .menu-content {
            .dmt-content-wrapper {
                &.dmt-netroute {
                    .scroll {
                        max-width: 280px;
                    }

                    .dmt-animation-wrapper {
                        height: 277px;

                        .dmt-netroute-results {
                            &.dmt-netroute-results-internal {
                                top: 19px;
                            }

                            &.dmt-netroute-results-isp {
                                top: 102px;
                            }

                            &.dmt-netroute-results-destination {
                                top: 194px;
                            }
                        }
                    }

                    .dmt-netroute-config {
                        max-width: 260px;

                        .dmt-field-wrapper {
                            margin-bottom: 0;
                        }
                    }
                }
            }
        }
    }
}

.dmt-content-wrapper {

    &.dmt-netroute {
        .scroll {
            max-width: 340px;
        }
    }

    &.dmt-speedtest {
        .scroll {
            max-width: 1024px;
            @media screen and (max-width: 769px) {
                max-width: 100%;
            }
        }
    }
}

.dmt-netroute {
    .dmt-animation-wrapper {
        position: relative;
        overflow: hidden;

        img {
            width: 100%;
        }
        /*
        .dmt-image {
            min-width: 280px;
            width: 100%;
            height: 100%;
            background-repeat: no-repeat;
            background-size: contain;
            background-position: center;

            &.dmt-image-static {
                background-image: url('#{$domotz-widgets-path}/images/mtr-test-static.gif');
            }

            &.dmt-image-loading {
                background-image: url('#{$domotz-widgets-path}/images/mtr-test-animation.gif');
            }

            &.dmt-image-results {
                background-image: url('#{$domotz-widgets-path}/images/mtr-test-results.gif');
            }
        }
        */

        .dmt-netroute-results {
            position: absolute;
            width: 140px;
            margin: 0 auto;
            text-align: center;
            line-height: 30px;
            left: 0;
            right: 0;

            &.dmt-netroute-results-internal {
                top: 31px;
            }

            &.dmt-netroute-results-isp {
                top: 132px;
            }

            &.dmt-netroute-results-destination {
                top: 242px;
            }

            .dmt-netroute-labels {
                font-size: 14px;
                color: $medium-gray;
            }

            .dmt-netroute-values {
                font-size: 16px;
                color: $dark-gray;
            }
        }
    }

    .dmt-netroute-config {
        width: 100%;
        margin: 0 auto;
        font-size: 15px;
        color: $dark-gray;

        &.dmt-disabled {
            opacity: 0.3;
        }

        .dmt-label {
            padding-top: 16px;
        }

        .dmt-input {
            padding-bottom: 10px;

            input {
                color: $light-blue;
                border-bottom: 1px solid $dark-gray;
                width: 100%;
                padding: 0 6px;
                font-size: 16px;
            }
        }

        .dmt-options-group {
            padding: 10px 0 20px;
        }
    }

    .dmt-notice {
        color: $light-blue;
        margin-top: 6px;
        text-align: center;
        font-size: 13px;
    }

    .dmt-netroute-resume {
        text-align: center;
        padding: 20px 0 0;
        line-height: 30px;

        .dmt-netroute-raw {
            text-align: left;
            font-size: 14px;
            color: $medium-gray;
            padding-top: 20px;
            line-height: 20px;

            pre {
                white-space: pre;
                display: inline-block;
                font-family: Courier, monospace;
            }
        }
    }
}

.dmt-netspeed {
    h3 {
        /*
        margin-bottom: 6px;
        */
    }

    .dmt-netspeed-location {
        color: $dark-blue;
        margin-bottom: 24px;

        .dmt-right {
            height: 30px;

            .dmt-spinner {
                svg {
                    height: 30px !important;
                }
            }
        }

        .dmt-netspeed-source {
            color: $dark-gray;
            font-size: 16px;
        }

        .dmt-netspeed-server {
            color: $dark-gray;
            font-size: 16px;
            clear: none;
        }

        .dmt-netspeed-server-spinner {
            margin-left: 12px;
        }

        .dmt-error {
            color: $offline;
        }
    }

    .dmt-row-data {
        .dmt-left {
            &.dmt-netspeed-label {
                line-height: 33px;
                padding-right: 10px;
            }
        }

        .dmt-right {
            font-size: 15px;

            &.dmt-netspeed-value {
                color: $dark-gray;
                font-size: 16px;
            }

            &.dmt-netspeed-gif {
                height: 33px;

                /*
                .dmt-image {
                    width: 150px;
                    height: 100%;
                    background-repeat: no-repeat;
                    background-size: contain;
                    background-position: center;

                    &.dmt-image-empty {
                        background-image: url('#{$domotz-widgets-path}/images/speed-test-starter.gif');
                    }

                    &.dmt-image-ping-animation {
                        background-image: url('#{$domotz-widgets-path}/images/ping-animation.gif');
                    }

                    &.dmt-image-download-animation {
                        background-image: url('#{$domotz-widgets-path}/images/download-animation.gif');
                    }

                    &.dmt-image-upload-animation {
                        background-image: url('#{$domotz-widgets-path}/images/upload-animation.gif');
                    }
                }
                */

                img {
                    width: 150px;
                }
            }
        }
    }
}

/* NEW SPEED TEST UI */
.platform-ipad {
    .ionic_datepicker_popup {
        .popup-buttons {
            min-height: 60px;
        }
    }
}

.dmt-speedtest {

    min-width: 1024px;

    @media screen and (max-width: 769px) {
        min-width: 100%;
    }

    .dmt-spinner-wrapper {
        position: absolute;
        width: 100%;
        height: 400px;
        z-index: 10;
        background-color: rgba(255, 255, 255, 0.7);
    }

    .dmt-clear {
        clear: both;
        width: 100%;
        height: 1px;
    }

    .dmt-chart-wrapper {
        width: 100%;
        min-height: 300px;
        margin-bottom: 40px;

        &.dmt-no-past-chart {
            min-height: 0;

            .dmt-chart-settings {
                display: none;
            }

            .dmt-chart {
                min-height: 150px;
                @include flexbox-align(column, center, center, center);

                .dmt-chart-empty-text {
                    top: 0;
                }

                .dmt-content-spinner {
                    height: 100%;
                    top: -20px;
                }
            }
        }

        .dmt-chart-settings {
            width: 100%;
            margin-bottom: 15px;
            @include flexbox-align(row, center, center, flex-start);

            h4 {
                color: $dark-gray;
                font-size: 14px;
                margin: 0 0 10px;
            }

            .dmt-chart-filters {
                @include flex-shrink(1);
                @include flex-grow(0.9);
                @include flex-basis(0);
                @include flex-order(1);

                text-align: left;
                height: 60px;

                > span {
                    display: inline-block;
                    margin-right: 10px;

                    .dmt-chart-filter-icon {
                        width: 25px;
                        top: 0;
                        vertical-align: top;
                        display: inline-block;
                        margin-right: 10px;

                        .icon-radio-chart {
                            left: 2px;
                            font-size: 30px;
                        }
                    }

                    &.dmt-filter-off {
                        .icon-thick-circle {
                            display: none;
                        }
                    }

                    &.dmt-filter-download {
                        color: $light-blue;

                        .dmt-chart-filter-icon {
                            span {
                                color: $light-blue;
                            }
                        }
                    }

                    &.dmt-filter-upload {
                        color: $dark-gray;
                        .dmt-chart-filter-icon {
                            span {
                                color: $dark-gray;
                            }
                        }
                    }
                }
            }

            .dmt-chart-time {
                @include flexbox-align(row, center, center, flex-start);
                @include flex-shrink(1);
                @include flex-grow(1.1);
                @include flex-basis(0);
                @include flex-order(2);

                text-align: left;
                height: 60px;

                @media screen and (max-width: 769px) {
                    display: none;
                }

                .dmt-chart-time-frame {
                    @include flex-shrink(1);
                    @include flex-grow(1.2);
                    @include flex-basis(0);
                    @include flex-order(1);
                    height: 100%;

                    color: $dark-gray;

                    > span {
                        position: relative;
                        top: -8px;
                    }

                    button {
                        @include border-radius(3px);
                        position: relative;
                        height: 30px;
                        border: 1px solid $dark-gray;
                        text-align: left;
                        line-height: 28px;
                        display: inline-block;
                        cursor: pointer;
                        margin: 0 5px;
                        width: 120px;
                        text-decoration: none;

                        span {
                            position: relative;
                            font-size: 12px;
                            text-transform: none;
                            left: 10px;
                            color: $dark-gray;
                            display: inline-block;
                            overflow: hidden;
                            text-overflow: ellipsis;
                            width: 100%;
                            white-space: nowrap;
                            padding-right: 45px;
                        }

                        i {
                            position: absolute;
                            top: 0;
                            right: 10px;
                            color: $dark-gray;
                            font-size: 20px;

                            &.icon-sort {
                                width: 15px;
                            }
                        }
                    }
                }

                .dmt-chart-zoom {
                    @include flex-shrink(1);
                    @include flex-grow(0.8);
                    @include flex-basis(0);
                    @include flex-order(2);
                    height: 100%;

                    span {
                        position: relative;
                        left: -7px;
                        color: $dark-gray;
                        display: inline-block;
                        text-align: center;
                        height: 30px;
                        line-height: 30px;
                        width: 30px;
                        @include border-radius(7px);
                        border: 1px solid #fff;
                        margin-right: 5px;

                        &:last-child {
                            margin-right: 0;
                        }

                        &.dmt-current {
                            background: $light-blue;
                            border: 1px solid $light-blue;
                            color: #fff;
                        }
                    }
                }

            }
        }

        .dmt-chart {
            position: relative;
            width: 100%;
            min-height: 400px;

            .dmt-chart-empty-text {
                display: block;
                text-align: center;
                position: relative;
                font-size: 30px;
                top: 150px;
                color: $dark-gray;

                > span {
                    line-height: 34px;
                }

                .icon-curved-arrow {
                    position: absolute;
                    left: 120px;
                    top: -65px;
                    font-size: 160px;
                    color: $light-blue;

                    -moz-transform: scaleX(-1);
                    -o-transform: scaleX(-1);
                    -webkit-transform: scaleX(-1);
                    transform: scaleX(-1);
                    filter: FlipH;
                    -ms-filter: "FlipH";

                    @media screen and (max-width: 1023px) {
                        display: none;
                    }
                }
            }
        }
    }

    .dmt-speedtest-info-wrapper {
        @include flexbox-align(row, center, center, flex-start);

        @media screen and (max-width: 769px) {
            @include flexbox-align(column, center, center, flex-start);
        }

        h3 {
            display: block !important;
            color: $dark-gray;
            font-size: 20px;
            text-transform: uppercase;
            @include helvetica-neue-bold();
            margin-bottom: 20px;
            span {
                text-transform: none;
                @include helvetica-neue-regular();
            }
        }

        .dmt-speedtest-average {
            @include flex-shrink(1);
            @include flex-grow(1);
            @include flex-basis(0);
            @include flex-order(1);
            color: $dark-gray;

            h3 {
                text-align: center;
                width: 100%;

                span {
                    display: block;
                }
            }

            @media screen and (max-width: 769px) {
                @include flex-order(2);
                margin: 10px auto 0;
                width: 40%;
                text-align: center;

                .dmt-row {
                    &.dmt-desktop {
                        display: none;
                    }
                }
            }

            @media screen and (max-width: 414px) {
                width: 80%;
            }

            .dmt-speedtest-average-mobile {
                display: none;
                @media screen and (max-width: 769px) {
                    @include flexbox-align(row, center, center, flex-start);
                }

                .dmt-row {
                    @include flex-shrink(1);
                    @include flex-grow(1);
                    @include flex-basis(0);

                    .dmt-value {
                        font-size: 30px;
                        text-align: center;
                        width: 100%;
                    }
                }
            }

            .dmt-row {
                width: 100%;
                line-height: 30px;

                > span {
                    display: inline-block;
                }

                .dmt-label {
                    text-align: right;
                    width: 100px;
                }
                .dmt-value {
                    @include helvetica-neue-bold();
                    font-size: 25px;
                    text-align: left;
                    padding-left: 10px;
                    min-width: 70px;
                }
                .dmt-unit {
                    text-align: left;
                }
            }
        }
        .dmt-speedtest-last {
            @include flex-shrink(1);
            @include flex-grow(2);
            @include flex-basis(0);
            @include flex-order(2);

            min-height: 235px;

            @media screen and (max-width: 769px) {
                @include flex-order(1);
                margin: 0 auto;
            }
            @media screen and (max-width: 375px) {
                width: 100%;
            }

            h3 {
                text-align: center;
                position: relative;

                b {
                    display: block;
                }

                .dmt-speed-server-spinner {
                    position: absolute;
                    top: -2px;
                    left: 338px;

                    @media screen and (max-width: 375px) {
                        left: 260px;
                    }
                }

                @media screen and (max-width: 375px) {
                    width: 100%;

                    b {
                        display: block;
                    }
                }
            }

            .dmt-container {
                padding: 0 10px;

                @media screen and (max-width: 375px) {
                    padding: 0;
                }

                .dmt-last-values-box {
                    @include flexbox-align(row, center, center, flex-start);
                    text-align: center;
                    color: $dark-gray;
                    width: 80%;
                    margin: 0 auto;

                    @media screen and (max-width: 769px) {
                        width: 350px;
                        max-width: 100%;
                    }

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

                    span {
                        display: block;
                        margin-bottom: 15px;
                    }

                    .dmt-last-download {
                        @include flex-shrink(1);
                        @include flex-grow(1);
                        @include flex-basis(0);
                        @include flex-order(1);

                        span {
                            &.dmt-value {
                                @include helvetica-neue-bold();
                                color: $light-blue;
                                font-size: 45px;
                                line-height: 31px;

                                @media screen and (max-width: 375px) {
                                    font-size: 40px;
                                }

                                span {
                                    position: relative;
                                    display: inline-block;
                                    margin-bottom: 0;

                                    i {
                                        position: absolute;
                                        left: -20px;
                                        top: -4px;
                                        font-size: 20px;
                                    }
                                }
                            }
                        }
                    }
                    .dmt-last-ping {
                        @include flexbox-align(row, center, center, flex-start);
                        @include flex-shrink(1);
                        @include flex-grow(1);
                        @include flex-basis(0);
                        @include flex-order(2);

                        span {
                            margin-bottom: 5px;
                            &.dmt-value {
                                font-size: 20px;
                            }
                        }

                        .dmt-last-ping-min {
                            @include flex-grow(1);
                        }
                        .dmt-last-ping-avg {
                            @include flex-grow(1);
                            span {
                                &.dmt-value {
                                    @include helvetica-neue-bold();
                                    font-size: 24px;
                                }
                            }
                        }
                        .dmt-last-ping-max {
                            @include flex-grow(1);
                        }
                    }
                    .dmt-last-upload {
                        @include flex-shrink(1);
                        @include flex-grow(1);
                        @include flex-basis(0);
                        @include flex-order(3);

                        span {
                            &.dmt-value {
                                @include helvetica-neue-bold();
                                font-size: 45px;
                                line-height: 31px;

                                @media screen and (max-width: 375px) {
                                    font-size: 40px;
                                }

                                span {
                                    position: relative;
                                    display: inline-block;
                                    margin-bottom: 0;

                                    i {
                                        position: absolute;
                                        right: -20px;
                                        top: 10px;
                                        font-size: 20px;
                                    }
                                }
                            }
                        }
                    }

                    .dmt-label {
                        &.dmt-animation-play {
                            color: $light-blue;
                        }

                        &.dmt-animation-complete {
                            color: $online;
                        }
                    }

                    .dmt-animation {
                        width: 150px;
                        height: 36px;
                        position: relative;
                        @include dark-gray-rgba(0.2);
                        @include border-radius(15px);
                        border: 2px solid $dark-gray;
                        padding: 3px;
                        overflow: hidden;
                        margin: 0 auto 10px;

                        @media screen and (max-width: 375px) {
                            width: 120px;
                        }

                        .dmt-animation-border {
                            @include border-radius(13px);
                            position: absolute;
                            top: 0;
                            left: 0;
                            z-index: 9;
                            width: 146px;
                            height: 32px;

                            @media screen and (max-width: 375px) {
                                width: 116px;
                            }
                        }

                        &.dmt-animation-active {
                            background: #DDF0FF;
                            border: 2px solid $light-blue;

                            .dmt-animation-border {
                                border: 3px solid #DDF0FF;
                            }
                        }

                        &.dmt-animation-play {
                            background: #DDF0FF;
                            border: 2px solid $light-blue;

                            .dmt-animation-border {
                                border: 3px solid #DDF0FF;
                            }

                            .dmt-animated-block {
                                left: 0;
                                top: -2px;
                            }
                        }

                        &.dmt-animation-complete {
                            border: 0;
                            background: none;
                            .dmt-animated-block {
                                display: none;
                            }

                            .dmt-animation-border {
                                border: 0;
                            }

                            .dmt-animation-check {
                                display: block;
                            }
                        }

                        .dmt-animation-check {
                            display: none;
                            i {
                                top: 6px;
                                color: $online;
                                font-size: 35px;
                                position: relative;
                            }
                        }

                        .dmt-animated-block {
                            @include light-blue-rgba(0.8);
                            @include border-radius(15px);
                            position: absolute;
                            width: 150px;
                            height: 36px;
                            left: -150px;
                            top: 0;
                            overflow: hidden;
                            -webkit-transition: left 12s linear;
                            -moz-transition: left 12s linear;
                            -o-transition: left 12s linear;
                            transition: left 12s linear;

                            @media screen and (max-width: 375px) {
                                width: 120px;
                                left: -120px;
                            }
                        }

                    }

                }
            }
        }
        .dmt-speedtest-settings {
            @include flex-shrink(1);
            @include flex-grow(1);
            @include flex-basis(0);
            @include flex-order(3);
        }
    }
}

.dmt-netHistory {

    .dmt-rows {

        padding: 10px 0;

        &.dmt-connection-history-up {
            color: $online;
        }

        &.dmt-connection-history-down {
            color: $offline;
        }

        .dmt-log-icon {
            float: left;
            width: 30px;
            font-size: 20px;
            line-height: 40px;
        }

        .dmt-connection-history-col-time {
            padding-left: 30px;
            padding-right: 60px;
        }

        .dmt-connection-history-col-status {
            float: right;
            text-align: right;
        }
    }

    .dmt-connection-history-no-events {
        color: $online;
        text-align: center;
        font-size: 16px;
    }
}
