
.chat-container {
    background-color: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    flex-direction: column;
    position: fixed;
    bottom: 80px;
    right: 20px;
    height: 90%;
    max-height: 600px;
    width: 100%;
    max-width: 360px;
    z-index: 10000;
    display: none;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 768px) {
    .chat-container {
        height: 600px;
        width: 350px;
    }
}

@media (max-width: 768px) {
    .chat-button {
        position: fixed;
        bottom: 116px !important;
        right: 20px;
        min-width: 56px;
        height: 56px;
        padding: 0 16px 0 12px;
        background-color: #007bff;
        border-radius: 28px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        z-index: 10001;
        user-select: none;
        color: #fff;
    }
}

@media (max-width: 376px) {
    .chat-container {
        right: 0px;
    }

    .chat-button {
        bottom: 50px;
        right: 12px;
        min-width: 48px;
        height: 48px;
        padding: 0 10px 0 8px;
    }

    .chat-button.is-panel-open {
        width: 48px;
        height: 48px;
        min-width: 48px;
        padding: 0;
    }

    .chat-button-text {
        font-size: 0.85rem;
    }

    .chat-button-icon {
        width: 20px;
        height: 20px;
    }
}

#chatContainer .chat-header {
    background-color: #007bff;
    color: #fff;
    height: 52px;
    padding: 0 8px 0 16px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex !important;
    align-items: center;
    justify-content: flex-end !important;
    position: relative;
    flex-shrink: 0;
}

#chatContainer .chat-header-title {
    position: absolute;
    left: 56px;
    right: 88px;
    text-align: center;
    pointer-events: none;
    font-weight: 600;
}

#chatContainer .chat-header-actions {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    margin-left: auto;
    display: inline-flex !important;
    align-items: center;
    gap: 0;
    z-index: 2;
    flex-shrink: 0;
}

#chatContainer .chat-header-minimize,
#chatContainer .chat-header-close {
    position: static !important;
    top: auto !important;
    right: auto !important;
    transform: none !important;
    float: none !important;
    background: transparent;
    border: none;
    color: #fff;
    line-height: 1;
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#chatContainer .chat-header-close {
    font-size: 1.45rem;
    font-weight: 400;
}

#chatContainer .chat-header-minimize:hover,
#chatContainer .chat-header-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.chat-messages {
    flex: 1;
    min-height: 0;
    padding: 16px 14px;
    overflow-y: auto;
    background: #f4f6f8;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot {
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: flex-start;
}

.profile-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 10px;
}

.chat-journey-step {
    display: none !important;
}

.chat-choice-btn {
    text-align: left;
    white-space: normal;
}

.chat-message.bot .chat-message-actions {
    flex-basis: 100%;
    width: 100%;
    margin-top: 8px;
    margin-left: 0;
    padding-left: 52px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-action-link {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    color: #fff !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.chat-action-link:hover {
    filter: brightness(1.08);
}

button.chat-action-link {
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: center;
}

.message-content {
    max-width: 78%;
    padding: 8px 12px 6px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.06);
}

.message-body {
    word-wrap: break-word;
}

.message-time {
    align-self: flex-end;
    font-size: 0.68rem;
    line-height: 1.2;
    opacity: 0.7;
    margin-top: 2px;
    padding-left: 8px;
    white-space: nowrap;
    user-select: none;
}

.chat-message.bot .message-content {
    background-color: #fff;
    color: #1f2933;
    border-top-left-radius: 4px;
}

.chat-message.bot .message-time {
    color: #667781;
    opacity: 1;
}

.chat-message.user .message-content {
    background-color: #007bff;
    color: #fff;
    border-top-right-radius: 4px;
}

.chat-message.user .message-time {
    color: rgba(255, 255, 255, 0.85);
    opacity: 1;
}

.typing-indicator {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    margin: 4px 0 12px;
}

.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 12px 14px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.06);
}

.typing-bubble span {
    width: 7px;
    height: 7px;
    margin: 0;
    background-color: #98a2b3;
    border-radius: 50%;
    animation: typing 1.2s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing {
    0%, 70%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    35% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.chat-input {
    padding: 12px 14px 14px;
    background-color: #fff;
    border-top: 1px solid #e6e8ec;
}

.chat-input textarea {
    width: 100%;
    min-height: 72px;
    resize: none;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    background-color: #f8fafc;
    color: #1f2933;
    box-sizing: border-box;
    font: inherit;
    line-height: 1.4;
}

.chat-input textarea::placeholder {
    color: #999;
}

.chat-input textarea:focus {
    border-color: #bbb;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.12);
}

.chat-input textarea:focus::placeholder {
    color: #aaa;
}

.chat-input button {
    margin-top: 8px;
    width: 100%;
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.chat-input button:hover {
    background-color: #0056b3;
}

.chat-button {
    position: fixed;
    bottom: 75px;
    right: 20px;
    min-width: 56px;
    height: 56px;
    padding: 0 16px 0 12px;
    background-color: #007bff;
    border-radius: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    user-select: none;
    color: #fff;
}

.chat-button-open-state {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-button-icon {
    flex-shrink: 0;
    color: #fff;
}

.chat-button-text {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.chat-button-close-state {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    font-weight: 300;
    color: #fff;
}

.chat-button.is-panel-open {
    width: 56px;
    min-width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
}

.chat-button.is-panel-open .chat-button-open-state {
    display: none;
}

.chat-button.is-panel-open .chat-button-close-state {
    display: flex;
}
