:root {
--bg-primary: #050510;
--bg-secondary: rgba(12, 12, 29, 0.85);
--bg-tertiary: #141428;
--bg-glass: rgba(12, 12, 29, 0.6);
--text-primary: #ffffff;
--text-secondary: #8888aa;
--accent-blue: #00b4ff;
--accent-purple: #a855f7;
--accent-pink: #ff2d78;
--accent-green: #00ff88;
--accent-orange: #ff8a00;
--accent-cyan: #00f0ff;
--accent-red: #ff453a;
--border-color: rgba(255, 255, 255, 0.06);
--border-glow: rgba(0, 180, 255, 0.3);
--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
--shadow-glow: 0 0 20px rgba(0, 180, 255, 0.15);
--radius-sm: 8px;
--radius-md: 14px;
--radius-lg: 20px;
--radius-xl: 28px;
--glow-blue: 0 0 20px rgba(0, 180, 255, 0.25);
--glow-purple: 0 0 20px rgba(168, 85, 247, 0.25);
--glow-pink: 0 0 20px rgba(255, 45, 120, 0.25);
--glow-cyan: 0 0 20px rgba(0, 240, 255, 0.25);
--glass-bg: rgba(255, 255, 255, 0.03);
--glass-border: rgba(255, 255, 255, 0.08);
}

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168, 85, 247, 0.3); }

body {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
background: var(--bg-primary);
color: var(--text-primary);
height: 100vh;
overflow: hidden;
}

#particles-bg {
position: fixed;
inset: 0;
z-index: 0;
pointer-events: none;
overflow: hidden;
}

.particle {
position: absolute;
border-radius: 50%;
animation: float-particle linear infinite;
opacity: 0;
}

@keyframes float-particle {
0% { transform: translateY(100vh) scale(0); opacity: 0; }
10% { opacity: 0.6; }
90% { opacity: 0.6; }
100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.particle-connection {
position: absolute;
background: linear-gradient(90deg, rgba(168,85,247,0.1), rgba(0,180,255,0.1));
height: 1px;
transform-origin: left center;
pointer-events: none;
}

.app-container {
display: flex;
height: 100vh;
position: relative;
z-index: 1;
}

.sidebar {
width: 280px;
min-width: 280px;
background: var(--bg-glass);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
border-right: 1px solid var(--glass-border);
display: flex;
flex-direction: column;
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}

.sidebar::after {
content: "";
position: absolute;
right: -1px;
top: 0;
bottom: 0;
width: 1px;
background: linear-gradient(180deg, rgba(0,240,255,0.15), rgba(168,85,247,0.15), rgba(255,45,120,0.1), transparent);
pointer-events: none;
}

.sidebar-header {
padding: 20px;
border-bottom: 1px solid var(--border-color);
}

.new-chat-btn {
width: 100%;
padding: 12px 16px;
background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
background-size: 200% 200%;
animation: gradient-shift 3s ease infinite;
border: 1px solid rgba(255, 45, 120, 0.3);
border-radius: var(--radius-md);
color: white;
font-weight: 600;
font-size: 0.95rem;
cursor: pointer;
display: flex;
align-items: center;
gap: 10px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}

.new-chat-btn::before {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15), transparent);
transform: translateX(-100%);
transition: transform 0.5s ease;
}

.new-chat-btn:hover::before { transform: translateX(100%); }

.new-chat-btn:hover {
transform: translateY(-2px);
box-shadow: var(--glow-pink), var(--glow-purple);
filter: brightness(1.1);
}

.new-chat-btn:active { transform: translateY(0) scale(0.98); }

@keyframes gradient-shift {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}

.chat-history {
flex: 1;
overflow-y: auto;
padding: 10px;
}

.chat-item {
padding: 12px 16px;
border-radius: var(--radius-md);
margin-bottom: 6px;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
display: flex;
align-items: center;
gap: 8px;
position: relative;
overflow: hidden;
}

.chat-item::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(90deg, rgba(168,85,247,0.06), transparent);
transform: translateX(-100%);
transition: transform 0.4s ease;
}

.chat-item:hover::after { transform: translateX(0); }

