///
/// This files regroups the variables and mixins which are specific to the editor.
///

$o-we-font-family: Roboto, 'Montserrat', "Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif !default;

$o-we-color-dark: #2c2c36 !default;
$o-we-color-darker: darken($o-we-color-dark, 2%) !default;
$o-we-color-divider: #33363e !default;
$o-we-color-light: #4e525b !default;
$o-we-color-normal: #50545d !default;
$o-we-color-paper: #fcfcfc !default;
$o-we-color-text-normal: #999999 !default;
$o-we-color-text-light: #d4d5d7 !default;
$o-we-color-danger: #e6586c !default;
$o-we-color-warning: #f0ad4e !default;
$o-we-color-success: #40ad67 !default;
$o-we-color-info: #6999a8 !default;

$o-we-sidebar-width: 210px !default;

$o-we-tab-active-bg: #3D4048 !default;

// Transitions
$o-we-md-ease: cubic-bezier(0.19, 1, 0.22, 1) !default;

// Editor
$o-we-dropzone-size: 40px !default;
$o-we-dropzone-border-width: 2px !default;
$o-we-dropzone-border: $o-we-dropzone-border-width dashed $o-brand-primary !default;

$o-we-handle-edge-size: 1px !default;
$o-we-handle-border-width: 1px !default;
$o-we-handles-offset-to-hide: 10000px !default;
$o-we-handles-accent-color: #00e2ff !default;
$o-we-handles-btn-size: 18px !default;

$o-we-overlay-option-size: 25px !default;

$o-we-ace-color: #2F3129 !default;

$o-we-switch-size: 2ex !default;
$o-we-switch-inactive-color: $o-we-color-paper !default;

// ============    'Preview' component Mixins    ===============
// Create a "preview" work-area to edit/customize specific elements

@mixin o-we-preview-box($padding: 0px 25px 25px 25px, $color-text: white) {
    padding: $padding;
    border-top: 1px solid black;
    border-bottom: 1px solid white;
    @include o-linear-gradient(-150deg, $o-we-color-dark, $o-we-color-darker);

    color:  $color-text;
}

@mixin o-we-preview-content {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 0 15px 2px #000;
}


// ============    Preservetion mixins    ===============
// Used to preserve web_editor and website UI from themes customizations

@mixin o-w-preserve-base {
    font-family: $o-we-font-family;
    line-height: 1.42857143;
    color: $o-we-color-divider;

    .text-muted {
        color: $o-we-color-text-normal;
    }
}

@mixin o-w-preserve-headings {
    h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
        font-family: $o-we-font-family;
        line-height: 1.42857143;
        color: $o-we-color-dark;
        font-weight: bold;
    }
}

@mixin o-w-preserve-links {
    a:not(.o_btn_preview) {
        color: $o-brand-optional;

        &:focus, &:active, &:focus:active {
            outline: none!important;
        }
    }

    .label {
        &:hover a, a {
            color: #fff;
        }
    }
}

@mixin o-w-preserve-forms {
    .form-control {
        height: 34px;
        padding: 6px 12px;
        font-size: 14px;
        line-height: 1.42857143;
        border: 1px solid $o-we-color-text-light;
        color: #555;
        background-color: #fff;
        border-radius: 0;
    }

    .has-error {
        .form-control {
            border-color: $state-danger-text;
        }
    }

    select.form-control {
        @include o-appearance(none);
        background: url('data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPScxLjEnIHhtbG5zPSdodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZycgeG1 sbnM6eGxpbms9J2h0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsnIHdpZHRoPScyNCcgaGVpZ2 h0PScyNCcgdmlld0JveD0nMCAwIDI0IDI0Jz48cGF0aCBpZD0nc3ZnXzEnIGQ9J203LjQwNiw3L jgyOGw0LjU5NCw0LjU5NGw0LjU5NCwtNC41OTRsMC40MDYsMS40MDZsLTUsNC43NjZsLTUsLTQu NzY2bDAuNDA2LC0xLjQwNnonIGZpbGw9JyM4ODgnLz48L3N2Zz4=');
        background-position: 100% 65%;
        background-repeat: no-repeat;
    }
}

