/* Color Palette */
:root {
    --bg-page: #f4f6f9;
    --bg-surface: #ffffff;
    --border-color: #dde1ea;
    --accent-primary: #2563eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bubble-user: #2563eb;
    --error-color: #dc2626;
}

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

html, body {
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 864px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100vh;
}

/* Header Card */
.header-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.header-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.headshot {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
}

.name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.tagline {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 16px;
    border: 1.5px solid var(--accent-primary);
    color: var(--accent-primary);
    background-color: transparent;
    border-radius: 8px;
    font-size: 15px;
    font-family: Inter, sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--accent-primary);
    color: white;
}

/* Intro Text */
.intro-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

/* Chips */
.chips-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.chip {
    padding: 10px 14px;
    border: 1.5px solid var(--accent-primary);
    color: var(--text-secondary);
    background-color: transparent;
    border-radius: 20px;
    font-size: 14px;
    font-family: Inter, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip:hover {
    background-color: var(--accent-primary);
    color: white;
}

.chip:active {
    transform: scale(0.98);
}

/* Chat Window */
.chat-window {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    height: 360px;
    min-height: 360px;
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    margin-bottom: 8px;
}

.message-bubble {
    padding: 12px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
    max-width: 75%;
}

.bot-message {
    justify-content: flex-start;
}

.bot-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    margin-left: 0;
}

.bot-bubble {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-left: 4px solid var(--accent-primary);
    border-radius: 12px 12px 12px 0;
    max-width: 85%;
}

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

.user-bubble {
    background-color: var(--bubble-user);
    color: #ffffff;
    border-radius: 12px 12px 0 12px;
    max-width: 75%;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-left: 4px solid var(--accent-primary);
    border-radius: 12px 12px 12px 0;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Input Container */
.input-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
}

.message-input {
    flex: 1;
    background-color: transparent;
    color: var(--text-primary);
    border: none;
    outline: none;
    font-family: Inter, sans-serif;
    font-size: 15px;
    resize: none;
    padding: 8px;
    max-height: 80px;
    line-height: 1.6;
    caret-color: var(--accent-primary);
}

.message-input::placeholder {
    color: var(--text-secondary);
}

.send-button {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    background-color: #3d7ad6;
}

.send-button:disabled {
    background-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.char-counter {
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
}

.char-counter.warning {
    color: #ffa500;
}

.char-counter.error {
    color: var(--error-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 16px;
        gap: 16px;
    }

    .header-card {
        padding: 16px;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .headshot {
        width: 80px;
        height: 80px;
    }

    .name {
        font-size: 24px;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .chips-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .chip {
        font-size: 13px;
        padding: 8px 12px;
    }

    .chat-window {
        height: 300px;
        min-height: 300px;
        max-height: 300px;
        flex-shrink: 0;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 14px;
    }

    .bot-bubble {
        max-width: 85%;
    }

    .user-bubble {
        max-width: 85%;
    }

    .input-wrapper {
        padding: 6px;
    }

    .message-input {
        padding: 6px;
        font-size: 14px;
    }

    .send-button {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
        gap: 12px;
    }

    .header-card {
        padding: 12px;
    }

    .headshot {
        width: 64px;
        height: 64px;
    }

    .name {
        font-size: 20px;
    }

    .title {
        font-size: 14px;
    }

    .tagline {
        font-size: 13px;
    }

    .intro-text {
        font-size: 14px;
    }

    .chips-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .chip {
        font-size: 12px;
        padding: 8px 10px;
    }
}
