@import "/_assets/styles/app.less";
@import "/_components/secondary-button/secondary-button.less";
@import "/_components/chat-component/chat-component.less";

html {
    overflow: hidden;
}

.gate {
    height: 100vh;
    .d-flex;
    .flex-align-center;
    .flex-justify-center;
    background-color: #F8F8F8;

    &__card {
        width: 380px;
        max-width: calc(100% - 32px);
        background-color: @white;
        border-radius: 8px;
        padding: 40px 32px;
        text-align: center;
        box-shadow: 0px 4px 12px 0px #0000001a;
    }

    &__logo {
        width: 48px;
        height: 48px;
        margin: 0 auto 16px auto;
        background-position: center;
        background-size: contain;
        background-repeat: no-repeat;
    }

    &__title {
        font-size: @fontSize-extra-large;
        font-weight: @fontWeights-semi-bold;
        color: #202327;
        margin-bottom: 8px;
    }

    &__text {
        color: #565656;
        margin-bottom: 24px;
    }

    &__error {
        margin-bottom: 16px;
    }

    &__button {
        width: 100%;
        height: 44px;
        border-radius: 4px;
        background-color: @primary;
        color: @white;
        font-weight: @fontWeights-bold;
        transition: all 0.3s ease;

        &:hover {
            opacity: 0.85;
        }
    }
}

.app {
    .d-flex;
    height: 100vh;
    background-color: @white;
}

.sidebar {
    width: 320px;
    flex-shrink: 0;
    height: 100%;
    .d-flex;
    .flex-column;
    padding: 20px;
    background-color: @white;
    border-right: 1px solid @light-grey;

    &__header {
        margin-bottom: 20px;
    }

    &__title {
        font-size: @fontSize-large;
        font-weight: @fontWeights-semi-bold;
        color: #202327;
        margin-bottom: 16px;
    }

    &__empty {
        color: #565656;
        padding: 8px 4px;
    }

    &__list {
        flex: 1;
        overflow: auto;
    }

    &__footer {
        .d-flex;
        .flex-align-center;
        .flex-justify-between;
        padding-top: 16px;
        border-top: 1px solid @light-grey;
    }

    &__user {
        color: #202327;
        font-weight: @fontWeights-medium;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-right: 12px;
    }

    &__logout {
        .d-flex;
        .flex-align-center;
        color: #565656;
        flex-shrink: 0;

        .svg-icon__wrapper svg {
            width: 18px;
            margin-right: 6px;
        }

        &:hover {
            color: @error;
        }
    }
}

.thread {
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    border-left: 7px solid transparent;
    transition: all .3s ease;

    &:hover {
        background-color: #F8F8F8;
    }

    &--active {
        background-color: #F8F8F8;
        border-left-color: @primary;
    }

    &__name {
        font-weight: @fontWeights-semi-bold;
        color: #202327;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    &__meta {
        .d-flex;
        .flex-align-center;
        margin-top: 2px;
    }

    &__time {
        font-size: @fontSize-small;
        color: #B3B3B3;
    }

    &__live {
        .d-flex;
        .flex-align-center;
        margin-left: 8px;
        font-size: @fontSize-small;
        color: #565656;
        white-space: nowrap;
    }

    &__live-dot {
        width: 6px;
        height: 6px;
        margin-right: 6px;
        border-radius: 50%;
        background-color: @primary;
        animation: thread-live-pulse 1.2s ease-in-out infinite;
    }
}

@keyframes thread-live-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thread__live-dot {
        animation: none;
    }
}

.main {
    flex: 1;
    min-width: 0;
    height: 100%;

    &__menu {
        display: none;
        margin-right: 12px;

        .svg-icon__wrapper svg {
            width: 24px;
        }
    }

    &__error {
        padding: 8px 40px;
        background-color: @white;
    }

    .conversations,
    .conversation {
        width: 100%;
    }
}

@media (max-width: 650px) {
    .sidebar {
        position: fixed;
        z-index: 10;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        transform: translateX(-100%);
        transition: transform .3s ease;
        box-shadow: 0px 4px 12px 0px #0000004d;

        &--open {
            transform: translateX(0);
        }
    }

    .main__menu {
        display: block;
    }

    .conversation__header {
        padding-left: 16px;
    }
}