.chat-item::before {
content: "";
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 0;
background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
border-radius: 2px;
transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-item.active::before { height: 60%; }

.chat-item:hover { background: rgba(255, 255, 255, 0.04); }

.chat-item.active {
background: rgba(168, 85, 247, 0.1);
color: var(--accent-purple);
}

.chat-item:hover .delete-btn { opacity: 1; }

.delete-btn {
opacity: 0;
transition: all 0.2s;
padding: 4px 8px !important;
font-size: 1.2rem !important;
line-height: 1;
}

.delete-btn:hover {
color: var(--accent-pink) !important;
background: rgba(255, 45, 120, 0.1) !important;
}

.sidebar-footer {
padding: 20px;
border-top: 1px solid var(--border-color);
}

.model-selector { position: relative; z-index: 1000; }

.model-label {
font-size: 0.7rem;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.08em;
margin-bottom: 8px;
font-weight: 700;
}

.model-btn {
width: 100%;
padding: 10px 14px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid var(--glass-border);
border-radius: var(--radius-md);
color: var(--text-primary);
font-size: 0.9rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
transition: all 0.2s ease;
}

.model-btn:hover { border-color: var(--accent-purple); box-shadow: var(--glow-purple); }

.model-dropdown {
display: none;
position: absolute;
bottom: calc(100% + 8px);
left: 0;
right: 0;
background: rgba(12, 12, 29, 0.95);
backdrop-filter: blur(24px);
border: 1px solid var(--glass-border);
border-radius: var(--radius-lg);
padding: 8px;
box-shadow: var(--shadow-lg);
max-height: 300px;
overflow-y: auto;
z-index: 1000;
min-width: 200px;
}

.model-dropdown.active {
display: block;
animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.model-option {
padding: 12px 16px;
border-radius: var(--radius-sm);
cursor: pointer;
transition: all 0.2s ease;
border: 1px solid transparent;
}

.model-option:hover {
background: rgba(168, 85, 247, 0.08);
border-color: rgba(168, 85, 247, 0.2);
}

.model-option.active {
background: rgba(168, 85, 247, 0.15);
border-color: var(--accent-purple);
color: var(--accent-cyan);
}

.model-option.unavailable { opacity: 0.4; pointer-events: none; }

.model-group-label {
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--text-secondary);
padding: 8px 16px 4px;
font-weight: 700;
}

.model-note {
font-size: 0.72rem;
color: var(--text-secondary);
padding: 8px 16px;
border-top: 1px solid var(--border-color);
margin-top: 4px;
opacity: 0.7;
line-height: 1.4;
}

.model-option-content { display: flex; flex-direction: column; gap: 4px; }
.model-option strong { font-size: 0.95rem; font-weight: 600; }
.model-option small { font-size: 0.75rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.05em; }

.main-content {
flex: 1;
display: flex;
flex-direction: column;
background: var(--bg-primary);
}

.top-bar {
padding: 16px 24px;
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
gap: 12px;
background: var(--bg-glass);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
position: relative;
z-index: 10;
}

.top-bar::after {
content: "";
position: absolute;
bottom: -1px;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-purple), var(--accent-pink), transparent);
opacity: 0.4;
animation: border-flow 4s linear infinite;
background-size: 200% 100%;
}

@keyframes border-flow {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}

.menu-toggle {
background: none;
border: none;
color: var(--text-secondary);
cursor: pointer;
padding: 8px;
border-radius: var(--radius-sm);
transition: all 0.2s ease;
}

.menu-toggle:hover {
background: rgba(255, 255, 255, 0.05);
color: var(--text-primary);
}

.chat-title {
flex: 1;
font-size: 1.1rem;
font-weight: 600;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

.smart-mode-indicator {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
background: rgba(0, 255, 136, 0.06);
border: 1px solid rgba(0, 255, 136, 0.15);
border-radius: var(--radius-md);
font-size: 0.8rem;
color: var(--accent-green);
cursor: help;
transition: all 0.2s ease;
font-weight: 600;
position: relative;
}

.smart-mode-indicator:hover {
background: rgba(0, 255, 136, 0.1);
border-color: rgba(0, 255, 136, 0.3);
box-shadow: 0 0 16px rgba(0, 255, 136, 0.15);
}

.smart-mode-indicator svg { animation: pulse-smart 2s infinite; }

@keyframes pulse-smart {
0%, 100% { opacity: 0.5; transform: scale(1); }
50% { opacity: 1; transform: scale(1.1); }
}

.smart-mode-indicator::after {
content: "AI auto-detects when to search or think deeply";
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%) translateY(-8px);
background: rgba(14, 14, 30, 0.95);
backdrop-filter: blur(12px);
color: var(--text-primary);
padding: 8px 12px;
border-radius: var(--radius-sm);
font-size: 0.75rem;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: all 0.2s ease;
border: 1px solid var(--glass-border);
box-shadow: var(--shadow-md);
}

