:root {
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --secondary: #ec4899;
    --bg-dark: #0a0a0c;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --user-bubble: linear-gradient(135deg, #6366f1, #8b5cf6);
    --bot-bubble: rgba(255, 255, 255, 0.05);
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Blobs */
.blob {
    position: fixed;
    width: 600px;
    height: 600px;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.2;
    border-radius: 50%;
}

.blob-1 {
    background: var(--primary);
    top: -200px;
    right: -100px;
    animation: move-1 20s infinite alternate;
}

.blob-2 {
    background: var(--secondary);
    bottom: -200px;
    left: -100px;
    animation: move-2 25s infinite alternate;
}

@keyframes move-1 {
    from { transform: translate(0, 0); }
    to { transform: translate(-200px, 200px); }
}

@keyframes move-2 {
    from { transform: translate(0, 0); }
    to { transform: translate(200px, -200px); }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    background: var(--glass);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    margin: 20px;
    position: relative;
    overflow: hidden;
}

/* Header */
.header {
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.logo i {
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.accent {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.model-selector-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

select {
    appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 40px 10px 16px;
    border-radius: 12px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

select:hover {
    background: rgba(255, 255, 255, 0.1);
}

.model-selector-wrapper i {
    position: absolute;
    right: 16px;
    font-size: 0.8rem;
    pointer-events: none;
    color: var(--text-muted);
}

/* Chat Viewport */
.chat-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
}

.chat-viewport::-webkit-scrollbar {
    width: 6px;
}

.chat-viewport::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.welcome-message {
    text-align: center;
    margin-top: 50px;
    animation: fadeIn 1s ease;
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: var(--glass);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    border: 1px solid var(--glass-border);
}

.welcome-icon img {
    width: 50px;
}

.welcome-message h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.welcome-message p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Message Bubbles */
.message {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    animation: slideIn 0.3s ease;
}

.user-message {
    align-self: flex-end;
    background: var(--user-bubble);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.bot-message {
    align-self: flex-start;
    background: var(--bot-bubble);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
}

/* Input Area */
.input-area {
    padding: 24px 32px;
    border-top: 1px solid var(--glass-border);
}

.input-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    gap: 12px;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    max-height: 150px;
    padding-top: 8px;
}

.send-btn {
    background: var(--primary);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
}

.send-btn:hover {
    transform: scale(1.1);
    background: #7c3aed;
    box-shadow: 0 0 15px var(--primary-glow);
}

.send-btn:active {
    transform: scale(0.95);
}

.input-footer {
    text-align: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.anim-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Loading Animation */
.typing {
    display: flex;
    gap: 4px;
}

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

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

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