:root {
    --user-color: #ff69b4;
    --bot-color: #4169e1;
    --gradient: linear-gradient(45deg, #ff69b4, #4169e1);
}

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

body {
    min-height: 100vh;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f0f5ff;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    margin: 10px 0;
    scroll-behavior: smooth;
}

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

.messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

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

.message {
    margin: 15px 0;
    padding: 15px 20px;
    border-radius: 25px;
    max-width: 85%;
    position: relative;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 16px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.message:hover {
    transform: translateY(-2px);
}

.user-message {
    background: var(--user-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    animation: slideInRight 0.3s ease;
}

.bot-message {
    background: var(--bot-color);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    animation: slideInLeft 0.3s ease;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding: 0 10px;
    justify-content: flex-end;
}

input {
    flex: 1;
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid #ddd;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(250,255,255,0.9);
    max-width: 80%;
}

input:focus {
    outline: none;
    border-color: var(--user-color);
    box-shadow: 0 0 10px rgba(255,105,180,0.2);
}

button {
    padding: 12px 25px;
    border-radius: 25px;
    background: var(--gradient);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

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

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

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

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

pre {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    position: relative;
    margin: 15px 0;
    overflow-x: auto;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #333;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 12px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 20px;
    backdrop-filter: blur(12px);
    animation: slideUp 1s ease;
}

.content-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.content-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-section p {
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 1.1em;
    color: #555;
}

.disclaimer {
    border-left: 4px solid #ff69b4;
    padding-left: 20px;
    margin: 30px 0;
    background: #fff8fb;
}

/* Markdown Styles */
.message h1, .message h2, .message h3 {
    margin: 1em 0;
    line-height: 1.2;
}

.message h1 { font-size: 1.8em; }
.message h2 { font-size: 1.6em; }
.message h3 { font-size: 1.4em; }

.message ul, .message ol {
    margin: 1em 0;
    padding-left: 2em;
}

.message li {
    margin: 0.5em 0;
}

.message blockquote {
    border-left: 4px solid #ddd;
    margin: 1em 0;
    padding-left: 1em;
    color: #666;
}

.message a {
    color: #fff;
    text-decoration: underline;
    opacity: 0.9;
}

.message a:hover {
    opacity: 1;
}

.message strong { font-weight: bold; }
.message em { font-style: italic; }

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px 8px 0 0;
}

.lang {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #666;
}

pre code.hljs {
    padding: 1em;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
    display: block;
}

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); }
    to { transform: translateY(0); }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .messages {
        height: 60vh;
        padding: 10px;
    }

    input {
        padding: 10px 15px;
        font-size: 15px;
    }

    button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8em;
    }

    .messages {
        height: 50vh;
    }

    .message {
        max-width: 95%;
        font-size: 14px;
        padding: 10px 15px;
    }

    input {
        padding: 8px 12px;
        font-size: 14px;
    }

    button {
        padding: 8px 15px;
        font-size: 13px;
    }
}