.smart-mode-indicator:hover::after {
opacity: 1;
transform: translateX(-50%) translateY(-4px);
}

.nova-prime-toggle {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
background: rgba(255, 138, 0, 0.06);
border: 1px solid rgba(255, 138, 0, 0.15);
border-radius: var(--radius-md);
font-size: 0.78rem;
font-weight: 700;
color: var(--accent-orange);
cursor: pointer;
transition: all 0.3s ease;
letter-spacing: 0.02em;
position: relative;
overflow: hidden;
}

.nova-prime-toggle::before {
content: "";
position: absolute;
inset: -2px;
background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink), var(--accent-orange));
background-size: 300% 300%;
border-radius: var(--radius-md);
z-index: -1;
opacity: 0;
transition: opacity 0.3s ease;
animation: gradient-shift 3s ease infinite;
}

.nova-prime-toggle.active::before { opacity: 1; }

.nova-prime-toggle.active {
background: rgba(255, 138, 0, 0.12);
border-color: var(--accent-orange);
box-shadow: 0 0 20px rgba(255, 138, 0, 0.25);
animation: nova-glow 2s ease-in-out infinite;
}

.nova-prime-toggle svg { transition: transform 0.3s ease; }
.nova-prime-toggle:hover svg { transform: rotate(15deg) scale(1.1); }

@keyframes nova-glow {
0%, 100% { box-shadow: 0 0 12px rgba(255, 138, 0, 0.15); }
50% { box-shadow: 0 0 24px rgba(255, 138, 0, 0.35), 0 0 48px rgba(255, 45, 120, 0.1); }
}

.search-toggle {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--glass-border);
border-radius: var(--radius-md);
font-size: 0.82rem;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.2s ease;
}

.search-toggle:hover { border-color: rgba(0, 240, 255, 0.3); }

.search-toggle.active {
background: rgba(0, 240, 255, 0.08);
border-color: rgba(0, 240, 255, 0.3);
color: var(--accent-cyan);
box-shadow: var(--glow-cyan);
}

.user-menu { position: relative; }

.user-btn {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
background-size: 200% 200%;
animation: gradient-shift 4s ease infinite;
border: none;
color: white;
font-weight: 700;
font-size: 0.85rem;
cursor: pointer;
transition: all 0.3s ease;
}

.user-btn:hover {
transform: scale(1.1);
box-shadow: var(--glow-purple), var(--glow-pink);
}

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

.user-dropdown {
display: none;
position: absolute;
top: calc(100% + 8px);
right: 0;
background: rgba(12, 12, 29, 0.95);
backdrop-filter: blur(24px);
border: 1px solid var(--glass-border);
border-radius: var(--radius-lg);
padding: 8px;
min-width: 220px;
box-shadow: var(--shadow-lg);
z-index: 1000;
}

.user-dropdown.active { display: block; animation: slideDown 0.2s cubic-bezier(0.4, 0, 0.2, 1); }

@keyframes slideDown {
from { opacity: 0; transform: translateY(-8px); }
to { opacity: 1; transform: translateY(0); }
}

.user-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-email { font-size: 0.75rem; color: var(--text-secondary); }
.user-dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

.user-dropdown-item {
display: block;
width: 100%;
padding: 8px 12px;
border: none;
background: none;
color: var(--text-primary);
font-size: 0.85rem;
text-align: left;
text-decoration: none;
border-radius: var(--radius-sm);
cursor: pointer;
transition: background 0.15s;
}

.user-dropdown-item:hover { background: rgba(168, 85, 247, 0.08); }

.chat-container {
flex: 1;
overflow-y: auto;
padding: 24px;
scroll-behavior: smooth;
}

.messages {
max-width: 800px;
margin: 0 auto;
}

