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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    height: 90vh;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 4px solid #ff1493;
}

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

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

.chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

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

.welcome-message {
    text-align: center;
    color: #666;
    margin-top: 40px;
}

.welcome-message h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #ff1493;
}

.welcome-message p {
    font-size: 1.1em;
    color: #999;
}

.message {
    margin-bottom: 15px;
    display: flex;
    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.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 0.95em;
}

.message.user .message-content {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: #e8e8e8;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* Markdown styling */
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
    margin-top: 10px;
    margin-bottom: 8px;
    font-weight: 600;
}

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

.message-content strong {
    font-weight: 700;
}

.message-content em {
    font-style: italic;
}

.message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
}

.message-content ul, .message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

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

.message-content blockquote {
    border-left: 4px solid #ff1493;
    padding-left: 12px;
    margin: 8px 0;
    opacity: 0.8;
}

.message-content a {
    color: #ff1493;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.input-section {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    display: flex;
    gap: 10px;
    min-width: 250px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

#messageInput:focus {
    outline: none;
    border-color: #ff1493;
    box-shadow: 0 0 5px rgba(255, 20, 147, 0.3);
}

.send-btn, .clear-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.send-btn {
    background: linear-gradient(135deg, #ff69b4 0%, #ff1493 100%);
    color: white;
    min-width: 100px;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 20, 147, 0.4);
}

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

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

.clear-btn {
    background: #ff6b6b;
    color: white;
}

.clear-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

.loading {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.5em;
}

.dot {
    animation: bounce 1.4s infinite;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

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

.footer {
    background: #f5f5f5;
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 0.9em;
    border-top: 1px solid #e0e0e0;
}

/* Scrollbar styling */
.chat-box::-webkit-scrollbar {
    width: 8px;
}

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

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

.chat-box::-webkit-scrollbar-thumb:hover {
    background: #ff1493;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }

    .message-content {
        max-width: 85%;
    }

    .input-group {
        min-width: 100%;
    }

    .container {
        height: 100vh;
        border-radius: 0;
    }
}
