body {

    margin: 0;
    padding: 0;

    background: #111b21;

    color: #fff;

    font-family: Arial, sans-serif;
}


/*
|--------------------------------------------------------------------------
| DESKTOP APP
|--------------------------------------------------------------------------
*/

.desktop-app {

    display: flex;

    min-height: 100vh;
}


/*
|--------------------------------------------------------------------------
| CHAT CONTAINER
|--------------------------------------------------------------------------
*/

.chat-container {

    flex: 1;

    max-width: 600px;

    margin: 0 auto;

    padding: 78px 14px 100px;

    box-sizing: border-box;

    min-height: 100vh;

    background-image:
        radial-gradient(
            rgba(255,255,255,0.03) 1px,
            transparent 1px
        );

    background-size: 22px 22px;
}


/*
|--------------------------------------------------------------------------
| HEADER
|--------------------------------------------------------------------------
*/

.chat-header {

    position: fixed;

    top: 0;

    left: 50%;

    transform: translateX(-50%);

    width: 100%;

    max-width: 600px;

    height: 64px;

    background: #075e54;

    display: flex;

    align-items: center;

    padding: 0 14px;

    box-sizing: border-box;

    z-index: 999;
}

.chat-header-avatar {

    width: 46px;

    height: 46px;

    border-radius: 50%;

    overflow: hidden;

    margin-right: 12px;

    flex-shrink: 0;
}

.chat-header-avatar img {

    width: 100%;

    display: block;
}

.chat-header-name {

    font-size: 16px;

    font-weight: bold;

    color: #fff;
}

.chat-header-status {

    font-size: 13px;

    color: rgba(255,255,255,0.8);

    margin-top: 3px;
}


/*
|--------------------------------------------------------------------------
| MESSAGE
|--------------------------------------------------------------------------
*/

.message {

    display: flex;

    align-items: flex-start;

    margin-bottom: 14px;

    animation: fadeMessage 0.35s ease;
}

.message-avatar {

    width: 40px;

    height: 40px;

    border-radius: 50%;

    overflow: hidden;

    margin-right: 10px;

    flex-shrink: 0;
}

.message-avatar img {

    width: 100%;

    display: block;
}

.message-content {

    background: #202c33;

    border-radius: 10px;

    padding: 10px 12px;

    line-height: 1.5;

    font-size: 15px;

    color: #e9edef;

    max-width: 100%;

    box-sizing: border-box;
}


/*
|--------------------------------------------------------------------------
| PHOTO
|--------------------------------------------------------------------------
*/

.message-photo {

    width: 100%;

    border-radius: 8px;

    margin-top: 8px;

    display: block;
}


/*
|--------------------------------------------------------------------------
| TYPING
|--------------------------------------------------------------------------
*/

.typing {

    opacity: 0.7;

    font-style: italic;
}

.typing-bubble {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 4px;

    min-width: 52px;

    min-height: 24px;
}

.typing-dot {

    width: 7px;

    height: 7px;

    background: #8696a0;

    border-radius: 50%;

    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) {

    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {

    animation-delay: 0.4s;
}


/*
|--------------------------------------------------------------------------
| INPUT
|--------------------------------------------------------------------------
*/

.fake-input-bar {

    position: fixed;

    bottom: 0;

    left: 50%;

    transform: translateX(-50%);

    width: 100%;

    max-width: 600px;

    background: #202c33;

    padding: 8px 10px;

    box-sizing: border-box;

    z-index: 999;

    display: flex;

    align-items: center;

    gap: 8px;
}

.fake-input-inner {

    flex: 1;

    background: #2a3942;

    border-radius: 26px;

    min-height: 46px;

    display: flex;

    align-items: center;

    padding: 0 14px;

    box-sizing: border-box;
}

.fake-input-placeholder {

    flex: 1;

    color: #8696a0;

    font-size: 15px;

    padding: 0 10px;
}

.fake-input-icon {

    color: #8696a0;

    font-size: 18px;

    user-select: none;
}

.fake-input-icon svg {

    width: 22px;

    height: 22px;

    fill: #8696a0;

    display: block;
}

.fake-send-button {

    width: 46px;

    height: 46px;

    border-radius: 50%;

    background: #00a884;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;
}

.fake-send-button svg {

    width: 22px;

    height: 22px;

    fill: #fff;

    margin-left: 2px;
}


/*
|--------------------------------------------------------------------------
| POPUP
|--------------------------------------------------------------------------
*/

.popup-overlay {

    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.75);

    display: none;

    align-items: center;

    justify-content: center;

    z-index: 9999;
}

.popup-box {

    background: #fff;

    color: #000;

    width: 90%;

    max-width: 380px;

    border-radius: 16px;

    padding: 22px;

    text-align: center;

    box-sizing: border-box;
}

.popup-buttons {

    margin-top: 20px;
}