.message {
margin-bottom: 24px;
animation: messageIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message.user {
display: flex;
justify-content: flex-end;
margin-bottom: 24px;
}

.user-message {
max-width: 70%;
margin-left: auto;
animation: userBubble 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message.user .message-content {
background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
background-size: 200% 200%;
animation: gradient-shift 4s ease infinite;
padding: 14px 18px;
border-radius: var(--radius-lg);
color: white;
line-height: 1.6;
box-shadow: 0 4px 15px rgba(255, 45, 120, 0.2);
}

.message.assistant {
display: flex;
gap: 12px;
animation: aiBubble 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message-avatar {
width: 36px;
height: 36px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
background-size: 200% 200%;
animation: gradient-shift 4s ease infinite;
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
font-size: 0.9rem;
flex-shrink: 0;
box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
transition: transform 0.3s ease;
}

.message-avatar:hover { transform: scale(1.1) rotate(5deg); }

.message-body {
flex: 1;
max-width: 800px;
position: relative;
}

.message-actions {
display: flex;
gap: 4px;
opacity: 0;
transition: all 0.2s ease;
position: absolute;
top: -12px;
right: 8px;
z-index: 5;
background: rgba(12, 12, 29, 0.9);
backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: var(--radius-sm);
padding: 4px;
}

.message-body:hover .message-actions { opacity: 1; }

.action-btn {
width: 28px;
height: 28px;
background: none;
border: 1px solid transparent;
border-radius: 6px;
color: var(--text-secondary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.15s ease;
}

.action-btn:hover {
background: rgba(0, 240, 255, 0.08);
border-color: rgba(0, 240, 255, 0.2);
color: var(--accent-cyan);
}

.action-btn.copied {
color: var(--accent-green);
background: rgba(0, 255, 136, 0.1);
border-color: rgba(0, 255, 136, 0.2);
}

.action-btn.regenerate:hover {
color: var(--accent-purple);
background: rgba(168, 85, 247, 0.1);
border-color: rgba(168, 85, 247, 0.2);
}

.copy-btn {
position: absolute;
top: 8px;
right: 8px;
width: 32px;
height: 32px;
background: rgba(255, 255, 255, 0.05);
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
color: var(--text-secondary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: all 0.2s ease;
z-index: 5;
}

.message-body:hover .copy-btn { opacity: 1; }

.copy-btn:hover {
background: rgba(0, 240, 255, 0.08);
border-color: var(--accent-cyan);
color: var(--accent-cyan);
}

.copy-btn.copied {
background: rgba(0, 255, 136, 0.15);
border-color: var(--accent-green);
color: var(--accent-green);
}

.message-content { line-height: 1.6; font-size: 0.95rem; }
.message-content p { margin-bottom: 12px; }
.message-content p:last-child { margin-bottom: 0; }

.message-content pre {
background: var(--bg-tertiary);
border: 1px solid var(--glass-border);
padding: 16px;
border-radius: var(--radius-md);
overflow-x: auto;
margin: 12px 0;
position: relative;
}

.message-content pre::before {
content: "Code";
position: absolute;
top: 4px;
right: 8px;
font-size: 0.65rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--accent-purple);
opacity: 0.5;
}

.message-content code {
font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
font-size: 0.9em;
}

.message-content ul, .message-content ol { margin: 12px 0; padding-left: 24px; }
.message-content li { margin-bottom: 8px; }
.message-content h1, .message-content h2, .message-content h3 { margin: 16px 0 8px; font-weight: 700; }
.message-content h1 { font-size: 1.4rem; }
.message-content h2 { font-size: 1.2rem; }
.message-content h3 { font-size: 1.05rem; }
.message-content hr { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }

.message-content table {
width: 100%;
border-collapse: collapse;
margin: 12px 0;
font-size: 0.9rem;
border: 1px solid var(--border-color);
border-radius: var(--radius-sm);
overflow: hidden;
}

.message-content th, .message-content td { padding: 8px 12px; border: 1px solid var(--border-color); text-align: left; }
.message-content th { background: var(--bg-tertiary); font-weight: 600; }
.message-content tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.message-content em { opacity: 0.85; }

.demo-limit { text-align: center; padding: 32px 20px; animation: fadeIn 0.5s ease; }
.demo-limit h3 { font-size: 1.3rem; margin-bottom: 8px; color: var(--accent-orange); }
.demo-limit p { color: var(--text-secondary); font-size: 0.95rem; }

.demo-banner {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
background: rgba(255, 138, 0, 0.06);
border: 1px solid rgba(255, 138, 0, 0.2);
border-radius: var(--radius-md);
font-size: 0.8rem;
color: var(--accent-orange);
margin-bottom: 12px;
animation: bannerPulse 3s ease-in-out infinite;
}

@keyframes bannerPulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 0, 0); }
50% { box-shadow: 0 0 16px rgba(255, 138, 0, 0.15); }
}

.demo-banner a { color: var(--accent-orange); font-weight: 600; text-decoration: underline; }

.demo-welcome-banner {
display: flex;
align-items: center;
gap: 10px;
padding: 14px 18px;
background: linear-gradient(135deg, rgba(255, 138, 0, 0.06), rgba(168, 85, 247, 0.04));
border: 1px solid rgba(255, 138, 0, 0.2);
border-radius: var(--radius-md);
margin: 0 auto 20px;
max-width: 500px;
font-size: 0.9rem;
color: var(--text-secondary);
animation: slideIn 0.5s ease 0.2s both;
}

.demo-welcome-banner svg { color: var(--accent-orange); flex-shrink: 0; }
.demo-welcome-banner a { margin-left: auto; flex-shrink: 0; }

.demo-upgrade-btn {
display: inline-block;
padding: 8px 18px;
background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
background-size: 200% 200%;
animation: gradient-shift 3s ease infinite;
color: white;
font-size: 0.8rem;
font-weight: 700;
border-radius: var(--radius-sm);
text-decoration: none;
transition: all 0.2s ease;
white-space: nowrap;
}

.demo-upgrade-btn:hover {
transform: translateY(-1px);
box-shadow: var(--glow-pink), var(--glow-purple);
}

.input-area {
padding: 24px;
background: var(--bg-primary);
border-top: 1px solid var(--border-color);
position: relative;
}

.input-area::before {
content: "";
position: absolute;
top: -1px;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.25), rgba(0, 240, 255, 0.25), transparent);
}

