﻿.chat-launcher {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #c0134f;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1100;
}

.chat-launcher-icon {
    font-size: 24px;
    color: #ffffff;
}

.chat-launcher-icon-arrow {
    display: none;
}

.chat-launcher.is-open .chat-launcher-icon-chat {
    display: none;
}

.chat-launcher.is-open .chat-launcher-icon-arrow {
    display: inline-block;
}

.chat-container {
    position: fixed;
    right: 32px;
    bottom: 104px;
    width: 360px;
    max-width: calc(100% - 32px);
    height: 520px;
    max-height: calc(100% - 120px);
    z-index: 1100;
    display: none;
}

    .chat-container.is-open {
        display: flex;
    }

.chat-panel {
    background: #050505;
    border-radius: 24px;
    width: 420px;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
    color: #ffffff;
    font-family: "Josefin Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.chat-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #050505;
}

.chat-header-title {
    font-size: 16px;
    font-weight: 600;
}

.chat-header-icon-button {
    border: none;
    background: transparent;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
}

.chat-header-icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.chat-header-button {
    border: none;
    background: transparent;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    cursor: pointer;
}

    .chat-header-button:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.chat-body {
    flex: 1;
    display: flex;
    position: relative;
}

.chat-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.chat-view-messages {
    display: none;
}

    .chat-view-messages.is-active {
        display: flex;
    }

.chat-view-list.is-active {
    display: flex;
}

.chat-search-wrapper {
    display: flex;
    align-items: center;
    margin-top: 12px;
    margin-right: 16px;
    margin-bottom: 4px;
    margin-left: auto;
    padding: 6px;
    border-radius: 999px;
    background: #f0f0f0;
    width: 36px;
    cursor: text;
    transition: all 0.2s ease;
}

    .chat-search-wrapper.is-open {
        width: calc(100% - 32px);
        margin-left: 16px;
        padding: 6px 12px;
    }

    .chat-search-wrapper.is-hidden {
        display: none;
    }

.chat-search-icon {
    margin-right: 0;
    font-size: 13px;
    color: #707070;
    flex-shrink: 0;
}

.chat-search-wrapper.is-open .chat-search-icon {
    margin-right: 6px;
}

.chat-search-input {
    border: none;
    outline: none;
    background: transparent;
    color: #111111;
    font-size: 13px;
    width: 0;
    opacity: 0;
    pointer-events: none;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.chat-search-wrapper.is-open .chat-search-input {
    width: 100%;
    opacity: 1;
    pointer-events: auto;
}

.chat-search-input::placeholder {
    color: #9f9f9f;
}

.chat-conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px 8px;
}

.chat-conversation-item {
    display: flex;
    align-items: center;
    padding: 8px 8px;
    border-radius: 10px;
    cursor: pointer;
    margin: 2px 4px;
}

    .chat-conversation-item:hover {
        background: #1d1d1d;
    }

    .chat-conversation-item.is-active {
        background: #272727;
    }

.chat-conversation-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
    flex-shrink: 0;
}

    .chat-conversation-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.chat-conversation-content {
    flex: 1;
    min-width: 0;
}

.chat-conversation-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.chat-conversation-last {
    font-size: 12px;
    color: #9f9f9f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conversation-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 6px;
}

.chat-conversation-time {
    font-size: 11px;
    color: #9f9f9f;
    margin-bottom: 4px;
}

.chat-conversation-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #c0134f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    padding: 0 6px;
}

.chat-conversation-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-back-button {
    border: none;
    background: transparent;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 6px;
}

    .chat-back-button:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.chat-conversation-info {
    flex: 1;
    min-width: 0;
}

.chat-contact-name {
    font-size: 14px;
    font-weight: 600;
}

.chat-contact-status {
    font-size: 11px;
    color: #9f9f9f;
}

.chat-conversation-actions {
    display: flex;
    align-items: center;
    margin-left: 4px;
}

.chat-messages-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 4px 12px;
    background: #101010;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-message-row {
    display: flex;
}

    .chat-message-row.me {
        justify-content: flex-end;
    }

    .chat-message-row.other {
        justify-content: flex-start;
    }

.chat-message-bubble {
    max-width: 80%;
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.3;
}

    .chat-message-bubble.me {
        background: #c0134f;
        color: #ffffff;
        border-bottom-right-radius: 4px;
    }

    .chat-message-bubble.other {
        background: #262626;
        color: #ffffff;
        border-bottom-left-radius: 4px;
    }

.chat-message-meta {
    font-size: 10px;
    color: #9f9f9f;
    margin-top: 2px;
    text-align: right;
}

.chat-header-left,
.chat-header-center,
.chat-header-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-center {
    justify-content: center;
}

.chat-input-wrapper {
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #141414;
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.chat-input-toolbar {
    display: flex;
    align-items: center;
}

.chat-input-icon-button {
    border: none;
    background: transparent;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .chat-input-icon-button:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.chat-input-editor {
    flex: 1;
    min-width: 0;
}

.chat-quill-editor {
    background: #101010;
    border-radius: 12px;
    min-height: 44px;
    max-height: 120px;
    padding: 6px 10px;
    overflow-y: auto;
    font-size: 13px;
    color: #ffffff;
}

.chat-input-send {
    display: flex;
    align-items: flex-end;
}

.chat-send-button {
    border: none;
    background: #c0134f;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .chat-send-button:hover {
        filter: brightness(1.1);
    }


.chat-section-title {
    margin: 4px 20px 4px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #b5b5b5;
}

.chat-popup-mode,
.chat-popup-mode body, 
.chat-popup-mode html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #050505;
}

    .chat-popup-mode header,
    .chat-popup-mode footer,
    .chat-popup-mode #page-scroll,
    .chat-popup-mode #cookieBanner {
        display: none !important;
    }

    .chat-popup-mode .environment-banner {
        display: none !important;
    }

    .chat-popup-mode .chat-launcher {
        display: none !important;
    }

    .chat-popup-mode .chat-container {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        bottom: auto;
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        display: flex;
        transform: none;
        z-index: 1100;
    }

    .chat-popup-mode .chat-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

.chat-app-banner {
    display: none;
    width: 100%;
    background: #050505;
    color: #ffffff;
    padding: 10px 14px;
    font-size: 13px;
    font-family: "Josefin Sans", sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-app-banner-icon {
    font-size: 15px;
    color: #c0134f;
    position: relative;
    top: -1px;
}

.chat-app-banner a {
    color: #c0134f;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.chat-popup-mode .chat-app-banner {
    display: flex;
}

.chat-conversation-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #303030;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.chat-message-status {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.85;
}

.chat-conversation-muted {
    font-size: 12px;
    color: #9f9f9f;
}

.chat-conversation-item.is-muted .chat-conversation-name,
.chat-conversation-item.is-muted .chat-conversation-last {
    opacity: 0.7;
}

.chat-context-menu {
    position: fixed;
    min-width: 180px;
    background: #181818;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    padding: 4px 0;
    z-index: 1200;
    display: none;
}

.chat-context-menu-item {
    padding: 8px 14px;
    font-size: 13px;
    color: #ffffff;
    cursor: pointer;
    white-space: nowrap;
}

    .chat-context-menu-item:hover {
        background: #272727;
    }

@media (max-width: 575.98px) {
    .chat-container {
        right: 12px;
        bottom: 82px;
        width: calc(100% - 24px);
        max-height: calc(100% - 96px);
    }

    .chat-launcher {
        right: 12px;
        bottom: 18px;
    }
}
