@charset 'UTF-8';

.custom-textarea {
    background: transparent;
    border: 1px solid #cccccc;
    height: auto;
    line-height: 20px;
    min-height: 36px;
    overflow-x: hidden;
    resize: none;
    white-space: pre-wrap;
    word-wrap: break-word;

    &:focus {
        border-color: #cccccc;
        box-shadow: none;
    }
}

.bad-connection {
    background: #ffffac !important;
    color: #d04444 !important;
}

.textarea-wrapper {
    min-height: 36px;
    position: relative;

    .textbox-preview-area {
        box-shadow: none;
        left: 0;
        position: absolute;
        top: 0;
        white-space: normal;
        z-index: 2;
    }

    .help__text {
        bottom: -23px;
        cursor: pointer;
        font-size: 13px;
        position: absolute;
        right: 0;
        text-align: right;
        z-index: 3;
    }

    .textbox-preview-link {
        margin-right: 8px;
    }
}

.help__format-text {
    @include opacity(0);
    @include single-transition(all, .5s, ease, .5s);
    display: inline-block;
    font-size: .85em;
    margin-right: 10px;
    vertical-align: bottom;
    white-space: nowrap;

    b,
    i,
    span {
        margin: 0 2px;
        position: relative;
        top: -1px;
    }

    b {
        @include opacity(.9);
    }

    code {
        background: transparent;
        padding: 0;
    }

    .textbox-preview-link {
        cursor: pointer;
        font-size: 13px;
        margin-left: 15px;
    }
}

.date-separator,
.new-separator {
    height: 2em;
    margin: 0;
    position: relative;
    text-align: center;
    z-index: 0;

    &:before,
    &:after {
        content: '';
        display: none;
        height: 1em;
        left: 0;
        position: absolute;
        width: 100%;
    }

    &:before {
        bottom: 0;
    }

    &:after {
        top: 0;
    }

    &.hovered--after {
        &:before {
            background: #f5f5f5;
            display: block;
        }
    }

    &.hovered--before {
        &:after {
            background: #f5f5f5;
            display: block;
        }
    }

    .separator__hr {
        border-color: #cccccc;
        margin: 0;
        position: relative;
        top: 1em;
        z-index: 5;
    }

    .separator__text {
        @include border-radius(50px);
        background: #ffffff;
        color: #555555;
        display: inline-block;
        font-size: 13px;
        font-weight: 700;
        line-height: 2em;
        padding: 0 1em;
        position: relative;
        z-index: 5;
    }
}

.new-separator {
    .separator__hr {
        border-color: #ffaf53;
    }

    .separator__text {
        color: #ff8800;
        font-weight: normal;
    }
}

.file-overlay {
    color: $white;
    font-size: em(20px);
    font-weight: 600;
    height: 100%;
    left: 0;
    pointer-events: none;
    position: absolute;
    text-align: center;
    top: 0;
    width: 100%;
    z-index: 6;

    .overlay__indent {
        @include clearfix;
        @include alpha-property(background-color, $black, .6);
        height: 100%;
        position: relative;
    }

    &.center-file-overlay {
    }

    &.right-file-overlay {
        font-size: em(18px);

        .overlay__circle {
            height: 300px;
            margin: -150px 0 0 -150px;
            width: 300px;
        }

        .overlay__files {
            margin: 60px auto 15px;
            width: 150px;
        }
    }

    .overlay__circle {
        @include border-radius(500px);
        @include alpha-property(background, $black, .7);
        height: 370px;
        left: 50%;
        margin: -185px 0 0 -185px;
        pointer-events: none;
        position: absolute;
        top: 50%;
        width: 370px;
    }

    .overlay__files {
        display: block;
        margin: 75px auto 20px;
    }

    .overlay__logo {
        @include opacity(.3);
        bottom: 30px;
        left: 50%;
        margin-left: -50px;
        position: absolute;
    }

    .fa {
        display: inline-block;
        font-size: 1.1em;
        margin-right: 8px;
    }
}