.input-wrapper {
max-width: 800px;
margin: 0 auto 12px;
display: flex;
gap: 12px;
background: var(--glass-bg);
backdrop-filter: blur(12px);
border: 2px solid var(--glass-border);
border-radius: var(--radius-lg);
padding: 8px 16px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}

.input-wrapper:focus-within {
border-color: var(--accent-purple);
box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.08), var(--glow-purple);
}

.input-wrapper.voice-active {
border-color: var(--accent-pink);
box-shadow: 0 0 0 4px rgba(255, 45, 120, 0.08), var(--glow-pink);
animation: input-voice-glow 1.5s ease-in-out infinite;
}

@keyframes input-voice-glow {
0%, 100% { box-shadow: 0 0 0 4px rgba(255, 45, 120, 0.08), var(--glow-pink); }
50% { box-shadow: 0 0 0 6px rgba(255, 45, 120, 0.12), 0 0 30px rgba(255, 45, 120, 0.2); }
}

.input-wrapper textarea {
flex: 1;
background: none;
border: none;
color: var(--text-primary);
font-size: 1rem;
resize: none;
outline: none;
max-height: 200px;
font-family: inherit;
}

.voice-btn {
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid var(--glass-border);
border-radius: var(--radius-md);
color: var(--text-secondary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
flex-shrink: 0;
position: relative;
}

.voice-btn:hover {
border-color: var(--accent-purple);
color: var(--accent-purple);
background: rgba(168, 85, 247, 0.08);
}

.voice-btn.recording {
background: rgba(255, 45, 120, 0.12);
border-color: var(--accent-pink);
color: var(--accent-pink);
animation: voice-pulse 1s ease-in-out infinite;
}

@keyframes voice-pulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 120, 0.3); }
50% { box-shadow: 0 0 0 8px rgba(255, 45, 120, 0); }
}

.voice-btn .voice-wave {
position: absolute;
inset: -4px;
border-radius: var(--radius-md);
border: 2px solid var(--accent-pink);
opacity: 0;
}

.voice-btn.recording .voice-wave { animation: voice-wave 1s ease-out infinite; }

@keyframes voice-wave {
0% { transform: scale(1); opacity: 0.5; }
100% { transform: scale(1.5); opacity: 0; }
}

.send-btn {
width: 40px;
height: 40px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
background-size: 200% 200%;
animation: gradient-shift 3s ease infinite;
border: none;
border-radius: var(--radius-md);
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
flex-shrink: 0;
position: relative;
overflow: hidden;
}

.send-btn::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(135deg, transparent, rgba(255,255,255,0.15), transparent);
transform: translateX(-100%);
transition: transform 0.4s ease;
}

.send-btn:hover:not(:disabled)::after { transform: translateX(100%); }

.send-btn:hover:not(:disabled) {
transform: scale(1.05);
box-shadow: var(--glow-cyan), var(--glow-purple);
}

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

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

.send-btn.streaming {
animation: gradient-shift 1s ease infinite, send-spin 1.5s linear infinite;
}

@keyframes send-spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

.input-note {
max-width: 800px;
margin: 0 auto;
text-align: center;
font-size: 0.78rem;
color: var(--text-secondary);
}

.input-note kbd {
display: inline-block;
padding: 1px 6px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid var(--glass-border);
border-radius: 4px;
font-family: inherit;
font-size: 0.72rem;
color: var(--text-secondary);
margin: 0 2px;
}