@mixin o-w-preserve-modals {
    background: 0;

    .modal-content {
        border-radius: 0;
        background-color: $o-we-color-paper;

        .modal-body {
            background-color: white;
        }
        .modal-footer {
            text-align: left;
        }
    }
}

@mixin o-w-preserve-tabs {
    .nav-tabs {
        border-bottom: 1px solid $gray-lighter;

        > li  {
            > a {
                line-height: 1.42857143;
                color: $o-we-color-light;
                &:hover {
                    border-color: $gray-lighter;
                }
            }

            &.active > a {
                &, &:hover, &:focus {
                    color: $o-we-color-normal;
                    background-color: $o-we-color-paper;
                    border-color: $gray-lighter;
                    border-bottom-color: transparent;
                }
            }
        }
    }
}

@mixin o-w-preserve-btn {
    .btn:not(.o_btn_preview) {
        border-width: 1px;
        border-radius: 0;
        font-weight: normal;
        @include button-size(6px, 12px, 14px, 1.42857143, 0);

        &.btn-primary {
            @include button-variant(white, $o-brand-optional, darken($o-brand-optional,5%));
        }
        &.btn-default {
            @include button-variant($o-we-color-normal, white, $o-we-color-text-light);
        }
        &.btn-link {
            @include button-variant($o-brand-optional, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0));
        }
        &.btn-success {
            @include button-variant(white, $o-we-color-success, darken($o-we-color-success, 5%));
        }
        &.btn-info {
            @include button-variant(white, $o-we-color-info, darken($o-we-color-info, 5%));
        }
        &.btn-warning {
            @include button-variant(white, $o-we-color-warning, darken($o-we-color-warning, 5%));
        }
        &.btn-danger {
            @include button-variant(white, $o-we-color-danger, darken($o-we-color-danger, 5%));
        }

        &.btn-lg {
            @include button-size(10px, 16px, 18px, 1.3333333, 0);
        }
        &.btn-sm {
            @include button-size(5px, 10px, 12px, 1.5, 0);
        }
        &.btn-xs {
            @include button-size(1px, 5px, 12px, 1.5, 0);
        }
    }
}

@mixin o-w-preserve-wells {
    .well {
        padding: 19px;
        margin-bottom: 20px;
        background-color: $o-we-color-paper;
        border: 1px solid darken($o-we-color-paper,5%);
        border-radius: 0;
        @include box-shadow(none);
    }
}

// Edition colors

// Colors
$gray-white: #fff !default;

$color-alpha: #1cc1a9 !default;
$color-beta: #875A7B !default;
$color-gamma: #BA3C3D !default;
$color-delta: #0D6759 !default;
$color-epsilon: #0B2E59 !default;

// Greyscale transparent colours
$color-black-25: rgba(black, 0.25) !default;
$color-black-50: rgba(black, 0.5) !default;
$color-black-75: rgba(black, 0.75) !default;
$color-white-25: rgba(white, 0.25) !default;
$color-white-50: rgba(white, 0.5) !default;
$color-white-75: rgba(white, 0.75) !default;

@mixin o-create-color-classes($name, $color, $complementary: o-get-most-contrast($color, $text-color, #FFF), $content-color: $color) {
    .bg-#{$name} {
        background-color: $color;
        color: $complementary;
        .text-muted {
            color: rgba($complementary, 0.4);
        }
    }
    body .text-#{$name} { // body to make the rules more important that bg-* ones
        color: $content-color;
    }
}
@mixin o-create-color-btn-classes($name, $color, $complementary: o-get-most-contrast($color, $text-color, #FFF), $border-color: darken($color, 5%)) {
    .btn-#{$name} {
        @include button-variant($complementary, $color, $border-color);
    }
}

// Translations
$o-we-content-to-translate-color: rgb(255, 255, 90) !default;
$o-we-translated-content-color: rgb(120, 215, 110) !default;
