:root {
    --bg: #0a0b0f;
    --bg-gradient: radial-gradient(circle at top, #1a1d2e 0%, #0a0b0f 60%);
    --panel: #16181f;
    --text: #f3f4f6;
    --accent: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --user-bubble: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --ai-bubble: #16181f;
    --border: #23252f;
    --clippy-blue: #4a90e2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* HEADER */
header {
    background: rgba(18, 20, 28, 0.85);
    backdrop-filter: blur(20px);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.clippy-icon {
    font-size: 28px;
    animation: flotar 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes flotar {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

header h1 {
    font-size: 1.15rem;
    font-weight: 700;
}

.gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.25);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* CHAT */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    scroll-behavior: smooth;
}

.message-wrapper {
    display: flex;
    gap: 14px;
    max-width: 85%;
    animation: messageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.user-wrapper {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-wrapper {
    align-self: flex-start;
}

.clippy-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    animation: flotar 3s ease-in-out infinite;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--user-bubble);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.message {
    padding: 14px 18px;
    border-radius: 16px;
    line-height: 1.6;
    font-size: 0.95rem;
    word-wrap: break-word;
}

.user-message {
    background: var(--user-bubble);
    border-bottom-right-radius: 6px;
    color: white;
}

.ai-message {
    background: var(--ai-bubble);
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.ai-message strong { color: #c4b5fd; }

/* INPUT */
.input-area {
    background: rgba(18, 20, 28, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 16px 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.input-box {
    display: flex;
    max-width: 820px;
    width: 100%;
    gap: 10px;
    background: #0f1117;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px 14px;
    align-items: center;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.input-box:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

textarea#userInput {
    flex: 1;
    padding: 6px;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.95rem;
    outline: none;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    font-family: inherit;
}

textarea#userInput::placeholder { color: #6b7280; }

button.send-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.4);
    transition: all 0.2s;
}

button.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
}

.disclaimer {
    font-size: 0.72rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}

.disclaimer span { color: #22c55e; }

/* QUICK ACTIONS */
.quick-actions {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.quick-actions button {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.quick-actions button:hover {
    background: rgba(139, 92, 246, 0.25);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .quick-actions { bottom: 80px; flex-wrap: wrap; justify-content: center; }
    .quick-actions button { font-size: 0.7rem; padding: 6px 10px; }
}