.sidebar-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(5, 5, 16, 0.6);
backdrop-filter: blur(8px);
z-index: 99;
opacity: 0;
transition: opacity 0.3s ease;
}

.sidebar-overlay.active { display: block; opacity: 1; }

.mode-badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
border-radius: 20px;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
border: 1px solid transparent;
animation: badgeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes badgeIn {
from { opacity: 0; transform: scale(0.9); }
to { opacity: 1; transform: scale(1); }
}

.mode-badge.search {
background: rgba(0, 180, 255, 0.1);
border-color: rgba(0, 180, 255, 0.25);
color: var(--accent-blue);
}

.mode-badge.thinking {
background: rgba(168, 85, 247, 0.1);
border-color: rgba(168, 85, 247, 0.25);
color: var(--accent-purple);
}

.mode-badge.quick {
background: rgba(0, 255, 136, 0.1);
border-color: rgba(0, 255, 136, 0.25);
color: var(--accent-green);
}

.mode-badge.critique { background: rgba(0, 255, 136, 0.1); border-color: rgba(0, 255, 136, 0.25); }

.pipeline-badges { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.typing {
display: flex;
gap: 6px;
padding: 12px 0;
align-items: center;
}

.typing span {
width: 8px;
height: 8px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
border-radius: 50%;
animation: typing 1.4s infinite;
}

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

@keyframes typing {
0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
30% { transform: translateY(-10px); opacity: 1; }
}

.thinking-dots {
display: inline-flex;
gap: 4px;
margin-left: 8px;
}

.thinking-dots span {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent-purple);
animation: think-dot 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes think-dot {
0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
40% { transform: scale(1.2); opacity: 1; }
}

.skeleton-line {
height: 14px;
background: linear-gradient(90deg, var(--bg-tertiary) 25%, rgba(168,85,247,0.06) 50%, var(--bg-tertiary) 75%);
background-size: 200% 100%;
animation: skeleton-shimmer 1.5s infinite;
border-radius: 4px;
margin-bottom: 10px;
}

.skeleton-line:last-child { width: 60%; }

@keyframes skeleton-shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}

.welcome-message {
text-align: center;
padding: 60px 40px;
max-width: 800px;
margin: 0 auto;
animation: welcomeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes welcomeIn {
from { opacity: 0; transform: translateY(40px); }
to { opacity: 1; transform: translateY(0); }
}

.welcome-icon {
width: 100px;
height: 100px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
background-size: 300% 300%;
animation: gradient-shift 3s ease infinite, welcomePulse 3s ease-in-out infinite;
border-radius: 30px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 30px;
box-shadow: 0 0 40px rgba(168, 85, 247, 0.3), 0 0 80px rgba(0, 240, 255, 0.1);
position: relative;
}

.welcome-icon::after {
content: "";
position: absolute;
inset: -8px;
border-radius: 34px;
border: 2px solid rgba(168, 85, 247, 0.2);
animation: icon-ring 3s ease-in-out infinite;
}

@keyframes icon-ring {
0%, 100% { transform: scale(1); opacity: 0.3; }
50% { transform: scale(1.1); opacity: 0; }
}

@keyframes welcomePulse {
0%, 100% { box-shadow: 0 0 30px rgba(168, 85, 247, 0.2), 0 0 60px rgba(0, 240, 255, 0.1); transform: scale(1); }
50% { box-shadow: 0 0 50px rgba(168, 85, 247, 0.4), 0 0 80px rgba(0, 240, 255, 0.2), 0 0 100px rgba(255, 45, 120, 0.1); transform: scale(1.02); }
}

.welcome-message h2 {
font-size: 2rem;
margin-bottom: 10px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple), var(--accent-pink));
background-size: 200% 200%;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
font-weight: 700;
animation: gradient-shift 4s ease infinite;
}

.welcome-message h2 .typing-cursor {
display: inline-block;
width: 3px;
height: 1.2em;
background: var(--accent-cyan);
margin-left: 4px;
animation: blink-cursor 1s step-end infinite;
vertical-align: text-bottom;
}

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

.welcome-message p {
color: var(--text-secondary);
margin-bottom: 30px;
font-size: 1.1rem;
animation: fadeInUp 0.6s ease 0.3s both;
}

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

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

.suggestion-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 12px;
max-width: 600px;
margin: 0 auto;
}

.suggestion-card {
background: var(--glass-bg);
backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: var(--radius-md);
padding: 16px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
text-align: left;
position: relative;
overflow: hidden;
opacity: 0;
animation: cardStagger 0.4s ease forwards;
}