#post-list {
    @include flex(1 1 auto);
    height: 100%;
    overflow-y: hidden;
    position: relative;

    .inactive {
        display: none;
    }

    .post-list-holder-by-time {
        -webkit-overflow-scrolling: touch;
        background: #ffffff;
        height: 100%;
        overflow-y: scroll;
        padding: 1em 0 0;
        position: absolute;
        width: 100%;

        &.active {
            display: inline;
        }
    }

    .more-messages-text {
        border: none;
        display: block;
        font-size: 13px;
        margin: 5px 0 10px;
        outline: none;
        text-align: center;
    }

    .new-messages__button {
        @include opacity(0);
        bottom: 0;
        font-size: 13.5px;
        left: 0;
        margin: 0 auto;
        position: absolute;
        right: 0;
        text-align: center;
        visibility: hidden;
        z-index: 1;

        .fa {
            font-size: 1.2em;
            font-weight: bold;
            margin-right: .5rem;
            position: relative;
            top: 1px;
        }

        div {
            @include border-radius(50px);
            cursor: pointer;
            display: inline-block;
            padding: 5px 10px;
        }

        &.visible {
            @include opacity(1);
            visibility: visible;
        }

        &.disabled {
            display: none;
        }
    }
}

.post-list__timestamp {
    @include opacity(0);
    @include single-transition(all, .6s, ease);
    @include translateY(-45px);
    display: none;
    left: 0;
    position: absolute;
    text-align: center;
    top: 8px;
    width: 100%;
    z-index: 50;

    &.scrolling {
        @include translateY(0);
        @include opacity(.8);
    }

    > div {
        @include border-radius(3px);
        @include font-smoothing(initial);
        background: $primary-color;
        color: $white;
        display: inline-block;
        font-size: 12px;
        line-height: 25px;
        padding: 0 8px;
        text-align: center;
    }
}

.post-list__arrows {
    @include opacity(0);
    @include single-transition(all, .6s);
    background-repeat: no-repeat;
    bottom: 0;
    display: none;
    fill: #444444;
    height: 40px;
    left: 9px;
    position: absolute;
    text-align: center;
    width: 40px;
    z-index: 50;

    svg {
        color: inherit;
        height: 28px;
        width: 28px;
    }

    &.scrolling {
        @include opacity(1);
        display: block;
    }
}

