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

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .info-panel {
        order: -1;
    }
}

/* Chat Section */
.chat-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 700px;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.3em;
    font-weight: 600;
}

.btn-reset {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.btn-reset:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.message-content {
    flex: 1;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

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

.user-message .message-content {
    background: linear-gradient(135deg, #e0e7ff, #ddd6fe);
}

.message-content p {
    line-height: 1.5;
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin-left: 20px;
    margin-top: 8px;
}

.message-content li {
    margin-bottom: 4px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.chat-input-container {
    border-top: 1px solid var(--border-color);
    background: white;
    padding: 16px;
}

.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.quick-action-btn {
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chat-input-form {
    display: flex;
    gap: 12px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s;
}

#messageInput:focus {
    border-color: var(--primary-color);
}

.btn-send {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-icon {
    font-size: 1.2em;
}

/* Info Panel */
.info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.info-card h3 {
    font-size: 1.2em;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.budget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.budget-item:last-child {
    border-bottom: none;
}

.budget-category {
    font-weight: 500;
    color: var(--text-primary);
}

.budget-amount {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.1em;
}

.example-item {
    background: #f3f4f6;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-style: italic;
}

.example-item:last-child {
    margin-bottom: 0;
}

.info-text {
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