.suggestion-card:nth-child(1) { animation-delay: 0.5s; }
.suggestion-card:nth-child(2) { animation-delay: 0.6s; }
.suggestion-card:nth-child(3) { animation-delay: 0.7s; }
.suggestion-card:nth-child(4) { animation-delay: 0.8s; }

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

.suggestion-card::before {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(135deg, rgba(168, 85, 247, 0.06), rgba(0, 240, 255, 0.06));
opacity: 0;
transition: opacity 0.3s ease;
}

.suggestion-card:hover::before { opacity: 1; }

.suggestion-card:hover {
border-color: rgba(168, 85, 247, 0.3);
transform: translateY(-4px) scale(1.02);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), var(--glow-purple);
}

.suggestion-card:active { transform: translateY(-2px) scale(0.98); }

.suggestion-card h4 { font-size: 0.95rem; margin-bottom: 4px; color: var(--text-primary); position: relative; }
.suggestion-card p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; position: relative; }

.search-sources {
background: var(--glass-bg);
backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: var(--radius-md);
margin-bottom: 16px;
overflow: hidden;
animation: searchSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes searchSlideIn {
from { opacity: 0; transform: translateY(-10px); max-height: 0; }
to { opacity: 1; transform: translateY(0); max-height: 300px; }
}

.search-sources-header {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
background: rgba(0, 180, 255, 0.06);
border-bottom: 1px solid var(--border-color);
font-size: 0.8rem;
font-weight: 600;
color: var(--accent-blue);
}

.search-count { margin-left: auto; font-weight: 400; font-size: 0.75rem; opacity: 0.8; }

.search-sources-list { max-height: 180px; overflow-y: auto; padding: 6px; }

.search-source-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 10px;
border-radius: var(--radius-sm);
text-decoration: none;
color: var(--text-primary);
transition: all 0.15s ease;
border: 1px solid transparent;
animation: sourceFadeIn 0.3s ease both;
}

.search-source-item:nth-child(1) { animation-delay: 0.05s; }
.search-source-item:nth-child(2) { animation-delay: 0.1s; }
.search-source-item:nth-child(3) { animation-delay: 0.15s; }
.search-source-item:nth-child(4) { animation-delay: 0.2s; }
.search-source-item:nth-child(5) { animation-delay: 0.25s; }

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

.search-source-item:hover {
background: rgba(0, 180, 255, 0.06);
border-color: rgba(0, 180, 255, 0.12);
}

