 /* ===== Nexis AI — Light Clean Theme ===== */
:root {
  --bg-deep: #FFFFFF;
  --bg-surface: #F7F7FA;
  --bg-surface-2: #EEEEF3;
  --bg-input: #F4F4F8;
  --border-subtle: #E4E4EC;
 
  --grad-1: #6C5CE0;
  --grad-2: #E0609C;
  --grad-3: #2FA5D9;
  --accent: #6C5CE0;
  --accent-dim: #5847C7;
  --accent-glow: rgba(108, 92, 224, 0.14);
 
  --text-primary: #17171D;
  --text-secondary: #64646F;
  --text-faint: #9898A5;
 
  --user-bubble: #EFEDFF;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
 
  --radius: 14px;
}
 
* { box-sizing: border-box; margin: 0; padding: 0; }
 
html, body {
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow: hidden;
}
 
body { display: flex; position: relative; }
.hidden { display: none !important; }
 
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
 
.gradient-text {
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2), var(--grad-3));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 12s ease infinite;
}
 
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
 
.bg-fx { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
 
.blob { position: absolute; border-radius: 50%; filter: blur(130px); opacity: 0.12; }
.blob-1 { width: 420px; height: 420px; background: var(--grad-1); top: -100px; left: -100px; animation: drift1 34s ease-in-out infinite; }
.blob-2 { width: 380px; height: 380px; background: var(--grad-2); bottom: -120px; right: -80px; animation: drift2 40s ease-in-out infinite; }
.blob-3 { width: 320px; height: 320px; background: var(--grad-3); top: 40%; left: 50%; animation: drift3 46s ease-in-out infinite; }
 
@keyframes drift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.05); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-30px, -25px) scale(1.03); } }
@keyframes drift3 { 0%, 100% { transform: translate(-50%, 0) scale(1); } 50% { transform: translate(-50%, -20px) scale(1.06); } }
 
.login-screen { width: 100%; height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
 
.login-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 44px 38px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(20,20,40,0.08);
  animation: cardIn 0.5s ease;
}
 
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
 
.login-mark { color: var(--accent); display: flex; justify-content: center; margin-bottom: 20px; filter: drop-shadow(0 0 14px var(--accent-glow)); animation: floatY 4.5s ease-in-out infinite; }
 
.login-card h1 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.3px; }
.login-card p { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 26px; line-height: 1.5; }
 
.google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid var(--border-subtle);
  padding: 13px 16px; border-radius: 12px; font-family: var(--font-body);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.google-btn:hover { background: var(--bg-surface-2); }
.google-btn:active { transform: scale(0.99); }
 
.login-disclaimer { margin-top: 20px; font-size: 11px; color: var(--text-faint); }
 
.app-shell { display: flex; width: 100%; position: relative; z-index: 1; }
 
.sidebar {
  width: 264px; flex-shrink: 0;
  background: rgba(247, 247, 250, 0.75);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; padding: 16px 12px;
  transition: margin-left 0.25s ease; height: 100vh;
}
 
.sidebar.collapsed { margin-left: -264px; }
 
.sidebar-top { display: flex; flex-direction: column; gap: 16px; }
 
.brand { display: flex; align-items: center; gap: 8px; padding: 6px 6px 12px; }
.brand-mark { color: var(--accent); display: flex; }
.pulse-glow { filter: drop-shadow(0 0 6px var(--accent-glow)); animation: pulseGlow 4s ease-in-out infinite; }
@keyframes pulseGlow { 0%, 100% { filter: drop-shadow(0 0 5px var(--accent-glow)); } 50% { filter: drop-shadow(0 0 10px var(--accent-glow)); } }
.brand-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.2px; color: var(--text-primary); }
.brand-name em { font-style: normal; }
 
.new-chat-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--grad-1), var(--grad-2));
  border: none; color: #fff; font-family: var(--font-body);
  font-size: 13px; font-weight: 600; padding: 10px 14px;
  border-radius: 10px; cursor: pointer; transition: filter 0.15s;
}
.new-chat-btn:hover { filter: brightness(1.08); }
.new-chat-btn:active { filter: brightness(0.96); }
 
