/* Bull Mentor demo dashboard — Trading Bull Academy theme
   Palette sampled from the academy bull logo:
   deep navy bg, gold bull, cyan neon ring/arrow, green/red candles. */

:root {
  --bg-primary: #040b16;
  --bg-surface: #0b1c33;
  --bg-surface-2: #0f2540;
  --border-dim: rgba(41, 196, 255, 0.14);
  --accent-gold: #f2c94c;
  --accent-gold-dim: rgba(242, 201, 76, 0.25);
  --accent-cyan: #29c4ff;
  --accent-cyan-dim: rgba(41, 196, 255, 0.18);
  --bull-green: #00e676;
  --bear-red: #ff2e4c;
  --text-primary: #e8f1fa;
  --text-dim: #8fa8c4;
  --glow-cyan: 0 0 14px rgba(41, 196, 255, 0.35);
  --glow-gold: 0 0 14px rgba(242, 201, 76, 0.3);
  --radius: 14px;
  font-size: 16px;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 20% -5%, rgba(242, 201, 76, 0.07), transparent 60%),
    radial-gradient(1000px 600px at 85% 110%, rgba(41, 196, 255, 0.08), transparent 60%);
}

/* ---------- header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; border-bottom: 1px solid var(--border-dim);
  background: rgba(4, 11, 22, 0.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--accent-gold-dim);
  box-shadow: var(--glow-gold);
  object-fit: cover;
}
.brand-text h1 {
  font-size: 1.35rem; letter-spacing: 0.04em;
  background: linear-gradient(90deg, var(--accent-gold), #ffe9a8 55%, var(--accent-cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.header-badges { display: flex; gap: 8px; }
.badge {
  font-size: 0.68rem; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border-dim); color: var(--text-dim);
  font-family: ui-monospace, monospace;
}
.badge-live { color: var(--bull-green); border-color: rgba(0, 230, 118, 0.35); box-shadow: 0 0 10px rgba(0, 230, 118, 0.15); }
.badge-dim { opacity: 0.8; }

/* ---------- layout ---------- */
.layout {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px; padding: 20px 26px; max-width: 1400px; width: 100%;
  margin: 0 auto; position: relative; z-index: 1;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- chat ---------- */
.chat-panel {
  display: flex; flex-direction: column;
  background: var(--bg-surface); border: 1px solid var(--border-dim);
  border-radius: var(--radius); overflow: hidden; min-height: 62vh;
}
.messages { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 82%; }
.msg.mentor { align-self: flex-start; }
.msg.user { align-self: flex-end; }
.msg-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase;
}
.msg.user .msg-head { justify-content: flex-end; }
.avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1px solid var(--accent-gold-dim); }
.bubble {
  padding: 13px 16px; border-radius: var(--radius); line-height: 1.55; font-size: 0.94rem;
  white-space: pre-wrap; word-break: break-word;
}
.msg.mentor .bubble {
  background: var(--bg-surface-2); border: 1px solid var(--accent-gold-dim);
  border-left: 3px solid var(--accent-gold);
}
.msg.user .bubble {
  background: rgba(41, 196, 255, 0.1); border: 1px solid var(--accent-cyan-dim);
  border-right: 3px solid var(--accent-cyan);
}
.bubble.thinking { color: var(--text-dim); font-style: italic; }
.disclaimer { margin-top: 10px; font-size: 0.72rem; color: var(--text-dim); border-top: 1px dashed var(--border-dim); padding-top: 8px; }
.msg-meta { margin-top: 6px; font-size: 0.68rem; color: var(--text-dim); font-family: ui-monospace, monospace; display: flex; gap: 10px; flex-wrap: wrap; }
.msg-meta .blocked { color: var(--bear-red); }
.play-btn {
  margin-top: 8px; background: none; border: 1px solid var(--accent-cyan-dim); color: var(--accent-cyan);
  border-radius: 20px; padding: 4px 12px; font-size: 0.75rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.play-btn:hover { box-shadow: var(--glow-cyan); }
.play-btn:disabled { opacity: 0.45; cursor: wait; }

/* ---------- voice dock ---------- */
.voice-dock {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-top: 1px solid var(--border-dim);
  background: rgba(11, 28, 51, 0.7);
}
.mic-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--accent-cyan-dim);
  background: var(--bg-surface-2); color: var(--accent-cyan); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.mic-btn:hover { box-shadow: var(--glow-cyan); }
