@import "src/style/bootstrap_vars";
@import "src/style/vars_mixins";
@import "src/style/variables";
@import "src/style/mixins";

.loading-hive {
    width: 100%;
    height: 300px;
}

.active {
    z-index: 1;
}

tbody {
    @media (max-width: $sm-break) {
        font-size: 11px;
    }
}

thead, .pagination {
    @media (max-width: $sm-break) {
        font-size: 12px;
    }
}

.w-sm-75 {
    width: 100%;
    @media (min-width: $sm-break) {
        width: 75%;
    }
}

.mode-selector {
    max-width: 600px;

    &.equal-widths {
        .btn-primary {
            width: 33%;
        }
    }
}

.market-page {
    height: 100vh;
    overflow-y: auto;

    &.SWAP {
        position: relative;

        @include themify(day) {
            @apply bg-blue-duck-egg;
        }

        @include themify(night) {
            @apply bg-transparent;
        }

        .list-group {
            border-radius: 1rem;
        }

        .auth-required {
            position: absolute;
            top: 0;
            left: 1rem;
            width: calc(100% - 2rem);
            height: 100%;
            border-radius: 1rem;
            padding: 1rem;
            z-index: 9;

            @include themify(day) {
                background-color: rgba(255, 255, 255, 0.7);
            }

            @include themify(night) {
                background-color: rgba(19, 17, 17, 0.7);
            }
        }
    }

    &.ADVANCED {
        .advanced-mode {
            overflow-x: hidden;
            margin-top: -1.75rem;

            @include media-breakpoint-down(sm) {
                margin-top: -2rem;
            }
        }

        .advanced-mode-toolbar {
            align-items: center;
            position: relative;
            z-index: 9;

            @include media-breakpoint-down(md) {
                flex-wrap: wrap;
            }

            @include media-breakpoint-down(lg) {
                padding-top: 1rem;
                padding-bottom: 1rem;
            }

            @include media-breakpoint-down(xs) {
                padding-top: 0;
                padding-bottom: 0;
            }

            .trading-pair {
                font-size: 1rem;

                @include media-breakpoint-down(md) {
                    border-right: 0 !important;
                }
            }

            .amount {
                font-size: 1.25rem;
                font-weight: 500;
            }

            .usd-value {
                font-size: 0.875rem;
                font-weight: 500;
            }

            .change-price {
                label {
                    font-size: 0.75rem;
                    font-weight: 500;
                    opacity: 0.75;
                    color: $secondary;
                    margin-bottom: 0.32rem;
                }

                div {
                    font-size: 0.875rem;
                    font-weight: 500;
                }
            }

            .pair-info {
                display: flex;
                gap: 1rem;

                @include media-breakpoint-down(sm) {
                    border-left: 0 !important;
                    padding-left: 0 !important;
                    padding-right: 0 !important;
                    gap: 0.5rem;

                    .change-price label, & {
                        font-size: 0.75rem;
                    }
                }

                @include media-breakpoint-down(xs) {
                    flex-wrap: wrap;
                    padding-bottom: 1rem;
                }
            }
        }

        .history-widget-content {
            padding-top: 0.5rem;
            padding-left: 0.69rem;

            .history-widget-row {
                cursor: pointer;
                padding: 0.15rem 0;
                display: grid;
                gap: 1rem;
                font-size: 0.75rem;
                font-weight: 500;
                grid-template-columns: 1fr 1fr 1fr;

                &.selectable:hover {
                    opacity: 0.5;
                }

                &.history-widget-header {
                    padding: 0.5rem 0;
                    font-weight: 400;
                    font-size: 0.75rem;
                }
            }
        }

        .market-stake-widget {
            display: flex;
            flex-direction: column;
            justify-content: center;
            height: calc(100% - 39px - 55px);

            &.one-type {
                justify-content: flex-start;

                .market-stake-widget-sell, .market-stake-widget-buy {
                    &::-webkit-scrollbar {
                        display: none;
                    }
                }
            }

            @include media-breakpoint-down(md) {
                height: auto;

                .history-widget-row {
                    grid-template-columns: 1fr 1fr;
                }
            }
        }

        .market-stake-widget-sell, .market-stake-widget-buy {
            overflow-y: auto;

            .history-widget-row {
                position: relative;

                .history-widget-row-progress {
                    position: absolute;
                    width: 100%;
                    opacity: 0.15;
                    height: 19.2px;
                }

                &.sell .history-widget-row-progress {
                    right: 0;
                    background-color: $danger;
                }

                &.buy .history-widget-row-progress {
                    right: 0;
                    background-color: $success;
                }

                &.selectable:hover {
                    opacity: 1;
                }

                &.selectable > .price:hover, &.selectable > .amount:hover {
                    opacity: .5;
                }

                .price, .amount {
                    position: relative;
                }
            }
        }

        .stake-widget-header-options {
            display: flex;
            justify-content: space-between;
            width: 100%;
            padding-left: 12px;
            gap: 0.25rem;

            .stake-widget-header-view-type {
                display: flex;
            }

            .btn {
                padding: 0 4px;
                opacity: .5;

                &.active {
                    opacity: 1;
                }
            }

            select {
                width: auto;
            }
        }

        .market-advanced-mode-widget {
            @apply bg-white;
            height: 100%;
            margin: -1px;

            @include themify(night) {

                @apply bg-dark-200;
            }

            .custom-dropdown .label {
                font-size: 14px;
            }
        }

        .market-advanced-mode-widget-settings {
            @apply bg-light-300;

            @include themify(night) {
                @apply bg-dark-default;
            }
        }

        .market-advanced-mode-trading-form-widget {
            @include media-breakpoint-down(md) {
                flex-direction: column;
            }

            @include media-breakpoint-down(md) {
                flex-direction: row;
            }

            @include media-breakpoint-down(sm) {
                flex-direction: column;
            }
        }

        .market-advanced-mode-trading-form-login-required-widget {
            height: 334px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .market-advanced-mode-tv-widget {
            .market-advanced-mode-trading-view-widget {
                height: calc(100% - 44px);
            }

            &.expanded-header {
                .market-advanced-mode-trading-view-widget {
                    height: calc(100% - 104px);
                }
            }
        }

        .widget-layout-builder {
            .market-advanced-mode-history-widget {
                @include media-breakpoint-down(md) {
                    .history-widget-content {
                        margin-bottom: 40px;
                    }
                }

                .history-widget-content {
                    height: calc(100% - 31px - 45px);
                    min-height: 400px;
                }
            }
        }

        .market-advanced-mode-oo-widget {
            font-size: 0.875rem;
        }

        .market-advanced-mode-oo-content {
            height: calc(100% - 44px);
            overflow-y: auto;
            overflow-x: hidden;
        }

        .market-advanced-mode-oo-widget-tabs {
            display: flex;
            gap: 1rem;

            .market-advanced-mode-oo-widget-tab {
                margin: -0.75rem 0;
                padding: 0 0.5rem;
                border-bottom: 2px solid transparent;
                display: flex;
                align-items: center;
                height: 43px;
                font-size: 0.875rem;

                &.active {
                    font-weight: 500;
                    color: $primary;
                    border-bottom-color: $primary;
                }
            }
        }

        .market-stake-widget-current-price {
            font-weight: 500;
            display: flex;
            align-items: center;
            padding-left: 0.5rem;

            .price {
                font-size: 1.25rem;
            }

            .usd-price {
                margin-left: 1rem;
                font-size: 0.75rem;
                opacity: .75;
            }
        }
    }

    @keyframes containerAnimation {
        0% {
            opacity: 0;
        }

        100% {
            opacity: 1;
        }
    }

    .navbar {
        margin-left: -4px;
        height: 100%;
        min-height: 100vh;
      @apply bg-gradient-primary-day;
        display: flex;

        @include themify(night) {
          @apply bg-gradient-primary-night;
        }

        path {
          @apply fill-white;
        }
    }

    .decks-container {
        @apply bg-blue-duck-egg;
        overflow-x: auto;
        max-width: 100vw;
        height: calc(100vh - 3rem);

        @include themify(night) {
            background-color: #232e3b;
        }
    }

    .cursor-pointer {
        cursor: pointer;
    }

    .my-icons-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .menu-icon path {
        @apply fill-white;
    }

    .deck-view {
        .viewLayouts {
            display: block;
        }
        .view-feed {
            .view-layout {
                margin-left: 0.7rem;

                @media (max-width: $sm-break) {
                    margin-left: 0.7rem;
                }
            }
            .menu-down-icon {
              width: 15px !important;
              height: 15px;
              display: flex;
              align-items: center;
              justify-content: center;
              position: relative;
              left: -10px;
              bottom: -10px;
              border-radius: 50%;
              border: 1px solid;
              @apply border-blue-dark-sky;
              @apply bg-white;
              path {
                @apply fill-blue-dark-sky;
              }
            }
        }
    }

    .the-menu path {
      @apply fill-blue-dark-sky;
    }

    .the-menu .active path {
      @apply fill-white;
    }

    .avatar-xs {
        bottom: -7px;
        right: -10px;
        width: 16px;
        height: 16px;
    }

    .deck-options {
        min-height: 538px;
        animation: containerAnimation 1s backwards;
    }

    .deck-actions {

        .deck-options-icon {
            width: 18px;
            height: 18px;
        }

        button.btn.btn-link {
            font-size: 13px;
        }
    }

    @keyframes blinker {
        50% {
            opacity: 0;
        }
    }

    .active-deck {
        .deck {
            box-shadow: 0 0.5rem 1rem rgb(72 135 230 / 74%) !important;
            animation: blinker 2s linear forwards;
        }
    }

    .sidebar-icons-wrapper {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        width: 46px;
        padding-right: 15px;
        margin-left: 17px;
    }

    .deck {
        @apply bg-white;
        min-width: 379px;
        max-width: 379px;
        height: 100% !important;
        overflow: hidden !important;

        @include themify(night) {
          @apply bg-dark-200;
        }
    }

    .cog-icon {
        width: 16px;
    }

    .deck-header {
        padding: 0.69rem !important;
    }

    .icon {
        width: 20px;
        height: 20px;
    }

    .icon svg {
        width: 100%;
        height: 100%;
    }

    .icon path {
      @apply fill-blue-dark-sky;
    }

    .header-title {
        font-size: 16px;
        font-weight: 600;
        text-transform: capitalize;
    }

    .deck-index {
        font-size: 13px;
        font-weight: 400;
        background-image: url(../../img/index-bg.png);
        background-size: contain;
        background-position-y: center;
        background-repeat: no-repeat;
        position: absolute;
        top: 0px;
        bottom: 0px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 10px;
    }

    .hot-item-index {
        font-size: 16px;
        font-weight: 500;
    }

    .hot-item-link {
        font-size: 14px;
        font-weight: 500;
        word-break: break-word;
    }

    .hot-item-post-count {
        font-size: 14px;
        font-weight: 400;
    }

    .item-container {
        max-height: calc(100vh - 176px);
        overflow: auto;
    }

    .search-item-avatar {
        width: 35px;
        height: 35px;
    }

    .search-post-image {
        width: 100%;
        height: 146px;
        background-repeat: no-repeat;
        background-size: contain;
        background-position-x: center;
    }

    .footer-icons svg {
        width: 18px;
        height: 18px;
    }

    .footer-icons {
        flex: 0.8;
    }

    .deck-item-body {
        max-width: 370px;
        word-break: break-word;
        line-height: 1.4;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 120px;
        display: -webkit-box;
    }

    .deck-body {
        .tooltiptext {
            max-width: 295px !important;
        }
    }

    .deck-body .item-controls {
        max-width: 80%;
        .comments {
            path {
                @apply fill-gray-light;
            }
        }

        div {
            margin: 0px !important;
        }

        font-size: 12px !important;

        svg {
            width: 16px !important;
        }

        .menu-down {
            height: auto !important;
            width: auto !important;
        }
    }

    .deck-pinned {
        @apply text-red-040;
        transform: rotate(45deg);

        svg {
            width: 14px !important;
        }
    }

    .deck-header-settings-item {
        font-size: 14px;

        .toggle {
            padding: .68rem;
            font-size: 14px;
        }

        .label {
            max-width: 100px;
            min-width: 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }
    .option {
        border-radius: 8px;
        width: 108px;
        height: 86px;
        &:hover {
            background-color: #ebf2fc;

            @include themify(night) {
                @apply bg-gray-steel;
            }
        }
    }

    .option path {
        fill: #1b68da;
    }

    .header-icon path {
        fill: #1b68da;
    }

    .header {
        font-size: 21px;
        font-weight: 500;
        position: relative;
        padding: 0px 0px!important;

        button {
            position: absolute;
            top: -25px;
            right: 13px;
        }
        .title {
            position: absolute;
            top: -22px;
        }
    }

    .w-80 {
        width: 80% !important;
    }

    .back-icon path {
        fill: #1b68da;
    }

    .back-icon {
        color: #1b68da;
        width: 25px;
    }

    .suggestion .suggestion-list {
        position: absolute !important;
    }

    .coming-soon {
        position: absolute;
        left: 10px;
        top: 10px;
    }
}