.history-list { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
 
.suggestions-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-faint); margin-bottom: 6px; padding: 0 6px; font-weight: 600; }
 
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  text-align: left; background: transparent; border: none;
  color: var(--text-secondary); font-size: 13px; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; transition: all 0.15s; width: 100%;
}
.history-item:hover { color: var(--text-primary); background: var(--bg-surface-2); }
.history-item.active { color: var(--text-primary); background: var(--bg-surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.history-item span.title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.history-item .delete-chat { opacity: 0; color: var(--text-faint); flex-shrink: 0; transition: opacity 0.15s; }
.history-item:hover .delete-chat { opacity: 1; }
.history-item .delete-chat:hover { color: #d9436b; }
 
.suggestion-chip {
  text-align: left; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 13px; padding: 12px 14px;
  border-radius: 12px; cursor: pointer; transition: all 0.2s; line-height: 1.4;
}
.suggestion-chip:hover { color: var(--text-primary); border-color: var(--accent-dim); background: var(--bg-surface-2); }
 
.quick-prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; text-align: left; }
 
.sidebar-bottom { padding: 12px 6px 0; border-top: 1px solid var(--border-subtle); margin-top: 8px; }
 
.user-row { display: flex; align-items: center; gap: 8px; padding: 6px; }
.user-photo { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--bg-surface-2); border: 2px solid transparent; background-image: linear-gradient(var(--bg-surface), var(--bg-surface)), linear-gradient(135deg, var(--grad-1), var(--grad-2)); background-origin: border-box; background-clip: content-box, border-box; }
.user-name { font-size: 13px; color: var(--text-primary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; display: flex; padding: 4px; border-radius: 6px; transition: color 0.15s; }
.logout-btn:hover { color: #d9436b; background: var(--bg-surface-2); }
 
.chat-main { flex: 1; display: flex; flex-direction: column; height: 100vh; min-width: 0; }
 
.chat-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
  background: rgba(255,255,255,0.7); backdrop-filter: blur(10px);
}
 
.sidebar-toggle { background: none; border: none; color: var(--text-secondary); cursor: pointer; display: flex; padding: 4px; border-radius: 6px; transition: all 0.15s; }
.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-surface-2); transform: scale(1.1); }
 
