:root {
  --bg: #0f1012;
  --panel: #16181d;
  --muted: #9aa4b2;
  --text: #e6e9ef;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --border: #222632;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* Space background canvas */
.space-bg { position: fixed; inset: 0; z-index: 0; background: radial-gradient(1200px 600px at 20% -10%, #1b1f29 0%, transparent 60%), radial-gradient(1000px 500px at 120% 10%, #141b2a 0%, transparent 60%), var(--bg); }

/* Left Sidebar */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
  width: 220px; background: rgba(22,24,29,0.95); border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; padding: 12px 8px;
}
.sidebar-toggle {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 10px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; transition: background 0.2s, color 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: none; border: none; color: var(--muted); cursor: pointer;
  border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: background 0.2s, color 0.2s; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: rgba(139,92,246,0.15); color: var(--text); }
.nav-item svg { flex-shrink: 0; }
.sidebar-footer { padding-top: 12px; border-top: 1px solid var(--border); }
.sidebar-user {
  width: 100%; padding: 10px; border-radius: 10px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); color: var(--text); font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.08); }

/* Top header bar */
.top-bar {
  position: fixed; top: 0; left: 220px; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; backdrop-filter: blur(8px);
  background: linear-gradient(180deg, rgba(15,16,18,0.85), rgba(15,16,18,0.4));
}
.top-logo { display: flex; align-items: center; cursor: pointer; }
.top-right { display: flex; align-items: center; gap: 10px; }
.private-badge { padding: 6px 12px; border-radius: 8px; background: rgba(255,255,255,0.1); font-size: 13px; font-weight: 500; }

/* Landing page (hero) */
.landing {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 80px 20px 40px; margin-left: 220px;
}
.hero-logo { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 32px; }
.hero-logo svg { filter: drop-shadow(0 0 20px rgba(139,92,246,0.4)); }
.brand-name { font-size: 56px; font-weight: 300; letter-spacing: -1px; margin: 0; }

/* Hero composer (main input) */
.hero-composer {
  position: relative; width: 100%; max-width: 680px; margin-bottom: 28px;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-radius: 50px;
  background: rgba(22,24,29,0.9); border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.mic-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 6px; display: grid; place-items: center; transition: color 0.2s; }
.mic-btn:hover { color: var(--text); }
.hero-input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 15px; outline: none; }
.hero-input::placeholder { color: #5e6b7e; }
.mode-toggle { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px 10px; border-radius: 8px; font-size: 14px; transition: background 0.2s; }
.mode-toggle:hover { background: rgba(255,255,255,0.05); }
.mode-label { font-weight: 500; }
.hero-send-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; border-radius: 50%; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; transition: transform 0.1s; flex-shrink: 0; }
.hero-send-btn:hover { transform: scale(1.05); }
.hero-send-btn:active { transform: scale(0.95); }

/* Promo card (Imagine Anything) */
.promo-card {
  width: 100%; max-width: 680px; margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-radius: 16px;
  background: rgba(22,24,29,0.6); border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.promo-content h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.promo-content p { font-size: 14px; color: var(--muted); }
.promo-btn { padding: 8px 18px; border-radius: 10px; background: rgba(255,255,255,0.1); border: none; color: var(--text); font-weight: 600; cursor: pointer; transition: background 0.2s; }
.promo-btn:hover { background: rgba(255,255,255,0.15); }

/* Landing footer */
.landing-footer {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 12px;
  background: rgba(22,24,29,0.8); border: 1px solid var(--border);
}
.landing-footer p { font-size: 14px; font-weight: 500; }
.upgrade-btn { padding: 6px 14px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #0e0f12; font-weight: 700; cursor: pointer; font-size: 13px; }

/* Chat view (hidden initially) */
.chat-view {
  position: relative; z-index: 10;
  display: flex; flex-direction: column;
  min-height: 100vh; padding-top: 60px; margin-left: 220px;
  transition: opacity 0.3s;
}
.chat-view.hidden { display: none; }
.chat-container { flex: 1; display: flex; flex-direction: column; max-width: 780px; margin: 0 auto; width: 100%; padding: 20px; }
.messages { flex: 1; overflow-y: auto; padding: 20px 0; display: flex; flex-direction: column; gap: 16px; }

.msg { display: flex; gap: 12px; align-items: flex-start; }
.bubble {
  padding: 12px 16px; border-radius: 16px;
  background: rgba(22,24,29,0.8); border: 1px solid var(--border);
  max-width: 70ch; line-height: 1.5; font-size: 15px;
}
.user .bubble { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.3); }
.bot .bubble { background: rgba(22,24,29,0.9); }
.role { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.role.user { background: linear-gradient(135deg, #0ea5e9, #06b6d4); color: #fff; }
.role.bot { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0e0f12; }

/* Chat composer */
.chat-composer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 24px;
  background: rgba(22,24,29,0.9); border: 1px solid var(--border);
  margin-top: 12px;
}
.chat-input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 15px; outline: none; }
.chat-input::placeholder { color: #5e6b7e; }
.chat-send { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; transition: transform 0.1s; }
.chat-send:active { transform: scale(0.95); }

/* Popup overlay */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: grid; place-items: center; z-index: 1000; backdrop-filter: blur(4px); }
.popup { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px 28px; box-shadow: 0 16px 48px rgba(0,0,0,0.6); font-weight: 800; font-size: 20px; }

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar .nav-item span { display: none; }
  .top-bar { left: 60px; }
  .landing, .chat-view { margin-left: 60px; }
  .brand-name { font-size: 42px; }
  .hero-composer { max-width: 90%; }
  .promo-card { max-width: 90%; }
}