.post-create__container {
    form {
        margin: 0 auto;
        padding: .5em 15px 0;
        width: 100%;
    }

    .center {
        max-width: 1028px;
    }

    .post-create-body {
        padding: 0 0 2px;
        position: relative;

        .post-body__cell {
            position: relative;
            vertical-align: top;

            &.scroll {
                .btn-file {
                    right: 15px;
                }

                .custom-textarea {
                    padding-right: 43px;
                }
            }
        }

        .send-button {
            @include single-transition(all, .15s);
            cursor: pointer;
            display: none;
            font-size: 18px;
            height: 37px;
            line-height: 37px;
            padding-right: 4px;
            text-align: center;
            vertical-align: bottom;
            width: 45px;

            &:active {
                @include opacity(.75);
            }
        }

        .custom-textarea {
            bottom: 0;
            max-height: 162px !important;
            padding-right: 28px;
            padding-top: 8px;
        }

        .textarea-div {
            line-height: 1.5;
            max-height: 163px !important;
            overflow: auto;
            padding-right: 30px;
            padding-top: 8px;
        }

        .btn-file {
            @include opacity(.5);
            @include single-transition(all, .15s);
            font-size: 16px;
            padding: 7px 9px 6px;
            position: absolute;
            right: 0;
            top: 1px;
            z-index: 5;

            svg {
                height: 18px;
                width: 18px;
            }

            &:hover,
            &:active {
                @include opacity(.9);
                box-shadow: none;
            }
        }

        textarea {
            box-shadow: none;
        }
    }

    .post-create-footer {
        @include clearfix;
        font-size: 13px;
        padding: 3px 0 0;
        position: relative;

        .control-label {
            font-weight: normal;
            margin-bottom: 0;
            position: relative;
            top: -5px;

            &.post-error {
              display: inline-block;
              font-size: .85em;
              @include opacity(.55);
              color: rgb(51, 51, 51);
              position: absolute;
              top: 4px;
          }
      }
  }

  .msg-typing {
    @include opacity(.7);
    display: block;
    font-size: .95em;
    height: 20px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
}

.post-list__table {
    display: table;
    height: 100%;
    min-height: 350px;
    table-layout: fixed;
    width: 100%;

    .post-list__content {
        display: table-cell;
        vertical-align: bottom;

        .dropdown-menu {
            &.bottom {
                bottom: 19px;
                top: auto;
            }
        }
    }
}

.post {
    @include legacy-pie-clearfix;
    max-width: 100%;
    padding: 8px .5em 0 1em;
    position: relative;
    word-wrap: break-word;

    &:hover {
        .dropdown,
        .comment-icon__container,
        .flag-icon__container,
        .post__reply,
        .post__remove {
            visibility: visible;
        }

        .permalink-icon {
            visibility: visible;
        }
    }

    &.post--hovered {
        .dropdown,
        .comment-icon__container,
        .post__reply,
        .post__remove,
        .permalink-icon {
            visibility: visible;
        }

        .post__body {
            background: transparent !important;
        }
    }

    &.post--highlight {
        background-color: beige;
    }

    &.post--hide-controls {
        .post__header {
            .col__reply {
                display: none;
            }
        }
    }

    &.post--compact {
        &.post--thread {
            .post__header {
                padding-top: 3px;
            }
        }

        .post__img {
            padding-top: 0;
        }

        .status-wrapper {
            height: 14px;

            &:after {
                bottom: 0;
            }
        }

        blockquote {
            display: inline-block;
            font-size: 1em;
            margin-left: 0;
            padding: 3px 0 0 25px;
            vertical-align: top;

            &:before {
                font-size: 15px;
                left: 4px;
                top: 2px;
            }
        }

        .markdown__heading {
            clear: both;
            margin: 7px 0;
        }

        .post__header {
            height: 22px;
        }

        .post__body {
            background: transparent !important;
            line-height: 1.6;
            margin-top: -1px;
            padding: 3px 0;

            .img-div {
                max-height: 150px;
                max-width: 150px;
            }

            p {
                line-height: inherit;
            }

            p + p {
                margin: 1em 0;
            }

            ol,
            ul {
                clear: both;
                padding-left: 20px;
            }
        }

        .post-image__column {
            @include border-radius(2px);
            font-size: .9em;
            height: 26px;
            line-height: 25px;
            padding: 0 7px;
            width: auto;

            .post-image__thumbnail {
                display: none;
            }

            .post-image__details {
                background: transparent;
                border: none;
                padding: 0;
                width: 100%;

                svg {
                    display: inline-block;
                    height: 13px;
                    margin: 5px 4px 0 0;
                    opacity: .5;
                    position: relative;
                    vertical-align: top;
                    width: 13px;
                }

                > div {
                    display: none;
                }
            }

            .post-image__name {
                @include clearfix;
                display: block;
                margin: 0;
                padding-right: 10px;
                text-overflow: ellipsis;
                white-space: nowrap;

                i {
                    font-size: .9em;
                    margin-right: 5px;
                    opacity: .5;
                }
            }

            a {
                &:hover {
                    text-decoration: none;
                }
            }
        }

        .post__img {
            padding-top: 3px;
            width: 16px;

            img,
            svg {
                height: 20px;
                visibility: hidden;
                width: 9px;
            }
        }
    }

    .post__img:hover {
        cursor: pointer;
    }

    .post--fail {
        position: relative;
    }

    p {
        font-size: .97em;
        line-height: 1.6em;
        margin: 0;
        white-space: pre-wrap;

        &:last-child {
            margin-bottom: .5em;
        }
    }

    .post__header--info {
        padding: 0;
    }

    span {
        p:last-child {
            margin-bottom: .5em;
        }
    }

    &.post--root {
        .comment-icon__container {
            visibility: visible;
        }
    }

    &.post--comment {
        .post__body {
            border-left: 4px solid $gray;
            padding-left: 7px;

            &.mention-comment {
                border-left: 4px solid $yellow;
                border-color: $yellow;
            }
        }
    }

    &.same--root {
        &.same--user {
            padding: 0 .5em 0 1em;

            &:hover,
            &.post--hovered {
                .post__time {
                    @include opacity(.5);
                }
            }

            .flag-icon__container {
                left: 36px;
                margin-left: 5px;
                position: absolute;
                top: 8px;
            }

            .post__img {
                .status-wrapper {
                    display: none;
                }

                img {
                    display: none;
                }
            }

            .post__header {
                height: 0;
                margin: 0;

                .col__name {
                    display: none;
                }

                .col__reply {
                    top: -1px;
                }
            }
        }

        &.post--comment {
            .post__link {
                display: none;
            }

            &.same--user {
                .post__img {
                    img {
                        display: none;
                    }
                }
            }
        }
    }

    &.other--root {
        .comment-icon__container {
            &.icon--show {
                visibility: visible;
            }
        }

        &.post--comment {

            .popover {
                margin-top: 84px;

                > .arrow {
                    top: 21px !important;
                }
            }

            .post__header {
                .col__reply {
                    top: -4px;
                }
            }
        }
    }

    .post__content {
        display: table;
        margin: 0 auto;
        padding: 0 5px;
        position: relative;
        table-layout: fixed;
        width: 100%;

        > div {
            display: table-cell;
            vertical-align: top;
        }
    }

    .center {
        max-width: 1000px;
    }

    .post__header {
        list-style: none;
        margin-bottom: 2px;
        padding: 0;

        li {
            display: inline-block;
            vertical-align: top;
        }

        .col__name {
            font-weight: 600;
            margin-right: 7px;

            .user-popover {
                @include clearfix;
                max-width: 200px;
                text-overflow: ellipsis;
                vertical-align: top;
                white-space: nowrap;
            }

            .colon {
                display: none;
                font-weight: 900;
                margin-left: 2px;
            }
        }

        .col__reply {
            border: 1px solid transparent;
            border-radius: 2px;
            min-width: 70px;
            padding: 2px 5px;
            position: absolute;
            right: 0;
            top: -4px;
            white-space: nowrap;
        }

        .col__remove {
            position: absolute;
            right: 10px;
        }

        .permalink-popover {
            min-width: 0;

            .popover-content {
                padding: 5px;
            }

            .form-control,
            .btn {
                font-size: 13px;
                height: 30px;
                line-height: 30px;
                padding: 0 8px;
            }
        }
    }

    .post__img {
        padding-right: 10px;
        text-align: right;
        width: 53px;

        svg {
            height: 32px;
            width: 32px;
        }

        path {
            fill: inherit;
        }

        img {
            @include border-radius(50px);
            height: 32px;
            vertical-align: inherit;
            width: 32px;
            max-width:none;
        }
    }

    .post__embed-container {
        @include single-transition(max-height, .5, ease);
        display: block;
        max-height: 1000px;
        overflow: hidden;

        &[hidden] {
            max-height: 0;
        }
    }

    .dropdown {
        display: inline-block;
        margin-right: 5px;
        top: -1px;
        visibility: hidden;

        .dropdown-menu {
            left: auto;
            min-width: 130px;
            padding: 2px 0;
            right: 0;
            top: 20px;

            li {
                display: block;
            }

            a {
                padding: 5px 15px;
            }
        }
    }

    .post__dropdown {
        &:after {
            content: '[...]';
            position: relative;
            top: -1px;
        }
    }

    .post__remove {
        @include opacity(.5);
        color: inherit;
        display: inline-block;
        float: right;
        font-family: 'Open Sans', sans-serif;
        font-size: 20px;
        font-weight: 600;
        height: 20px;
        line-height: 20px;
        position: relative;
        right: -10px;
        text-decoration: none;
        vertical-align: top;
        visibility: hidden;
        width: 20px;

        &:hover {
            @include opacity(.8);
        }
    }

    .post__body {
        @include legacy-pie-clearfix;
        padding: .2em .5em;
        width: 100%;
        word-wrap: break-word;

        p {
            display: inline;
        }

        div {
            margin: 0 0 .4em;
        }

        p + p {
            margin: 1.4em 0;
            display: block;
        }

        p:last-of-type {
            display: inline;
        }

        li {
            > p {
                margin-top: 10px;
            }
        }

        img {
            max-height: 400px;
        }

        ul,
        ol {
            font-size: .97em;
            margin-bottom: .4em;
            padding-left: 20px;

            p {
                margin-bottom: 0;
            }

            li {
                ul,
                ol {
                    font-size: 1em;
                    margin: 0;
                    padding: 0 0 0 20px;
                }
            }

            li.list-item--task-list ul,
            li.list-item--task-list ol {
                margin-left: 20px;
            }

            li.list-item--task-list ul {
                padding-left: 0;
            }

            li:not(.list-item--task-list) li.list-item--task-list,
            li:not(.list-item--task-list) li.list-item--task-list ~ li {
                margin-left: -20px;
            }

            li input[type='checkbox']:disabled {
                cursor: default;
                vertical-align: top;
            }
        }

        ul li.list-item--task-list,
        ul li.list-item--task-list ~ li {
            list-style-type: none;
        }

        ul li.list-item--task-list ~ li:not(.list-item--task-list) {
            text-indent: 3px;

            &:before {
                content: '\2022';
                margin-right: 8px;
            }
        }

        .pending-post-actions {
            position: absolute;
            right: 0;
            top: 0;
            padding: 5px 7px;
            background: rgba(0, 0, 0, .7);
            color: white;
            font-size: .9em;

            a {
                color: white;
            }
        }

        span.edited {
            color: #A3A3A3;
            font-size: 0.87em;
        }
    }

    .post__link {
        font-size: 13px;
        margin: 2px 0 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;

        a {
            font-weight: bold;
        }
    }

    .post__embed-visibility {
        -moz-osx-font-smoothing: grayscale;
        -webkit-font-smoothing: antialiased;
        cursor: pointer;
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;
        margin: 0 0 10px;
        text-rendering: auto;

        &.pull-left {
            margin: 5px 5px 0 0;
        }

        &:hover {
            text-decoration: none;
        }

        &:before {
            content: '\f065';
            font-size: 14px;
        }

        &[data-expanded='true']:before {
            content: '\f066';
        }
    }

    .post__time {
        @include opacity(.6);
        font-size: .9em;
    }

    .post-loading-gif {
        height: 10px;
        margin-top: 6px;
        width: 10px;
    }

    .post-fail {
        color: #d58a8a;
    }

    .post-waiting {
        color: #999999;
    }

    .permalink-icon {
        color: $primary-color;
        display: inline-block;
        visibility: hidden;
    }

    .post__reply {
        display: inline-block;
        margin-right: 6px;
        visibility: hidden;

        svg {
            fill: inherit;
            position: relative;
            top: 3px;
            width: 18px;
        }
    }

    .comment-icon__container {
        display: inline-block;
        fill: $primary-color;
        visibility: hidden;

        &:focus {
            outline: none;
        }

        &.icon--visible {
            visibility: visible;
        }

        svg {
            height: 17px;
            width: 17px;
        }

        .comment-icon {
            display: inline-block;
            fill: inherit;
            margin-right: 3px;
            position: relative;
            top: 2px;
        }

        path {
            fill: inherit;
        }
    }

    .flag-icon__container {
        display: inline-block;
        font-size: 12px;
        margin-left: 7px;
        position: relative;
        top: 1px;
        visibility: hidden;

        &.visible {
            visibility: visible;
        }

        path {
            fill: inherit;
        }

        .fa-star-o {
            @include opacity(.8);
        }

        &:focus {
            outline: none;
        }

        &.icon--visible {
            visibility: visible;
        }

    }

    .web-embed-data {
        @include border-radius(2px);
        @include alpha-property(background, $black, 0.05);
        height: 50px;
        overflow: hidden;
        padding: 2px 0 0 10px;
        text-overflow: ellipsis;

        .embed-title {
            color: #555555;
            font-weight: 600;
            margin: 3px 0 1px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .embed-description {
            color: #888888;
            margin: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .embed-link {
            display: none;
        }
    }
}

.bot-indicator {
    border-radius: 2px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    margin: 0 10px 0 -4px;
    padding: 2px 4px;
}

.permalink-text {
    overflow: hidden;
}

.permalink-popover {
    margin-left: 50px !important;
    min-width: 320px;
}

.post-reaction {
    @include user-select(none);
    @include border-radius(3px);
    border: 1px solid $primary-color;
    cursor: pointer;
    display: inline-block;
    font-size: 11px;
    height: 23px;
    padding: 0 4px 0 3px;
    margin-right: 5px;
    margin-bottom: 5px;

    .post-reaction__emoji {
        height: 16px;
        margin: 2px 3px 0 0;
        vertical-align: top;
        width: 16px;
    }

    .post-reaction__count {
        line-height: 10px;
        position: relative;
        top: 3px;
    }

    &--current-user {
        .post-reaction__count {
            font-weight: 600;
        }
    }
}