.header-title { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
 
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #21B36A; margin-left: auto; box-shadow: 0 0 6px rgba(33,179,106,0.5); animation: dotPulse 3s ease-in-out infinite; }
.status-dot.offline { background: var(--text-faint); box-shadow: none; animation: none; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
 
.chat-window { flex: 1; overflow-y: auto; padding: 24px 0 12px; display: flex; flex-direction: column; align-items: center; }
.chat-window::-webkit-scrollbar { width: 8px; }
.chat-window::-webkit-scrollbar-thumb { background: var(--bg-surface-2); border-radius: 8px; }
 
.welcome-screen { margin: auto; text-align: center; max-width: 480px; padding: 24px; }
.welcome-mark { color: var(--accent); display: flex; justify-content: center; margin-bottom: 18px; filter: drop-shadow(0 0 20px var(--accent-glow)); }
.floaty { animation: floatY 5s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
 
.welcome-screen h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.3px; }
.welcome-screen p { color: var(--text-secondary); font-size: 14px; }
 
.message-row { width: 100%; max-width: 720px; padding: 8px 20px; display: flex; gap: 12px; animation: rise 0.25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.message-row.user { justify-content: flex-end; }
 
.avatar {
  width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; background: var(--bg-surface-2); color: var(--accent);
  font-size: 11px; font-weight: 600; overflow: hidden;
}
.message-row.assistant .avatar { background: linear-gradient(135deg, var(--grad-1), var(--grad-2)); color: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
 
.bubble {
  padding: 12px 16px; border-radius: var(--radius); font-size: 14.5px;
  line-height: 1.6; max-width: 75%; white-space: pre-wrap; word-wrap: break-word;
}
.message-row.assistant .bubble { background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.message-row.user .bubble { background: var(--user-bubble); }
 
.bubble code { font-family: var(--font-mono); background: var(--bg-surface-2); padding: 2px 6px; border-radius: 5px; font-size: 13px; color: #7C3AED; }
.bubble pre { background: #1B1B22; border: 1px solid var(--border-subtle); padding: 14px; border-radius: 10px; overflow-x: auto; margin: 8px 0; }
.bubble pre code { background: none; padding: 0; color: #EDEDF5; }
 
.cursor-blink { display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 2px; vertical-align: text-bottom; animation: blink 0.9s step-start infinite; }
@keyframes blink { 50% { opacity: 0; } }
 
.thinking-row { display: flex; gap: 6px; align-items: center; padding: 4px 2px; }
.thinking-dot { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--grad-1), var(--grad-2)); animation: pulse 1.2s ease-in-out infinite; }
.thinking-dot:nth-child(2) { animation-delay: 0.15s; }
.thinking-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); } 30% { opacity: 1; transform: scale(1.15); } }
 
.input-bar {
  width: 100%; max-width: 720px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px;
  background: rgba(255,255,255,0.9); backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px; padding: 10px 10px 10px 18px; margin-bottom: 4px;
  box-shadow: 0 4px 20px rgba(20,20,40,0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-bar:focus-within { border-color: var(--accent-dim); box-shadow: 0 0 0 3px var(--accent-glow); }
 
#userInput {
  flex: 1; background: none; border: none; outline: none; color: var(--text-primary);
  font-family: var(--font-body); font-size: 14.5px; resize: none; max-height: 160px;
  line-height: 1.5; padding: 6px 0;
}
#userInput::placeholder { color: var(--text-faint); }
 
#sendBtn {
  background: linear-gradient(135deg, var(--grad-1), var(--grad-2)); border: none; color: #fff; width: 36px; height: 36px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: filter 0.15s, transform 0.1s;
}
#sendBtn:hover { filter: brightness(1.1); }
#sendBtn:active { transform: scale(0.94); }
#sendBtn:disabled { background: var(--bg-surface-2); color: var(--text-faint); cursor: not-allowed; transform: none; box-shadow: none; }
 
.disclaimer { text-align: center; font-size: 11px; color: var(--text-faint); padding: 6px 0 14px; }
 
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 20; height: 100vh; margin-left: -264px; }
  .sidebar.open { margin-left: 0; box-shadow: 0 0 40px rgba(0,0,0,0.15); }
  .input-bar, .message-row { max-width: 100%; }
  .chat-header { padding: 10px 16px; }
  .quick-prompts { grid-template-columns: 1fr; }
  .blob { filter: blur(60px); opacity: 0.18; }
}
 
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
 
.splash-screen {
  position: fixed; inset: 0; z-index: 999; background: var(--bg-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; animation: splashOut 0.5s ease 1.0s forwards;
}
 
@keyframes splashOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }
 
.splash-logo { color: var(--accent); filter: drop-shadow(0 0 24px var(--accent-glow)); animation: splashPulse 1.5s ease-in-out infinite; }
 
@keyframes splashPulse { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.05); opacity: 1; } }
 
.splash-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.3px; opacity: 0; animation: splashTextIn 0.5s ease 0.3s forwards; }
 
@keyframes splashTextIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
 
.avatar.is-thinking { animation: avatarBlink 1s ease-in-out infinite; }
 
@keyframes avatarBlink { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); transform: scale(1); } 50% { box-shadow: 0 0 0 8px transparent; transform: scale(1.08); } }
 
