/* Gorgias Chrome Extension
 */

@import "nib";
@import "../../bower_components/angular/angular-csp.css";
@import "../../bower_components/bootstrap/dist/css/bootstrap.css";
@import "../../bower_components/font-awesome/css/font-awesome.css";
@import "../../bower_components/textAngular/src/textAngular.css";

/* Functions
 */

emCalc(h) {
    unit(h / 16, 'em');
}

/* Variables
 */

$grey1 = #eee;
$black = #333;
$color1 = rgb(77, 144, 254);
$sidebarWidth = 248px;
$contentWidth = 800px;

/* Bootstrap theme
 */
@import "bootstrap-chrome.styl";

/* Editor styles
 */
@import "editor.styl";

/* General
 */
body {
    padding-top: emCalc(86);

    color: $black;
}

.container {
    width: 100%;
    padding: 0;
}

/* Fixed header
 */
header {
    position: fixed;
    top: 0;
    left: $sidebarWidth;
    width: $contentWidth;
    z-index: 999;
    background: linear-gradient(white, white 40%, rgba(255, 255, 255, 0.92));
}

.header-actions {
    padding-top: emCalc(24);

    .form-control {
        width: emCalc(220);
    }
}

/* View container
 */
.view-container {
    position: relative;
    width: $contentWidth;
    margin-left: $sidebarWidth;
}

.container-animation {
    position: relative;
    display: block;
    width: 100%;
}

.container-animation.ng-enter,
.container-animation.ng-leave {
    transition: all .1s ease-out;

    header {
        position: absolute;
        top: emCalc(-88);
        left: 0;
        width: 100%;
    }
}

.container-animation.ng-enter {
    opacity: 0;
    transform: translate3d(50px, 0, 0);
}

.container-animation.ng-enter.ng-enter-active {
    opacity: 1;
    z-index: 1000;
    transform: translate3d(0, 0, 0);
}

.container-animation.ng-leave {
    position: absolute;
    z-index: 101;
    transform: translate3d(0, 0, 0);
}

.container-animation.ng-leave.ng-leave-active {
    opacity: 0;
    transform: translate3d(-50px, 0, 0);
}

/* Sidebar
 */
.sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: $sidebarWidth;
    padding: emCalc(16) emCalc(20) 0 emCalc(22);
}

.brand {
    display: block;
    margin-bottom: emCalc(8);

    font-size: emCalc(36);
    line-height: 1em;
    color: lighten($black, 30%);
    vertical-align: bottom;

    img {
        max-width: emCalc(80);
        opacity: .8;

        vertical-align: middle;
    }

    &:hover {
        color: $black;
        text-decoration: none;
    }
}

.anonymous,
.profile-body {
    margin-bottom: emCalc(28);
}

/* List group item
 */
.list-group-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 0 !important;

    .hover-actions {
        display: block;
        position: absolute;
        top: 50%;
        right: emCalc(12);
        transform: translateY(-50%);
        min-width: 200px;
        text-align: right;

        button
        .btn {
            display: inline-block;
            margin-left: emCalc(8);

            transition: all .1s ease-out;
            opacity: 0;

            &:focus {
                opacity: 1;
            }
        }
    }

    .list-group-item-link:focus ~ .hover-actions,
    &:hover .hover-actions {
        .btn,
        button {
            opacity: 1;
        }
    }

    &.active {
        background: lighten($color1, 90%);
    }
}

/* list
  */
