* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

:root {
    --chat-max-width: 1200px;
    --chat-min-width: 320px;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
}

.chat-container {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* For embedded contexts */
.embedded .chat-container {
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    height: 520px;
}

.chat-header {
    padding: 10px 12px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #000000;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-avatar svg {
    width: 18px;
    height: 18px;
    color: white;
}

.bot-details {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bot-name {
    font-weight: 500;
    font-size: 14px;
    color: #202124;
}

.bot-status {
    color: #4CAF50;
    font-size: 28px;
    line-height: 0;
    margin-top: -3px;
}

.header-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    color: #5f6368;
    border-radius: 4px;
}

.action-btn:hover {
    background-color: #f1f3f4;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.message {
    max-width: min(85%, 600px);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}

.message.with-timestamp {
    margin-bottom: 16px;
}

.timestamp {
    position: absolute;
    bottom: -16px;
    font-size: 10px;
    color: #5f6368;
}

.bot-message {
    background-color: #f1f3f4;
    align-self: flex-start;
    color: #202124;
}

.bot-message .timestamp {
    left: 0;
}

.user-message {
    background-color: #0B57D0;
    color: white;
    align-self: flex-end;
}

.user-message .timestamp {
    right: 0;
}

.message-content {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    max-width: min(85%, 600px);
}

.option-button {
    background-color: #f1f3f4;
    border: none;
    padding: 6px 12px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    color: #202124;
    transition: background-color 0.2s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.option-button:hover {
    background-color: #e8eaed;
}

.transfer-notification {
    background-color: #0B57D0;
    color: white;
    padding: 6px 12px;
    text-align: center;
    font-size: 13px;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.transfer-notification.show {
    display: block;
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 12px;
    border-top: 1px solid #E0E0E0;
    background-color: white;
    position: sticky;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
}

#messageInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    outline: none;
    font-size: 16px;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

#messageInput:focus {
    border-color: #000000;
}

#sendButton {
    background-color: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

#sendButton:hover {
    background-color: #F5F5F5;
}

#sendButton svg {
    width: 24px;
    height: 24px;
    fill: #000000;
}

/* Typing Indicator */
.typing-indicator {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #90939980;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Mobile Specific Styles */
@media (max-width: 480px) {
    .chat-container {
        height: 100%;
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .chat-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px;
        background-color: white;
    }

    #messageInput {
        font-size: 16px;
        padding: 8px 12px;
        margin: 0;
    }

    .chat-messages {
        margin-bottom: 60px;
        padding-bottom: 20px;
    }
}

/* For tablets and medium screens */
@media (min-width: 481px) and (max-width: 1024px) {
    .chat-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }

    .message, .options-container {
        max-width: 75%;
    }
}

/* For larger screens */
@media (min-width: 1025px) {
    .chat-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }
}