.status-row { display: flex; align-items: center; gap: 10px; padding: 2px 2px 4px; }
.status-text { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.status-text.searching { color: var(--grad-3); }
.status-icon { display: flex; align-items: center; color: var(--accent); animation: spin 1.1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
 
.status-text-shimmer {
  background: linear-gradient(90deg, var(--text-secondary) 0%, var(--text-primary) 50%, var(--text-secondary) 100%);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { 0% { background-position: 200% center; } 100% { background-position: -200% center; } }
 
.wifi-icon { display: flex; align-items: center; color: #21B36A; transition: color 0.2s; }
.status-dot.offline ~ .wifi-icon, #statusDot.offline + .wifi-icon { color: #d9436b; }
 
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.25); z-index: 15; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.sidebar-overlay.visible { opacity: 1; pointer-events: auto; }
 
html { scroll-behavior: smooth; }
::selection { background: var(--accent-glow); color: var(--text-primary); }
 
.login-card, .message-row.assistant .bubble { box-shadow: 0 2px 12px rgba(20,20,40,0.05); }
 
button:disabled { cursor: not-allowed; opacity: 0.6; }
button, .status-dot, .wifi-icon, .avatar { -webkit-tap-highlight-color: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--bg-surface-2) transparent; }
 
.app-shell, .login-screen { animation: appFadeIn 0.4s ease; }
@keyframes appFadeIn { from { opacity: 0; } to { opacity: 1; } }
 
.input-bar { margin-bottom: max(4px, env(safe-area-inset-bottom)); }
.chat-header { padding-top: max(12px, env(safe-area-inset-top)); }
 
.btn-spinner { width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.15); border-top-color: #1f1f1f; border-radius: 50%; display: inline-block; animation: spin 0.7s linear infinite; }
 
.code-block { position: relative; margin: 10px 0; }
.code-block pre { margin: 0; }
.copy-code-btn {
  position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #D8D8E4; font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer;
  opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.code-block:hover .copy-code-btn { opacity: 1; }
.copy-code-btn:hover { color: #fff; }
 
.message-row.assistant .bubble { position: relative; padding-bottom: 30px; }
.msg-copy-btn {
  position: absolute; bottom: 6px; right: 10px; background: none; border: none;
  color: var(--text-faint); cursor: pointer; padding: 4px; border-radius: 6px;
  opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.message-row.assistant:hover .msg-copy-btn { opacity: 1; }
.msg-copy-btn:hover { color: var(--text-primary); background: var(--bg-surface-2); }
 
.scroll-bottom-btn {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: #fff; border: 1px solid var(--border-subtle); color: var(--text-primary);
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  z-index: 5; box-shadow: 0 4px 16px rgba(20,20,40,0.12);
}
.scroll-bottom-btn.visible { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.scroll-bottom-btn:hover { background: var(--bg-surface); border-color: var(--accent-dim); }
.chat-main { position: relative; }
 
.bubble h2, .bubble h3, .bubble h4 { font-family: var(--font-display); margin: 10px 0 6px; line-height: 1.3; }
.bubble h2 { font-size: 18px; }
.bubble h3 { font-size: 16px; }
.bubble h4 { font-size: 14.5px; }
.bubble ul { margin: 6px 0; padding-left: 20px; }
.bubble li { margin: 3px 0; }
 
.msg-time { display: block; font-size: 10px; color: var(--text-faint); margin-top: 6px; opacity: 0; transition: opacity 0.15s; }
.message-row:hover .msg-time { opacity: 1; }
.message-row.user .msg-time { text-align: right; }
 
.msg-actions { position: absolute; bottom: 6px; right: 10px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.message-row.assistant:hover .msg-actions { opacity: 1; }
.msg-action-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 4px; border-radius: 6px; display: flex; }
.msg-action-btn:hover { color: var(--text-primary); background: var(--bg-surface-2); }
 
.rename-input {
  flex: 1; background: #fff; border: 1px solid var(--accent-dim); color: var(--text-primary);
  font-size: 13px; font-family: var(--font-body); padding: 4px 6px; border-radius: 6px;
  outline: none; min-width: 0;
}
 