.quicktexts-list {

    .list-group-item {
        padding: 0;

        .list-group-item-link {
            display: block;
            padding: emCalc(12) emCalc(16);
            cursor: pointer;

            color: $black;

            &:hover {
                text-decoration: none;
            }

            &:focus {
                background: lighten($color1, 90%);
            }
        }

        &:hover {
            background-color: $grey1;
        }
        .label {
            font-size: 80%;
        }
    }

    .quicktext-detail {
        margin-bottom: emCalc(8);

        strong {
            font-weight: normal;
            font-size: emCalc(12);
            color: rgba($black, 50%);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .quicktext-template {
            display: block;
        }

        p {
            margin: 0;
        }
    }

    .quicktext-shortcut {
        padding-top: 8px;
        span {
            font-size: 16px;
            padding: .25em .5em;
            border: 1px solid #CCC;
            background-color: #F2F2F2;
            -webkit-border-radius: 5px;
            border-radius: 5px;
            -webkit-box-shadow: 0 2px 2px #F2F2F2;
            box-shadow: 0 2px 2px #F2F2F2;
        }
    }
}

.template-list-empty {
    padding: 12px;
}

.quicktext-filters {
    padding-top: 16px;
    padding-bottom: 5px;
    .label {
        font-size: 80%;
    }
}

/* Login modal
 */
.login-modal {

    .modal-dialog {
        max-width: 360px;
    }

}

/* new/edit modal
 */
.quicktext-modal {

    .modal-dialog {
        max-width: 480px;
    }
    .modal-footer .btn + .btn {
        margin-bottom: 0.25em;
        margin-left: 5px;
    }
    .configure-fields {
        padding-top: 2px;
        margin-right: 8px;
        .dropdown-menu {
            padding: 8px;
        }
    }
}

/* Register modal
 */
.register-modal {

    .modal-dialog {
        max-width: 420px;
    }

}

.btn-social {
    font-size: emCalc(20);
    color: #fff;
}

.btn-google {
    background-color: #DF4A32;
    border-color: darken(@background-color, 20%);

    i {
        color: lighten(@background-color, 80%);
    }

    &:hover {
        color: #fff;
        border-color: darken(@background-color, 20%);
        background-color: darken(@background-color, 15%);
    }
}

.text-separator {
    margin-top: emCalc(20);
    border-top: 1px solid $grey1;

    text-align: center;

    p {
        display: inline-block;
        position: relative;
        top: emCalc(-12);
        padding: 0 emCalc(8);
        background-color: #fff;
    }
}

/* Page Action Popup
 */

.popup {
    width: 630px;
    height: 600px;

    .sidebar-wrapper {
        display: none;
    }

    header {
        left: 0;
        padding: emCalc(8) emCalc(20);
    }

    .view-container {
        margin: 0;
    }

    header,
    .view-container {
        width: 100%;
    }

    /* Don't use view transition in the action popup
    */
    .container-animation.ng-enter,
    .container-animation.ng-leave {
        transition: none;
    }

    /* More padding for the btn-toolbar
     */
    .btn-toolbar {
        padding: emCalc(12) emCalc(16);
    }
}

/* Profile
 */
.profile-body {
    clearfix();

    transition: all .1s ease-out;
    transition-delay: .3s;
    transform: translateX(emCalc(-68));
    opacity: .5;

    &:hover {
        transform: translateX(0);
        opacity: 1;

        .profile-picture {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .profile-picture {
        float: left;
        margin-right: emCalc(12);

        transition: all .15s ease-out;
        transition-delay: .3s;
        transform: translateX(emCalc(8));
        opacity: .6;

        img {
            max-width: emCalc(60);
        }
    }

    .profile-details {
        float: left;
        padding-top: emCalc(6);
        cursor: default;

        p {
            margin: 0;

            color: lighten($black, 20%);

            strong {
                font-size: emCalc(20);
                color: $black;
            }
        }
    }
}

.sidebar-spam {
    .signature {
        .img-circle {
            margin-right: 8px;
            width: 50px;
        }
    }
}

/* Sidebar footer
 */
.sidebar-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    padding: emCalc(16) emCalc(20) emCalc(20) emCalc(22);

    .twitter-badge {
        width: 120px;
    }

    .sync-status {
        transition: all .1s ease-in;
        opacity: .6;

        &:hover {
            opacity: 1;
        }

        .sync-label {
            padding-bottom: emCalc(8);
        }
    }
}

/* Blacklist
 */

.blacklist-list {
    overflow-x: hidden;
    overflow-y: auto;
    max-width: emCalc(360);
    max-height: emCalc(260);
    padding: emCalc(8);
    margin: 0 0 emCalc(4);
    border: 1px solid #bfbfbf;
    border-radius: 2px;
}

.blacklist-item {
    position: relative;
}

.blacklist-item:hover .blacklist-item-remove {
    opacity: 1;
}

.blacklist-item:hover .blacklist-item-url {
    border-color: lighten(#bfbfbf, 40%);
}

.blacklist-item-url {
    display: block;
    width: 100%;
    padding: emCalc(5) 0 emCalc(4);
    border-radius: 0;
    border-color: transparent;
    border-width: 0 0 1px 0;
}

.blacklist-item .blacklist-item-url:focus {
    border-color: #bfbfbf;
    outline: none;
}

.blacklist-item-remove {
    position: absolute;
    bottom: 1px;
    right: 0;
    opacity: 0;
    background: #fff;
    border: 0;
    padding: emCalc(4);

    color: #bfbfbf;
    transition: all .2s ease-out;
}

.blacklist-item-remove:hover {
    color: #333;
}

.blacklist-blank-state {
    padding: emCalc(8);

    color: #737373;
    text-align: center;
}

.body-label {
    margin-top: 8px;
}

.insert-var-container li{
    cursor: pointer;
}

.dropdown-toggle {
    padding-top: 5px;
    background: #FAFAFA;
    &:hover {
        background: #f2f2f2;
    }
}