.source-index { font-size: 0.7rem; font-weight: 700; color: var(--accent-cyan); min-width: 26px; opacity: 0.8; }
.source-info { display: flex; flex-direction: column; gap: 2px; overflow: hidden; flex: 1; }
.source-title { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.source-domain { font-size: 0.7rem; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }

.source-type-badge {
font-size: 0.6rem;
padding: 1px 5px;
border-radius: 4px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.03em;
}

.source-type-badge.news { background: rgba(255, 138, 0, 0.15); color: var(--accent-orange); border: 1px solid rgba(255, 138, 0, 0.3); }

.citation-link {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 3px;
font-size: 0.65rem;
font-weight: 700;
line-height: 1;
background: rgba(0, 240, 255, 0.1);
color: var(--accent-cyan);
border-radius: 4px;
text-decoration: none;
vertical-align: super;
margin: 0 1px;
transition: all 0.15s ease;
border: 1px solid rgba(0, 240, 255, 0.2);
}

.citation-link:hover {
background: rgba(0, 240, 255, 0.2);
border-color: var(--accent-cyan);
transform: scale(1.15);
box-shadow: var(--glow-cyan);
}

.scroll-fab {
position: fixed;
bottom: 120px;
right: 40px;
width: 44px;
height: 44px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
background-size: 200% 200%;
animation: gradient-shift 3s ease infinite;
border: none;
border-radius: 50%;
color: white;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
z-index: 50;
opacity: 0;
transform: translateY(20px) scale(0.8);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
pointer-events: none;
}

.scroll-fab.visible {
opacity: 1;
transform: translateY(0) scale(1);
pointer-events: auto;
}

.scroll-fab:hover {
transform: translateY(-2px) scale(1.1);
box-shadow: 0 8px 24px rgba(168, 85, 247, 0.4), var(--glow-cyan);
}

.scroll-fab:active { transform: scale(0.95); }

.scroll-fab-badge {
position: absolute;
top: -4px;
right: -4px;
min-width: 18px;
height: 18px;
background: var(--accent-pink);
border-radius: 50%;
font-size: 0.6rem;
font-weight: 700;
display: flex;
align-items: center;
justify-content: center;
padding: 0 4px;
animation: badgePop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes badgePop {
from { transform: scale(0); }
to { transform: scale(1); }
}

.shortcuts-modal {
display: none;
position: fixed;
inset: 0;
background: rgba(5, 5, 16, 0.6);
backdrop-filter: blur(8px);
z-index: 1000;
align-items: center;
justify-content: center;
}

.shortcuts-modal.active {
display: flex;
animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
from { opacity: 0; }
to { opacity: 1; }
}

.shortcuts-modal-content {
background: rgba(12, 12, 29, 0.95);
backdrop-filter: blur(24px);
border: 1px solid var(--glass-border);
border-radius: var(--radius-xl);
padding: 32px;
max-width: 420px;
width: 90%;
box-shadow: var(--shadow-lg);
animation: modalContentIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}

.shortcuts-modal-content::before {
content: "";
position: absolute;
inset: -1px;
border-radius: var(--radius-xl);
padding: 1px;
background: linear-gradient(135deg, rgba(0,240,255,0.3), transparent 40%, transparent 60%, rgba(168,85,247,0.3));
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
pointer-events: none;
}

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

.shortcuts-modal-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 20px;
}

.shortcuts-modal-header h3 {
font-size: 1.2rem;
font-weight: 700;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

.shortcuts-close {
width: 32px;
height: 32px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid var(--glass-border);
border-radius: var(--radius-sm);
color: var(--text-secondary);
font-size: 1.2rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}

.shortcuts-close:hover {
background: rgba(255, 45, 120, 0.1);
border-color: rgba(255, 45, 120, 0.2);
color: var(--accent-pink);
}

.shortcuts-list { display: flex; flex-direction: column; gap: 8px; }

.shortcut-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid var(--border-color);
}

.shortcut-row:last-child { border-bottom: none; }

.shortcut-row kbd {
padding: 4px 10px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid var(--glass-border);
border-radius: 6px;
font-family: 'SF Mono', 'Cascadia Code', monospace;
font-size: 0.8rem;
color: var(--accent-cyan);
min-width: 60px;
text-align: center;
}

.shortcut-row span {
font-size: 0.9rem;
color: var(--text-secondary);
}

.toast-container {
position: fixed;
bottom: 80px;
left: 50%;
transform: translateX(-50%);
z-index: 2000;
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
}

.toast {
padding: 10px 20px;
background: rgba(12, 12, 29, 0.95);
backdrop-filter: blur(24px);
border: 1px solid var(--glass-border);
border-radius: var(--radius-md);
color: var(--text-primary);
font-size: 0.85rem;
font-weight: 500;
box-shadow: var(--shadow-lg);
animation: toastIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
white-space: nowrap;
}

.toast.success { border-color: rgba(0, 255, 136, 0.3); color: var(--accent-green); }
.toast.error { border-color: rgba(255, 45, 120, 0.3); color: var(--accent-pink); }
.toast.info { border-color: rgba(0, 240, 255, 0.3); color: var(--accent-cyan); }

.toast.leaving { animation: toastOut 0.3s ease forwards; }

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

@keyframes toastOut {
from { opacity: 1; transform: translateY(0) scale(1); }
to { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

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

.confetti-particle {
position: fixed;
width: 8px;
height: 8px;
pointer-events: none;
z-index: 3000;
animation: confetti-fall 1.5s ease-out forwards;
}

@keyframes confetti-fall {
0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
100% { opacity: 0; transform: translateY(200px) rotate(720deg) scale(0.2); }
}

@media (max-width: 768px) {
.sidebar {
position: fixed;
left: 0;
top: 0;
bottom: 0;
z-index: 100;
transform: translateX(-100%);
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.active { transform: translateX(0); }
body.sidebar-open { overflow: hidden; }
.menu-toggle { display: block; }
.input-area { padding: 16px; }
.welcome-message { padding: 40px 20px; }
.suggestion-grid { grid-template-columns: 1fr; }
.top-bar { gap: 8px; padding: 12px 16px; }
.smart-mode-indicator span { display: none; }
.nova-prime-toggle span { display: none; }
.search-toggle span { display: none; }
.scroll-fab { right: 20px; bottom: 100px; }
.input-note kbd { display: none; }
.shortcuts-modal-content { padding: 24px; }
}

@media (min-width: 769px) {
.menu-toggle { display: none; }
}