.popup-buttons button {

    background: #25d366;

    color: #fff;

    border: none;

    border-radius: 8px;

    padding: 12px 18px;

    margin: 5px;

    cursor: pointer;

    font-weight: bold;
}

.register-btn {

    display: inline-block;

    margin-top: 20px;

    padding: 13px 22px;

    background: #25d366;

    color: #fff;

    border-radius: 8px;

    text-decoration: none;

    cursor: pointer;

    font-weight: bold;
}


/*
|--------------------------------------------------------------------------
| SIDEBAR
|--------------------------------------------------------------------------
*/

.desktop-sidebar {

    width: 340px;

    background: #202c33;

    border-right: 1px solid rgba(255,255,255,0.05);

    display: none;

    flex-direction: column;

    overflow-y: auto;
}

.desktop-sidebar-header {

    height: 64px;

    display: flex;

    align-items: center;

    padding: 0 20px;

    background: #202c33;

    color: #e9edef;

    font-size: 18px;

    font-weight: bold;

    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.desktop-chat-item {

    display: flex;

    align-items: center;

    padding: 14px 16px;

    cursor: pointer;

    transition: background 0.2s ease;
}

.desktop-chat-item:hover {

    background: rgba(255,255,255,0.04);
}

.desktop-chat-item.active {

    background: rgba(255,255,255,0.06);
}

.desktop-chat-avatar {

    width: 52px;

    height: 52px;

    border-radius: 50%;

    overflow: hidden;

    margin-right: 14px;

    flex-shrink: 0;
}

.desktop-chat-avatar img {

    width: 100%;

    display: block;
}

.desktop-chat-info {

    overflow: hidden;
}

.desktop-chat-name {

    color: #e9edef;

    font-size: 15px;

    font-weight: bold;

    margin-bottom: 4px;
}

.desktop-chat-preview {

    color: #8696a0;

    font-size: 13px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/*
|--------------------------------------------------------------------------
| LIGHT THEME
|--------------------------------------------------------------------------
*/

body.light-theme {

    background: #e5ddd5;

    color: #111;
}

body.light-theme::before {

    content: '';

    position: fixed;

    top: 64px;

    left: 0;

    right: 0;

    bottom: 62px;

    background-image:
        url('../assets/backgrounds/chat_bg.jpg');

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    z-index: -1;
}

body.light-theme .chat-header {

    background: #f0f2f5;

    border-bottom: 1px solid #d7d7d7;
}

body.light-theme .chat-header-name {

    color: #111;
}

body.light-theme .chat-header-status {

    color: #667781;
}

body.light-theme .message-content {

    background: #ffffff;

    color: #111;

    box-shadow:
        0 1px 1px rgba(0,0,0,0.08);
}

body.light-theme .fake-input-bar {

    background: #f0f2f5;

    border-top: 1px solid #d7d7d7;
}

body.light-theme .fake-input-inner {

    background: #ffffff;
}

body.light-theme .fake-input-placeholder {

    color: #667781;
}

body.light-theme .popup-box {

    background: #ffffff;

    color: #111;
}

body.light-theme .desktop-sidebar {

    background: #ffffff;

    border-right: 1px solid #d7d7d7;
}

body.light-theme .desktop-sidebar-header {

    background: #f0f2f5;

    color: #111;
}

body.light-theme .desktop-chat-name {

    color: #111;
}

body.light-theme .desktop-chat-preview {

    color: #667781;
}


/*
|--------------------------------------------------------------------------
| DESKTOP MODE
|--------------------------------------------------------------------------
*/

@media (min-width: 900px) {

    .desktop-sidebar {

        display: flex;
    }

    .chat-container {

    flex: 1;

    max-width: none;

    width: calc(100% - 340px);

    margin: 0;

    padding-left: 14px;

    padding-right: 14px;
    }

    .chat-header {

        left: 340px;

        transform: none;

        width: calc(100% - 340px);

        max-width: none;
    }

    .fake-input-bar {

        left: 340px;

        transform: none;

        width: calc(100% - 340px);

        max-width: none;
    }

    body.light-theme::before {

        left: 340px;
    }
}


/*
|--------------------------------------------------------------------------
| ANIMATIONS
|--------------------------------------------------------------------------
*/

@keyframes typingBounce {

    0%, 80%, 100% {

        transform: scale(0.7);

        opacity: 0.5;
    }

    40% {

        transform: scale(1);

        opacity: 1;
    }
}

@keyframes fadeMessage {

    from {

        opacity: 0;

        transform: translateY(8px);
    }

    to {

        opacity: 1;

        transform: translateY(0);
    }
}

/*
|--------------------------------------------------------------------------
| UPLOAD
|--------------------------------------------------------------------------
*/

.upload-progress {

    color: #8696a0;

    font-size: 14px;

    min-width: 180px;
}

#chat > .message:first-child {
    margin-top: 50px;
}

