@import "fonts";

@mixin generate-column-class() {
    @for $i from $wcc-total-grid-cols through 1 {
        $width: percentage( calc($i / $wcc-total-grid-cols) );

        .wcc-col-#{$i} {
            width: $width;
            max-width: $width;
            flex-basis: $width;
        }
    }
}
@include generate-column-class();

.wcc-app-admin {
    background: #fff;
}
.wcc-app-wrap * {
    box-sizing: border-box;
}
.wcc-app-modal-open {
    overflow: hidden;
}
.wcc-app-wrap *:before,
.wcc-app-wrap *:after {
    box-sizing: border-box;
}

%column {
    min-height: 1px;
    padding-left: calc($wcc-gutter / 2);
    padding-right: calc($wcc-gutter / 2);
    position: relative;
}

%flex {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

%align-center {
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

@include wrap-class() {
    img {
        max-width: 100%;
    }
    [class*="wcc-col-"] {
        @extend %column;
    }

    .wcc-row {
        display: flex;
        flex-flow: wrap;
        margin-right: - calc($wcc-gutter / 2);
        margin-left: - calc($wcc-gutter / 2);

        &:last-child {
            margin-bottom: 0;
        }
    }
    .wcc-col {
        @extend %column;
        flex: 1;
    }
    .wcc-align-center {
        @extend %flex;
        @extend %align-center;
    }
    .wcc-align-top {
        @extend %flex;
        align-items: flex-start !important;
    }
    .wcc-flex {
        @extend %flex;
    }
    .wcc-justify-between {
        @extend %flex;
        justify-content: space-between;
    }
    .wcc-justify-end {
        @extend %flex;
        justify-content: flex-end;
    }
    .wcc-center {
        @extend %flex;
        @extend %align-center;
        justify-content: center;
    }
    .wcc--no-border {
        border: none !important;
    }
    .wcc-direction--column {
        flex-direction: column;
        -ms-flex-direction: column;
    }
    .wcc-text-center {
        text-align: center !important;
    }
    .wcc-text-right {
        text-align: right !important;
    }
    .wcc-px-2 {
        padding-left: ($spacer * 0.5) !important;
        padding-right: ($spacer * 0.5) !important;
    }
    .wcc-py-2 {
        padding-top: ($spacer * 0.5) !important;
        padding-bottom: ($spacer * 0.5) !important;
    }
    .wcc-px {
        padding-left: $spacer !important;
        padding-right: $spacer !important;
    }
    .wcc-py {
        padding-top: $spacer !important;
        padding-bottom: $spacer !important;
    }
    .wcc-p-3 {
        padding: $spacer !important;
    }
}
// Remove Wordpress admin notices
@include body-class() {
    .update-nag,
    .updated,
    .error,
    .is-dismissible {
        display: none;
    }
    .wrap {
        margin: 0px 20px 0 2px;
    }
}

@include wrap-class() {
    .wcc-app-nav-bar {
        width: $nav-width;
        top: $nav-top;
        left: $nav-left;
        position: fixed;
        z-index: 999;
        box-shadow: 0px 4px 12px 0px #55657D1A;
    }

    .wcc-app-body {
        position: relative;
        padding-top: 12px;
    }
    ul {
        list-style: disc;
        padding-left: 15px;

        &.wcc-list-unstyled {
            list-style: none;
        }
    }
    .wcc-section {
        padding: 20px 15px;
        margin-top: 20px;
        margin-bottom: 20px;
        .wcc-section-header {
            padding: calc( $wcc-gutter/2) 0px;
            &.wcc-section-header-boxed {
                padding: 10px 15px;
                background: #f1f1f1;
                border: 1px solid $border-color;
                border-bottom: none;
            }
        }
        .wcc-section-title {
            margin-right: 15px;
        }
        .wcc-law-select-header{
            padding-bottom: 0px;
            padding: 0px 15px;
        }
    }

    .wcc-stats-section {
        @extend %flex;
    }

    .wcc-stats-col {
        text-align: center;
    }
    // Widget loader
    .wcc-loading-text {
        position: absolute;
        z-index: 12;
        top: 50%;
        left: 50%;
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        color: color(secondary, font);
        display: flex;
        align-items: center;

        .wcc-spinner {
            margin-right: 10px;
        }
    }

    // Empty message
    .wcc-empty-state {
        @extend %flex;
        @extend %align-center;
        flex-direction: column;
        -ms-flex-direction: column;
        justify-content: center;
        padding: 15px;
    }
    .wcc-empty-message {
        background-color: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
        margin: 10px 0;
    }
    // Badge Styles
    .wcc-badge {
        font-size: 13px;
        font-weight: $font--medium;
        border-radius: 3px;
        display: inline-flex;
        align-items: center;
        .wcc-badge-content {
            padding: 3px 5px;
        }
    }
    .wcc-badge-info {
        color: darken(color(info, light), 50%);
        .wcc-badge-content {
            background-color: color(info, light);
        }
    }
    .wcc-badge-error {
        color: color(badgeFont, error);
        .wcc-badge-content {
            background:  color(badgeColor, error);
        }
    }
    .wcc-badge-warning {
        color: color(badgeFont, warning);
        .wcc-badge-content {
            background:  color(badgeColor, warning);
        }
    }
    .wcc-badge-success {
        color: color(badgeFont, success);
        .wcc-badge-content {
            background:  color(badgeColor, success);
        }
    }
    // Icon styles

    .wcc-icon-base {
        display: inline-flex;
    }

    // Miscellanious
    .wcc-zero--padding {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        padding-top: 0 !important;
    }
    .wcc-zero--margin {
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
    }

    // Colour Picker Styles
    .wcc-color-picker {
        width: 130px;
        height: 30px;
        & > div {
            height: 100%;
        }
        border: 1px solid $border-color;

        .wcc-current-color {
            cursor: pointer;
            display: block;
            width: 40px;
            height: 100%;
        }
        .vc-chrome {
            position: absolute;
            z-index: 999;
        }
        .wcc-color-picker-input {
            width: 120px;
            box-sizing: border-box;
            background: #f6f7f7;
            box-sizing: border-box;
            font-size: 14px;
            cursor: pointer;
            .wcc-input-color {
                background: transparent;
                border: none;
                text-transform: uppercase;
                font-size: 12px;
            }
        }
    }

    // Help texts
    .wcc-help-text {
        margin: 10px 0;
        p {
            font-size: 12px;
            color: color(secondary, font);
        }
    }

    // Colors
    .wcc-color-red {
        color: color(error, base);
    }
    .wcc-color-link {
        color: $font--color-link;
    }

    .wcc-status-indicators {
        font-size: 14px;
        line-height: 18px;
        font-weight: 500;
        > span {
            font-weight: 400;
        }
    }
    .wcc-status-error {
        color: color(error, base);
        svg {
            fill: color(error, base);
        }
    }
    .wcc-status-success {
        color: color(green, base);
    }
    .wcc-status-indicators {
        display: inline-flex;
        align-items: center;
        h5 {
            margin: 0;
        }
        .wcc-status-info {
            display: inline-flex;
            align-items: center;
        }
        .wcc-icon-base {
            margin-right: 5px;
        }
    }
    a.wcc-link.wcc-actions-link {
        font-size: 14px;
        text-decoration: none;
        &:hover {
            text-decoration: underline;
        }
    }
    // Form error message
    .wcc-error-message {
        display: block;
        margin-top: 8px;
        color: color(error, base);
        font-size: 12px;
        line-height: 16px;
        font-weight: 500;
    }
}
// Banner Preview Styles
button.wcc-preview-close {
    position: fixed;
    top: 50px;
    right: 50px;
    z-index: 999999999;
    background: transparent;
    border: none;
    color: #ffff;
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    &:after {
        content: "";
        width: 25px;
        height: 25px;
        background: #fff;
        display: inline-flex;
        -webkit-mask-image: url("~@/assets/close.svg");
        mask-image: url("~@/assets/close.svg");
        background-color: #fff;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: cover;
        mask-size: cover;
        -webkit-mask-position: center;
        mask-position: center;
    }
}
@include wrap-class() {
    .wcc-breadcrumbs-title {
        display: flex;
        align-items: center;
    }
    .wcc-breadcrumbs-title {
        font-weight: 600;
        font-size: 15px;
        display: flex;
        align-items: center;
        &:before {
            content: "";
            width: 13px;
            height: 10px;
            margin-right: 5px;
            display: inline-flex;
            -webkit-mask-image: url("~@/assets/arrow-left.svg");
            mask-image: url("~@/assets/arrow-left.svg");
            background-color: color(primary, font);
            -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
            -webkit-mask-size: cover;
            mask-size: cover;
            -webkit-mask-position: center;
            mask-position: center;
        }
    }
    .wcc-section-inner {
        margin-top: 10px;
        margin-bottom: 20px;
        background: #fff;
    }
    .wcc-blur {
        filter: blur(2px);
        pointer-events: none;
        user-select: none;
    }
    .wcc-external-link {
        display: inline-flex;
        align-items: center;
    }
    .wcc-external-link:after {
        content: "";
        width: 13px;
        height: 13px;
        margin-left: 8px;
        display: inline-flex;
        -webkit-mask-image: url("~@/assets/external.svg");
        mask-image: url("~@/assets/external.svg");
        background-color: currentColor;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
        -webkit-mask-position: center;
        mask-position: center;
    }
    .wcc-app-box {
        background: #fff;
        padding: 12px 20px;
        margin-bottom: calc($wcc-gutter / 2);
        border-radius: 3px;
    }
    .wcc-banner-message {
        background: #F0F0F0;
        padding: 12px 20px;
        margin-bottom: calc($wcc-gutter / 2);
        border-radius: 3px;
    }
    .wcc-pro-badge {
        font-size: 8px;
        background: #e1e0e1;
        text-transform: uppercase;
        padding: 2px 5px;
        color: #787d81;
        border-radius: 1px;
        margin-left: 5px;
    }
    .wcc-button-transparent{
        color: #555E6B;
        border: 1px solid #9DA3AA;
        background-color: #fff;
        width: auto;
        min-width: 80px;
        padding: 6px 14px;
        font-weight: 500;
        font-size: 14px;
        border-radius: 3px;
        cursor: pointer;
        line-height: 12px;
        display: flex;
        align-items: center;
        margin-bottom: 16px;
    }
}
.wcc-preview-partial-refreshing {
    .wcc-consent-container:before {
        content: "";
        position: absolute;
        top: 0;
        -webkit-animation: linear 1s placeHolderShimmer infinite;
        animation: linear 1s placeHolderShimmer infinite;
        background: #f6f7f8;
        background: radial-gradient(
                75.49% 775.24% at 68.84% 100%,
                rgba(98, 151, 219, 0.12) 0%,
                rgba(24, 99, 220, 0.12) 43.3%,
                rgba(98, 151, 219, 0.12) 98.84%
            )
            #ffffff;
        background-size: 800px 104px;
        width: 100%;
        height: 100%;
        transform: translateZ(0);
        opacity: 0.7;
        cursor: progress;
        z-index: 999;
    }
}
@-webkit-keyframes shimmer-move {
    0% {
        -webkit-transform: translateX(-150%);
        transform: translateX(-150%);
    }
    to {
        -webkit-transform: translateX(150%);
        transform: translateX(150%);
    }
}
@keyframes shimmer-move {
    0% {
        -webkit-transform: translateX(-150%);
        transform: translateX(-150%);
    }
    to {
        -webkit-transform: translateX(150%);
        transform: translateX(150%);
    }
}
@keyframes placeHolderShimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}
@import "loader";
@import "buttons";
@import "radio";
@import "forms";
@import "notices";
@import "cards";
@import "tables";
@import "tabs";
@import "modal";
@import "accordion";

// Override styles
@include wrap-class() {
    .wcc-upgrade-button-container {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        button {
            min-width: 320px;
        }
        .wcc-seperator-text {
            margin: 5px 0px;
        }
    }
    .wcc-info-widget-container {
        display: flex;
        justify-content: space-between;
        .wcc-info-widget {
            display: flex;
            align-items: center;
            padding: 20px 15px;
            border: 1px solid #d7e1f2;
            border-radius: 6px;
            width: 48.5%;
            .wcc-info-widget-icon {
                max-width: 50px;
            }
            .wcc-info-widget-content {
                margin-left: 10px;
                display: flex;
                flex-direction: column;
                .wcc-info-widget-text {
                    font-size: 15px;
                    font-weight: 600;
                    line-height: 17px;
                    text-transform: capitalize;
                    margin-top: 3px;
                }
                .wcc-info-widget-title {
                    font-size: 13px;
                    line-height: 15px;
                    color: #676767;
                }
            }
        }
    }
}
