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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f0f0f0;
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-muted: #a3a3a3;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #e5e5e5;
    --input-gradient: linear-gradient(to top, var(--bg-primary) 80%, transparent);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #141414;
        --bg-tertiary: #1a1a1a;
        --text-primary: #fafafa;
        --text-secondary: #a1a1a1;
        --text-muted: #6b6b6b;
        --accent: #3b82f6;
        --accent-hover: #2563eb;
        --border: #2a2a2a;
        --input-gradient: linear-gradient(to top, var(--bg-primary) 80%, transparent);
    }
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    min-height: 0;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 0;
    min-height: 0;
    overflow-y: auto;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 20px;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s ease forwards;
}

.message.user {
    align-items: flex-end;
}

.message.response {
    align-items: flex-start;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: lowercase;
}

.message-content {
    font-size: 16px;
    color: var(--text-primary);
}

.message.user .message-content {
    background: var(--bg-tertiary);
    padding: 12px 24px;
    border-radius: 24px;
    max-width: 80%;
}

.message.response .message-content {
    max-width: 90%;
}

.message-content.typing::after {
    content: '▋';
    animation: blink 0.8s infinite;
    margin-left: 2px;
    color: var(--accent);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.message-content a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.message-content a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.follow-ups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    opacity: 0;
    animation: fadeIn 0.3s ease 0.2s forwards;
}

.follow-up-btn {
    background: var(--bg-tertiary);
    border: 0px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.follow-up-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.follow-up-btn:active {
    transform: scale(0.98);
}

.input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: var(--input-gradient);
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 36px;
    padding: 4px;
    transition: border-color 0.2s ease;
    max-width: 720px;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    border-color: var(--text-muted);
}

.input-field {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    padding: 12px 16px;
    outline: none;
}

.input-field::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: var(--accent);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    margin-right: 4px;
}

.send-btn:hover {
    background: var(--accent-hover);
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.hidden {
    display: none !important;
}

/* Initial state - ChatGPT style centered prompt */
.initial-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    text-align: center;
    padding-bottom: 100px;
}

.initial-state h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.start-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 16px 24px;
    border-radius: 36px;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 600px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.start-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.start-btn::after {
    content: '↵';
    font-size: 14px;
    opacity: 0.5;
}

/* Spacing for fixed input */
.chat-area.active {
    padding-bottom: 100px;
}

@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }

    .chat-area {
        padding: 24px 0;
    }

    .message-content {
        font-size: 15px;
    }

    .follow-up-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .input-area {
        padding: 16px;
    }

    .initial-state h1 {
        font-size: 28px;
    }

    .start-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}