:root {
    --primary-color: #003082;
    --secondary-color: #FFC917;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --border-radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #003082 0%, #0066cc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    height: 90vh;
    max-height: 900px;
}

header {
    background: var(--primary-color);
    color: var(--white);
    padding: 24px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    text-align: center;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header p {
    font-size: 14px;
    opacity: 0.9;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.welcome-message {
    background: var(--white);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.welcome-message h2 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 22px;
}

.welcome-message ul {
    list-style: none;
    margin: 16px 0;
}

.welcome-message li {
    padding: 8px 0;
    font-size: 15px;
}

.welcome-message .example {
    background: var(--bg-color);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    font-style: italic;
    color: #666;
    border-left: 4px solid var(--secondary-color);
}

.message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    line-height: 1.6;
}

.message.user .message-content {
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius) var(--border-radius) 0 var(--border-radius);
}

.message.assistant .message-content {
    background: var(--white);
    color: var(--text-color);
    border-radius: var(--border-radius) var(--border-radius) var(--border-radius) 0;
    border-left: 4px solid var(--secondary-color);
}

.message-content p {
    margin-bottom: 12px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: var(--primary-color);
}

.message.assistant .message-content strong {
    color: var(--primary-color);
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 16px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    width: fit-content;
    box-shadow: var(--shadow);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.input-container {
    padding: 20px 24px;
    background: var(--white);
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: border-color 0.3s;
}

#userInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

#sendButton {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

#sendButton:hover {
    background: #002060;
    transform: scale(1.05);
}

#sendButton:active {
    transform: scale(0.95);
}

#sendButton:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: scale(1);
}

.status {
    padding: 12px 24px;
    text-align: center;
    font-size: 13px;
    color: #666;
    min-height: 40px;
}

.error {
    color: #d32f2f;
    background: #ffebee;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 8px 0;
}

/* Scrollbar styling */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    header {
        border-radius: 0;
        padding: 20px;
    }

    header h1 {
        font-size: 24px;
    }

    .chat-container {
        padding: 16px;
    }

    .message-content {
        max-width: 85%;
    }

    .input-container {
        padding: 16px;
    }
}
