/* Modern Minimal BitBot UI */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors - Minimal palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    
    /* Border radius */
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: var(--font);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
#app {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 100%;
    max-height: 700px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* Header */
.header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-weight: 500;
}

/* Messages */
.messages {
    flex: 1;
    padding: var(--space-6);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.messages::-webkit-scrollbar {
    width: 4px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

.welcome-message {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-secondary);
}

.welcome-icon {
    font-size: 2rem;
    margin-bottom: var(--space-4);
}

.welcome-message h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.welcome-message p {
    font-size: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Message bubbles */
.message {
    display: flex;
    gap: var(--space-3);
    animation: slideUp 0.3s ease-out;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.message.bot .message-avatar {
    background: var(--gradient);
    color: white;
}

.message.user .message-avatar {
    background: var(--bg-accent);
    color: var(--text-secondary);
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.message-bubble {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: var(--bg-accent);
    color: var(--text-primary);
    border-radius: var(--radius) var(--radius) var(--radius) 0.25rem;
}

.message.user .message-bubble {
    background: var(--accent);
    color: white;
    border-radius: var(--radius) var(--radius) 0.25rem var(--radius);
    text-align: right;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
    text-align: right;
}

.message.user .message-time {
    text-align: left;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing indicator */
.typing-indicator {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.typing-indicator.show {
    display: block;
    opacity: 1;
}

.typing-bubble {
    background: var(--bg-accent);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius) var(--radius) var(--radius) 0.25rem;
    box-shadow: var(--shadow-sm);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

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

/* Input area */
.input-area {
    padding: var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: var(--space-3);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 100px;
    color: var(--text-primary);
}

#messageInput::placeholder {
    color: var(--text-muted);
}

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

.send-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.send-btn:active:not(:disabled) {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive */
@media (max-width: 768px) {
    #app {
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
        border: none;
    }
    
    .header, .input-area {
        padding: var(--space-4);
    }
    
    .messages {
        padding: var(--space-4);
    }
    
    .message-content {
        max-width: 85%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-accent: #334155;
        --border: #334155;
        --border-light: #475569;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
    }
}
