:root {
    --primary-orange: #ff7849;
    --primary-light: rgba(255, 120, 73, 0.1);
    --sent-bubble: #2563eb;
    --sent-bubble-hover: #1d4ed8;
    --text-color: #2c3e50;
    --background-color: #ffffff;
    --input-height: 76px;
    --system-message: #f1f5f9;
    --timestamp-color: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    height: 100%;
    color: #64748b;
}

.empty-icon {
    margin-bottom: 1.5rem;
    color: var(--primary-orange);
}

.empty-state h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
    max-width: 300px;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 1rem;
    background-color: #f8fafc;
    -webkit-overflow-scrolling: touch;
}

.message {
    display: flex;
    margin-bottom: 1rem;
    gap: 0.5rem;
    width: 100%;
}

.message.sent {
    justify-content: flex-end;
}

.message.system {
    justify-content: center;
}

.message.system .bubble {
    background: rgba(203, 213, 225, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    color: #64748b;
    max-width: 90%;
    text-align: center;
    box-shadow: none;
    border: 0px solid var(--primary-orange);
}

.message.system .bubble-header {
    display: none;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--primary-orange);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message.sent .avatar {
    display: none;
}

.bubble {
    background: white;
    padding: 0.75rem;
    border-radius: 12px;
    max-width: 80%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--primary-orange);
}

.message.sent .bubble {
    background: var(--primary-orange);
    color: white;
}

.bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.sender {
    font-weight: 500;
}

.message.sent .sender,
.message.sent .time {
    color: rgba(255, 255, 255, 0.9);
}

.time {
    color: #64748b;
    font-size: 0.75rem;
}

.content {
    word-break: break-word;
    white-space: pre-wrap;
}

.input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 0.5rem 1rem;
}

.message-input {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    padding: 0.5rem 0;
    min-height: 24px;
    max-height: 160px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

.message-input:focus {
    outline: none;
}

.send-button {
    background: none;
    border: none;
    color: var(--primary-orange);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button svg {
    width: 24px;
    height: 24px;
}

.send-button:hover {
    color: #e66a3e;
}

.send-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 768px) {
    :root {
        --header-height: 56px;
        --input-height: 72px;
    }

    .messages-container {
        padding: 0.75rem;
    }

    .bubble {
        max-width: 85%;
    }

    .input-container {
        padding: 0.75rem;
    }

    .message-input {
        font-size: 16px;
    }
}