* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-container {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.chat-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.chat-header .subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

.status-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant {
    align-self: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #ec4899, #f97316);
    color: white;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
}

.message-content {
    background: white;
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message.user .message-content {
    background: linear-gradient(135deg, #ec4899, #f97316);
    color: white;
}

.message.assistant .message-content {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.typing-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: 52px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    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.3; }
    30% { opacity: 1; }
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    padding: 10px 15px;
    transition: border-color 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: #4f46e5;
    background: white;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    resize: none;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
}

.send-button {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-button svg {
    width: 20px;
    height: 20px;
}

.welcome-message {
    text-align: center;
    color: #6b7280;
    padding: 40px 20px;
    font-size: 16px;
}

.welcome-message h3 {
    color: #374151;
    margin-bottom: 10px;
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: 95%;
        height: 95vh;
        border-radius: 15px;
    }

    .chat-header {
        padding: 15px;
    }

    .chat-header h1 {
        font-size: 20px;
    }

    .chat-messages {
        padding: 15px;
    }

    .message {
        max-width: 90%;
    }

    .message-avatar {
        width: 35px;
        height: 35px;
    }

    .message-content {
        padding: 12px 16px;
    }

    .chat-input-container {
        padding: 15px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}