.mic-btn:active { transform: scale(0.95); }
.mic-btn.recording {
  border-color: var(--bear-red); color: var(--bear-red);
  box-shadow: 0 0 18px rgba(255, 46, 76, 0.5);
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(255, 46, 76, 0.75); } }
.voice-status { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#voice-state { font-size: 0.82rem; color: var(--text-dim); }
.latency-hud { font-size: 0.7rem; color: var(--accent-cyan); font-family: ui-monospace, monospace; }
.voice-toggle { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
.voice-toggle input { accent-color: var(--accent-gold); }

/* ---------- composer ---------- */
.composer {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--border-dim);
}
.composer select, .composer input {
  background: var(--bg-surface-2); border: 1px solid var(--border-dim);
  color: var(--text-primary); border-radius: 10px; padding: 11px 13px; font-size: 0.92rem;
  outline: none;
}
.composer select { max-width: 130px; }
.composer input { flex: 1; }
.composer input:focus, .composer select:focus { border-color: var(--accent-cyan); box-shadow: var(--glow-cyan); }
.send-btn {
  width: 46px; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-gold), #d9a91f);
  color: #1a1405; display: flex; align-items: center; justify-content: center;
  transition: box-shadow 0.2s, transform 0.1s;
}
.send-btn:hover { box-shadow: var(--glow-gold); }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.5; cursor: wait; }

/* ---------- side rail ---------- */
.side-rail { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--bg-surface); border: 1px solid var(--border-dim);
  border-radius: var(--radius); padding: 18px;
}
.card h2 { font-size: 0.95rem; margin-bottom: 6px; color: var(--accent-gold); letter-spacing: 0.03em; }
.card-sub { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 12px; line-height: 1.45; }
.dropzone {
  border: 2px dashed var(--border-dim); border-radius: 10px; padding: 18px;
  text-align: center; color: var(--text-dim); font-size: 0.82rem;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone.dragover { border-color: var(--accent-cyan); background: rgba(41, 196, 255, 0.06); }
.image-preview-wrap img { width: 100%; border-radius: 10px; border: 1px solid var(--border-dim); }
.image-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.image-actions select { flex: 1; background: var(--bg-surface-2); border: 1px solid var(--border-dim); color: var(--text-primary); border-radius: 8px; padding: 8px; font-size: 0.8rem; }
textarea {
  width: 100%; background: var(--bg-surface-2); border: 1px solid var(--border-dim);
  color: var(--text-primary); border-radius: 10px; padding: 11px; font-size: 0.86rem;
  font-family: inherit; resize: vertical; outline: none;
}
textarea:focus { border-color: var(--accent-cyan); box-shadow: var(--glow-cyan); }
.cta-btn {
  background: linear-gradient(135deg, var(--accent-gold), #d9a91f); border: none; color: #1a1405;
  border-radius: 9px; padding: 9px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: box-shadow 0.2s;
}
.cta-btn:hover { box-shadow: var(--glow-gold); }
.cta-btn:disabled { opacity: 0.5; cursor: wait; }
.cta-btn.wide { width: 100%; margin-top: 10px; }
.ghost-btn {
  background: none; border: 1px solid var(--border-dim); color: var(--text-dim);
  border-radius: 9px; padding: 7px 13px; font-size: 0.8rem; cursor: pointer;
}
.ghost-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.hidden { display: none !important; }
.profile-summary { font-size: 0.8rem; color: var(--text-dim); line-height: 1.6; }
.profile-summary .stat { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed rgba(41,196,255,0.08); }
.profile-summary .stat b { color: var(--text-primary); font-weight: 500; }
.profile-summary .mistake { color: var(--bear-red); }
.profile-summary .strength { color: var(--bull-green); }

/* ---------- footer ---------- */
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 13px 26px; border-top: 1px solid var(--border-dim);
  font-size: 0.72rem; color: var(--text-dim); position: relative; z-index: 1;
}
.footer code { color: var(--accent-cyan); }

/* scrollbars */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(41, 196, 255, 0.18); border-radius: 4px; }
