/* ═══════════════════════════════════════════════════════════════════
   CAMPUS CONNECT — MAIN STYLESHEET
   Aesthetic: Dark Luxury Academia / Neural Interface
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* Core palette */
  --bg:          #060912;
  --bg2:         #0b1120;
  --surface:     #101828;
  --surface2:    #15203a;
  --surface3:    #1a2844;
  --border:      rgba(100,180,255,0.10);
  --border2:     rgba(100,180,255,0.20);

  /* Brand */
  --blue:        #3b82f6;
  --blue-glow:   rgba(59,130,246,0.25);
  --cyan:        #06b6d4;
  --violet:      #7c3aed;
  --violet-soft: rgba(124,58,237,0.15);
  --gold:        #f59e0b;
  --green:       #10b981;
  --red:         #ef4444;

  /* Text */
  --text:        #e8eaf6;
  --text2:       #8899b4;
  --text3:       #4a5a73;

  /* Gradients */
  --grad-brand:  linear-gradient(135deg, var(--blue), var(--violet));
  --grad-gold:   linear-gradient(135deg, #f59e0b, #ef4444);
  --grad-cyan:   linear-gradient(135deg, var(--cyan), var(--blue));

  /* Sizing */
  --sidebar-w:   280px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-xl:   24px;
}

/* ── RESET & BASE ─────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { height:100%; }

body {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ── CANVAS BACKGROUND ────────────────────────────── */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── APP LAYOUT ───────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ──────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), width 0.3s;
  position: relative;
  z-index: 10;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: radial-gradient(ellipse at top, rgba(59,130,246,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.logo-icon-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--grad-brand);
  border-radius: var(--radius-md);
  box-shadow: 0 0 24px var(--blue-glow);
}

.logo-icon-ring {
  position: absolute;
  inset: -3px;
  border: 1px solid var(--blue);
  border-radius: calc(var(--radius-md) + 3px);
  opacity: 0.4;
  animation: ringPulse 3s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { opacity:0.2; transform:scale(1); }
  50% { opacity:0.6; transform:scale(1.05); }
}

.logo-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.logo-title span { background: var(--grad-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo-sub { font-size: 10px; color: var(--text3); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }

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

.sidebar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Status row */
.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--green);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity:1; box-shadow: 0 0 6px var(--green); }
  50% { opacity:0.5; box-shadow: 0 0 2px var(--green); }
}

/* College badge */
.college-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.college-badge-icon { font-size: 22px; }
.badge-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.badge-loc { font-size: 11px; color: var(--text2); }

.visit-btn {
  display: block;
  text-align: center;
  padding: 7px 12px;
  background: var(--blue-glow);
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.visit-btn:hover { background: var(--blue); color: #fff; }

/* Quick list */
.quick-list { display: flex; flex-direction: column; gap: 4px; }

.quick-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.quick-btn:hover { background: var(--surface3); border-color: var(--border2); color: var(--text); }

/* Language select */
.lang-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238899b4' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
.lang-select:hover { border-color: var(--border2); }
.lang-select option { background: var(--surface2); }

/* Sidebar bottom */
.sidebar-bottom {
  margin-top: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn:hover { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.05); }
.action-btn.danger:hover { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.05); }

/* ── MAIN CONTENT ─────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── TOPBAR ───────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  display: none; /* shown on mobile */
}
.sidebar-toggle:hover { border-color: var(--blue); color: var(--blue); }

/* Phase tracker */
.phase-track {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.phase-item {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  transition: opacity 0.3s;
}
.phase-item.active { opacity: 1; }
.phase-item.done { opacity: 0.7; }

.phase-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  transition: all 0.3s;
}
.phase-item.active .phase-num {
  background: var(--grad-brand);
  border-color: transparent;
  box-shadow: 0 0 10px var(--blue-glow);
}
.phase-item.done .phase-num {
  background: var(--green);
  border-color: transparent;
}
.phase-item.done .phase-num::after { content: '✓'; }
.phase-item.done .phase-num { font-size: 0; }
.phase-item.done .phase-num::after { font-size: 10px; }

.phase-lbl { font-size: 12px; font-weight: 500; color: var(--text2); }
.phase-item.active .phase-lbl { color: var(--text); }

.phase-divider {
  width: 24px; height: 1px;
  background: var(--border2);
  flex-shrink: 0;
}

.topbar-right { margin-left: auto; }

.model-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── CHAT WINDOW ──────────────────────────────────── */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── MESSAGES ─────────────────────────────────────── */
.msg-row {
  display: flex;
  gap: 12px;
  animation: msgIn 0.4s cubic-bezier(0.2,0,0.3,1);
  max-width: 820px;
}

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

.msg-row.user {
  flex-direction: row-reverse;
  align-self: flex-end;
}
.msg-row.bot { align-self: flex-start; }

.msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
}
.msg-avatar.bot {
  background: var(--grad-brand);
  box-shadow: 0 0 16px var(--blue-glow);
}
.msg-avatar.user {
  background: var(--surface3);
  border: 1px solid var(--border2);
}

.msg-body { flex: 1; min-width: 0; }

.msg-bubble {
  padding: 13px 17px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.7;
  position: relative;
}
.msg-bubble.bot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
}
.msg-bubble.user {
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(124,58,237,0.2));
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg);
}

/* Markdown inside bubble */
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 {
  font-family: 'Playfair Display', serif;
  margin: 10px 0 6px;
  color: var(--text);
}
.msg-bubble h1 { font-size: 18px; }
.msg-bubble h2 { font-size: 16px; }
.msg-bubble h3 { font-size: 14px; }
.msg-bubble p { margin: 0 0 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { padding-left: 18px; margin: 6px 0; }
.msg-bubble li { margin: 3px 0; }
.msg-bubble strong { color: var(--text); font-weight: 600; }
.msg-bubble em { color: var(--text2); }
.msg-bubble code { background: var(--surface3); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.msg-bubble a { color: var(--blue); text-decoration: none; }
.msg-bubble a:hover { text-decoration: underline; }
.msg-bubble table { width:100%; border-collapse:collapse; font-size:13px; margin:8px 0; }
.msg-bubble th { background:var(--surface3); padding:6px 10px; text-align:left; font-weight:600; border:1px solid var(--border); }
.msg-bubble td { padding:6px 10px; border:1px solid var(--border); color:var(--text2); }
.msg-bubble tr:hover td { background:var(--surface3); color:var(--text); }

/* ── INTRO CARD ───────────────────────────────────── */
.intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  max-width: 680px;
  width: 100%;
  animation: msgIn 0.5s cubic-bezier(0.2,0,0.3,1);
}

.intro-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad-brand);
}

.intro-glow {
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(59,130,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.intro-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 30px var(--blue-glow);
  margin-bottom: 18px;
}

.intro-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  line-height: 1.2;
}
.intro-card h2 span {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-card p {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 22px;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 22px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  transition: all 0.2s;
}
.feature-item:hover { border-color: var(--border2); color: var(--text); }
.feature-item .fi-icon { font-size: 16px; }

.intro-cta {
  background: var(--grad-brand);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  box-shadow: 0 0 20px var(--blue-glow);
}
.intro-cta:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: 0 4px 30px var(--blue-glow); }

/* ── COLLEGE CARDS ────────────────────────────────── */
.college-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.college-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.college-result-card::before {
  content:'';
  position:absolute;
  left:0; top:0; bottom:0;
  width:3px;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity 0.2s;
}
.college-result-card:hover {
  border-color: var(--border2);
  background: var(--surface3);
  transform: translateX(4px);
}
.college-result-card:hover::before { opacity: 1; }

.crc-icon { font-size: 24px; }
.crc-info { flex: 1; min-width: 0; }
.crc-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.crc-meta { font-size: 11px; color: var(--text2); display: flex; gap: 10px; flex-wrap: wrap; }
.crc-url { font-size: 11px; color: var(--blue); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crc-arrow { color: var(--text3); font-size: 18px; flex-shrink: 0; }

/* ── STATS GRID ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-brand);
  opacity: 0.5;
}
.stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--blue);
  display: block;
  line-height: 1.2;
  margin-bottom: 4px;
}
.stat-lbl { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── INFO SECTIONS ────────────────────────────────── */
.info-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 10px;
}
.info-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text2); flex-shrink: 0; }
.info-val { color: var(--text); font-weight: 500; text-align: right; }

/* ── LINK ITEMS ───────────────────────────────────── */
.link-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  text-decoration: none;
  color: var(--text2);
  font-size: 13px;
  transition: all 0.2s;
}
.link-item:hover { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.05); }
.link-item .link-icon { font-size: 14px; }
.link-item .link-label { flex: 1; }
.link-item .link-arrow { color: var(--text3); }

/* ── CHART CARD ───────────────────────────────────── */
.chart-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
  max-height: 220px;
  overflow: hidden;
}
.chart-card canvas {
  max-height: 160px !important;
  width: 100% !important;
}
.chart-card:hover { border-color: var(--border2); }
.chart-card-title { font-size: 11px; color: var(--text3); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; justify-content: space-between; }
.expand-hint { font-size: 10px; color: var(--text3); }

/* ── HIGHLIGHTS ───────────────────────────────────── */
.highlights-list { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.highlight-item:last-child { border-bottom: none; }
.highlight-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); flex-shrink: 0; margin-top: 7px; }

/* ── CRAWLING ANIMATION ───────────────────────────── */
.crawl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.crawl-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad-brand);
  animation: scanLine 1.5s ease-in-out infinite;
}
@keyframes scanLine {
  0% { transform: translateX(-100%); opacity:1; }
  100% { transform: translateX(100%); opacity:0; }
}
.crawl-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.crawl-steps { display: flex; flex-direction: column; gap: 8px; }
.crawl-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text2);
}
.crawl-step-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.spin { animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.crawl-step.done { color: var(--green); }
.crawl-step.done .crawl-step-icon::after { content: '✓'; }
.progress-track { background: var(--surface3); border-radius: 4px; height: 4px; margin-top: 14px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: var(--grad-brand);
  border-radius: 4px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--blue-glow);
}

/* ── TYPING INDICATOR ─────────────────────────────── */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 13px 17px;
  width: fit-content;
}
.t-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.t-dot:nth-child(2) { animation-delay: 0.15s; }
.t-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity:0.4; }
  30% { transform: translateY(-7px); opacity:1; }
}

/* ── SUGGESTION CHIPS ─────────────────────────────── */
.suggest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.suggest-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
}
.suggest-chip:hover { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.05); }

/* ── INPUT ZONE ───────────────────────────────────── */
.input-zone {
  flex-shrink: 0;
  padding: 0 24px 20px;
}

.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 10px 8px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.input-card:focus-within {
  border-color: var(--border2);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.07);
}

.input-hints {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 4px 8px;
  scrollbar-width: none;
}
.input-hints::-webkit-scrollbar { display: none; }

.hint-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 11px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
}
.hint-chip:hover { border-color: var(--border2); color: var(--text); }

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.textarea-wrap { flex: 1; }

textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  padding: 6px 8px;
  max-height: 120px;
  overflow-y: auto;
  scrollbar-width: thin;
}
textarea::placeholder { color: var(--text3); }

.input-btns { display: flex; gap: 6px; align-items: center; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.icon-btn.recording { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.15); animation: recGlow 0.8s ease-in-out infinite; }
@keyframes recGlow {
  0%,100%{ box-shadow: 0 0 8px rgba(239,68,68,0.4); transform: scale(1); }
  50%{ box-shadow: 0 0 20px rgba(239,68,68,0.7); transform: scale(1.05); }
}

/* Speaker button active state */
.icon-btn.speaking { border-color: var(--green); color: var(--green); background: rgba(16,185,129,0.15); animation: speakGlow 1.2s ease-in-out infinite; }
.icon-btn.speaking svg { animation: speakPulse 0.6s ease-in-out infinite; }
@keyframes speakGlow {
  0%,100%{ box-shadow: 0 0 8px rgba(16,185,129,0.4); }
  50%{ box-shadow: 0 0 18px rgba(16,185,129,0.6); }
}
@keyframes speakPulse {
  0%,100%{ opacity: 1; }
  50%{ opacity: 0.6; }
}

/* TTS active state - green to match JS initialization */
.icon-btn.tts-active { border-color: var(--green); color: var(--green); background: rgba(16,185,129,0.15); }
.icon-btn.tts-active:hover { border-color: var(--green); color: var(--green); }
.icon-btn.upload-btn { color: #94a3b8; }
.icon-btn.upload-btn:hover { border-color: #a78bfa; color: #a78bfa; }
.icon-btn.upload-btn.has-file { border-color: #a78bfa; color: #a78bfa; background: rgba(124,58,237,0.18); animation: uploadGlow 1.5s ease-in-out infinite; }
@keyframes uploadGlow { 0%,100%{box-shadow:0 0 0 0 rgba(124,58,237,0);} 50%{box-shadow:0 0 8px 2px rgba(124,58,237,0.35);} }

/* Voice wave animation for mic button when active */
.mic-btn.active-wave { position: relative; }
.mic-btn.active-wave::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  border: 2px solid var(--red);
  animation: voiceWave 1s ease-out infinite;
}
@keyframes voiceWave {
  0%{ transform: scale(1); opacity: 0.8; }
  100%{ transform: scale(1.8); opacity: 0; }
}

.send-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--grad-brand);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--blue-glow);
}
.send-btn svg { width: 16px; height: 16px; }
.send-btn:hover { transform: scale(1.07); box-shadow: 0 0 24px var(--blue-glow); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px 0;
}
.voice-status { font-size: 11px; color: var(--red); }
.input-tip { font-size: 10px; color: var(--text3); }

/* ── MODAL ────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: none;
  backdrop-filter: blur(4px);
}
.overlay.show { display: block; }

.modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.9);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 28px;
  z-index: 101;
  width: min(700px, 90vw);
  display: none;
  animation: modalIn 0.3s cubic-bezier(0.2,0,0.3,1);
}
.modal.show { display: block; transform: translate(-50%,-50%) scale(1); }
@keyframes modalIn { from { transform:translate(-50%,-50%) scale(0.9); opacity:0; } to { transform:translate(-50%,-50%) scale(1); opacity:1; } }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN — Full Mobile / Tablet / Desktop
   ══════════════════════════════════════════════════════════ */

/* ── LARGE TABLETS (≤1024px) ── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
  .intro-card { max-width: 600px; }
  .msg-row { max-width: 700px; }
}

/* ── TABLETS + MOBILE (≤768px) ── */
@media (max-width: 768px) {

  /* Sidebar — slide in from left, overlay behind */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
    width: 270px !important;
    box-shadow: 6px 0 40px rgba(0,0,0,0.6);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  }
  .sidebar.open { transform: translateX(0); }

  /* Sidebar toggle button — show on mobile */
  .sidebar-toggle { display: flex; }

  /* Overlay sits below sidebar but above content */
  .overlay.show { z-index: 150 !important; }

  /* Prevent background scroll when sidebar open */
  body.sidebar-open { overflow: hidden; }

  /* Topbar */
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  /* Phase tracker — hide labels, shrink dividers */
  .phase-lbl  { display: none; }
  .phase-divider { width: 8px; }
  .phase-num  { width: 20px; height: 20px; font-size: 9px; }
  .phase-item { gap: 4px; }

  /* Topbar right — tighter spacing */
  .topbar-right { gap: 6px !important; }
  .topbar-global-btn { padding: 5px 10px !important; font-size: 0.72rem !important; }
  .agent-voice-toggle { padding: 5px 10px !important; font-size: 0.72rem !important; }

  /* Chat window */
  .chat-window { padding: 14px 12px 8px; gap: 14px; }
  .msg-row { max-width: 100%; }

  /* Intro card */
  .intro-card { padding: 24px 20px; }
  .intro-card h2 { font-size: 21px; }
  .feature-grid { grid-template-columns: 1fr; }

  /* Stats grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Input zone */
  .input-zone { padding: 0 12px 14px; }
  .input-tip  { display: none; }

  /* Tables in bubbles — make scrollable */
  .msg-bubble { overflow-x: auto; }
  .msg-bubble table { min-width: 360px; }
}

/* ── PHONES (≤480px) ── */
@media (max-width: 480px) {

  /* Topbar — aggressive shrink */
  .topbar { padding: 8px 10px; gap: 6px; }

  /* Hide model badge on small screens */
  .model-badge { display: none; }

  /* Phase tracker — smaller */
  .phase-track { flex: 1; min-width: 0; gap: 3px; }
  .phase-divider { width: 5px; }
  .phase-num { width: 18px; height: 18px; font-size: 8px; }

  /* Topbar buttons — icon-only mode */
  .topbar-global-btn .global-btn-text { display: none; }
  #voiceModeLabel { display: none; }
  .topbar-global-btn { padding: 5px 8px !important; }
  .agent-voice-toggle { padding: 5px 8px !important; }

  /* Intro card */
  .intro-card {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
    margin: 0 4px;
  }
  .intro-card h2 { font-size: 18px; }
  .intro-icon { width: 46px; height: 46px; font-size: 22px; margin-bottom: 14px; }
  .intro-card p { font-size: 13px; }
  .intro-card > .feature-grid { margin-bottom: 16px; }
  .feature-item { padding: 7px 10px; font-size: 11px; }

  /* Chat messages */
  .msg-bubble { padding: 10px 12px; font-size: 13px; }
  .msg-avatar { width: 30px; height: 30px; font-size: 13px; }
  .msg-row { gap: 8px; }

  /* College result cards */
  .college-result-card { padding: 10px 12px; gap: 10px; }
  .crc-name  { font-size: 13px; }
  .crc-icon  { font-size: 20px; }
  .crc-meta  { font-size: 10px; gap: 6px; }

  /* Stats — tighter */
  .stat-val  { font-size: 16px; }
  .stat-lbl  { font-size: 9px; }
  .stats-grid { gap: 6px; }

  /* Input area */
  .icon-btn  { width: 34px; height: 34px; }
  .icon-btn svg { width: 14px; height: 14px; }
  .send-btn  { width: 34px; height: 34px; }
  .send-btn svg { width: 14px; height: 14px; }
  .input-card { padding: 8px 8px 6px; border-radius: var(--radius-lg); }
  .input-zone { padding: 0 8px 10px; }
  .hint-chip  { font-size: 10px; padding: 3px 9px; }

  /* Quick search buttons */
  .quick-btn { font-size: 11px; padding: 6px 10px; }

  /* Sidebar logo — compact */
  .sidebar-logo { padding: 18px 16px 14px; gap: 10px; }
  .logo-title   { font-size: 16px; }
  .sidebar-section { padding: 14px 16px; }

  /* Suggest chips */
  .suggest-chip { font-size: 11px; padding: 5px 11px; }

  /* Profile header */
  .profile-name { font-size: 16px; }

  /* Voice mode page mic button */
  .vmp-mic-btn  { width: 64px; height: 64px; }

  /* Crawl card */
  .crawl-card   { padding: 16px 16px; }
}

/* ── VERY SMALL PHONES (≤360px) ── */
@media (max-width: 360px) {

  /* Hide phase tracker entirely */
  .phase-track  { display: none; }
  .topbar       { justify-content: space-between; }

  /* Topbar — minimal */
  .topbar-global-btn { display: none !important; }

  /* Intro card */
  .intro-card   { padding: 14px 12px; }
  .intro-card h2 { font-size: 16px; }

  /* Msg bubble */
  .msg-bubble   { font-size: 12.5px; padding: 9px 11px; }

  /* Hint chips — smaller */
  .hint-chip    { font-size: 9.5px; padding: 3px 8px; }

  /* Input btns */
  .icon-btn, .send-btn { width: 30px; height: 30px; }
  .input-row { gap: 4px; }
}

/* ── ENSURE TABLES ARE ALWAYS SCROLLABLE ON MOBILE ── */
@media (max-width: 768px) {
  .info-section { overflow-x: auto; }
  .info-row { flex-wrap: wrap; }
  .info-val { text-align: left; }

  /* College badge in sidebar */
  .badge-name { font-size: 12px; }
  .badge-loc  { font-size: 10px; }

  /* Action buttons in sidebar */
  .action-btn { font-size: 11px; padding: 7px 12px; }

  /* Chart card */
  .chart-card { max-height: 200px; }

  /* Modal responsive */
  .modal { padding: 20px; border-radius: var(--radius-lg); }
}

/* ── LANDSCAPE PHONE FIX ── */
@media (max-height: 500px) and (orientation: landscape) {
  .chat-window { padding: 8px 12px; gap: 10px; }
  .input-zone  { padding: 0 12px 8px; }
  .topbar      { padding: 6px 12px; }
  .intro-icon  { display: none; }
  .intro-card  { padding: 14px 16px; }
  .intro-card h2 { font-size: 17px; margin-bottom: 4px; }
  .sidebar     { width: 240px !important; }
}

/* ── DESKTOP SAFETY (≥1440px) ── */
@media (min-width: 1440px) {
  .chat-window { padding: 28px 32px 20px; }
  .input-zone  { padding: 0 32px 24px; }
  .msg-row     { max-width: 900px; }
}

/* ── ANIMATIONS & UTILITIES ───────────────────────── */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.slide-up { animation: slideUp 0.4s cubic-bezier(0.2,0,0.3,1); }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

.glow-text { background: var(--grad-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--blue);
}

.success-tag { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.2); color: var(--green); }
.warning-tag { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.2); color: var(--gold); }

/* profile header */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.profile-emblem {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 20px var(--blue-glow);
  flex-shrink: 0;
}
.profile-name { font-family:'Playfair Display',serif; font-size:17px; font-weight:700; line-height:1.2; }
.profile-tagline { font-size:12px; color:var(--text2); margin-top:3px; }

/* Courses grid */
.courses-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.course-tag {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text2);
}

/* Success box */
.success-box {
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--green);
  margin-top: 10px;
}

/* ══════════════════════════════════════════════════════════
   PREMIUM VOICE MODE STYLES — Agent Voice + WhisperFlow
   ══════════════════════════════════════════════════════════ */

/* Voice Mode Button — Copilot-style Agent Voice toggle */
.voice-mode-btn {
  position: relative;
  overflow: visible;
}

/* ── PROMINENT AGENT VOICE MODE BUTTON IN TOPBAR ── */
.agent-voice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: #a78bfa;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
}

.agent-voice-toggle:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(59, 130, 246, 0.2));
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.agent-voice-toggle.voice-active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(59, 130, 246, 0.3));
  border-color: rgba(124, 58, 237, 0.7);
  color: #fff;
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.5);
  animation: voiceTogglePulse 2s ease-in-out infinite;
}

@keyframes voiceTogglePulse {
  0%, 100% { box-shadow: 0 0 25px rgba(124, 58, 237, 0.5); }
  50% { box-shadow: 0 0 40px rgba(124, 58, 237, 0.7), 0 0 60px rgba(59, 130, 246, 0.3); }
}

/* ── MESSAGE PLAY BUTTONS ── */
.msg-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 0 4px;
}

.msg-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--blue);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.msg-play-btn svg {
  width: 12px;
  height: 12px;
}

.msg-play-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.msg-play-btn.playing {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--green);
  animation: playingPulse 1s ease-in-out infinite;
}

@keyframes playingPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.5); }
}

.voice-mode-btn.agent-voice-active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(59, 130, 246, 0.25));
  border-color: rgba(124, 58, 237, 0.6);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
  animation: voiceModePulse 2s ease-in-out infinite;
}

@keyframes voiceModePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(124, 58, 237, 0.4); }
  50% { box-shadow: 0 0 35px rgba(124, 58, 237, 0.6), 0 0 60px rgba(59, 130, 246, 0.3); }
}

.voice-mode-btn.agent-voice-active svg {
  stroke: #a78bfa;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.6));
}

/* WhisperFlow wave animation */
@keyframes whisperWave {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Agent Speaking Indicator */
.agent-speaking-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  color: #a78bfa;
  margin: 8px 0;
  width: fit-content;
  animation: fadeIn 0.3s ease;
}

.asi-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  animation: pulseDot 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

.asi-stop {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 10px;
  cursor: pointer;
  margin-left: 4px;
  font-family: 'Outfit', sans-serif;
  transition: all 0.2s;
}

.asi-stop:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Premium Input Zone Enhancement */
.input-card.premium {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Voice mode active input glow */
.input-card.voice-active {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), 0 0 40px rgba(124, 58, 237, 0.1);
}

/* Wave ring for mic button */
.wave-ring {
  pointer-events: none;
}

/* Premium glass effect on chat bubbles in voice mode */
.msg-bubble.voice-mode {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(59, 130, 246, 0.05));
  border-color: rgba(124, 58, 237, 0.2);
}

/* Voice input visual feedback — typing indicator glow */
.t-dot.voice-glow {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

/* ── Premium Sidebar Enhancements ── */
.sidebar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: radial-gradient(ellipse at bottom, rgba(124, 58, 237, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Premium phase tracker ── */
.phase-item.active .phase-num {
  background: linear-gradient(135deg, var(--violet), var(--blue));
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
}

/* ── Premium Top Bar ── */
.topbar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: radial-gradient(ellipse at top, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Premium scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 58, 237, 0.3); }

/* ── Premium message animations ── */
.msg-row.bot.premium-msg {
  position: relative;
}

.msg-row.bot.premium-msg::before {
  content: '';
  position: absolute;
  left: 18px;
  top: -10px;
  width: 40px;
  height: 20px;
  background: linear-gradient(to right, transparent, rgba(124, 58, 237, 0.1));
  filter: blur(10px);
  border-radius: 50%;
}

/* ── Voice mode indicator in topbar ── */
.voice-mode-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #a78bfa;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
}

.voice-mode-active-badge .vab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet);
  animation: pulseDot 1.5s ease-in-out infinite;
}

/* ── Agent Avatar Enhancement in Voice Mode ── */
.msg-avatar.bot.agent-speaking {
  background: linear-gradient(135deg, var(--violet), var(--blue));
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.5);
  animation: avatarGlow 1.5s ease-in-out infinite;
}

@keyframes avatarGlow {
  0%, 100% { box-shadow: 0 0 25px rgba(124, 58, 237, 0.5); }
  50% { box-shadow: 0 0 40px rgba(124, 58, 237, 0.8), 0 0 60px rgba(59, 130, 246, 0.3); }
}

/* ── Premium College Profile ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
}

.profile-header::after {
  content: '';
  position: absolute;
  left: 26px;
  bottom: -10px;
  width: 70px;
  height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--blue), var(--cyan));
  border-radius: 2px;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
}

.profile-emblem {
  width: 54px; height: 54px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--violet), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5), inset 0 2px 10px rgba(255,255,255,0.1);
  flex-shrink: 0;
  position: relative;
}

.profile-emblem::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: calc(var(--radius-md) - 2px);
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
}

.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-tagline {
  font-size: 12px;
  color: var(--text2);
  margin-top: 3px;
  font-style: italic;
}

/* ── Premium Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat-card {
  background: linear-gradient(145deg, var(--surface2), var(--surface3));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.18);
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  border-radius: 0 0 4px 4px;
}

.stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--blue);
  display: block;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ── Premium Highlight Items ── */
.highlights-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
  padding: 8px 6px;
  border-bottom: 1px solid rgba(100, 180, 255, 0.05);
  transition: all 0.25s;
}

.highlight-item:hover {
  padding-left: 10px;
  background: rgba(124, 58, 237, 0.04);
  border-radius: 6px;
}

.highlight-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  flex-shrink: 0;
  margin-top: 6px;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
}

.highlight-item:last-child {
  border-bottom: none;
}

/* ── Premium Info Sections ── */
.info-section {
  background: linear-gradient(145deg, var(--surface2), rgba(16, 24, 40, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

.info-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.35), transparent);
}

.info-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-section-title::before {
  content: '';
  width: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--blue));
  border-radius: 1px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid rgba(100, 180, 255, 0.05);
  font-size: 13px;
  gap: 12px;
  transition: all 0.2s;
}

.info-row:hover {
  padding-left: 8px;
  background: rgba(59, 130, 246, 0.03);
}

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

.info-key {
  color: var(--text2);
  flex-shrink: 0;
  font-weight: 500;
}

.info-val {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* ── Premium College Result Cards ── */
.college-result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(145deg, var(--surface2), var(--surface3));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.college-result-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--violet), var(--blue));
  opacity: 0;
  transition: opacity 0.3s;
}

.college-result-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.06), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.college-result-card:hover {
  border-color: rgba(124, 58, 237, 0.45);
  transform: translateX(8px);
  box-shadow: 0 12px 45px rgba(124, 58, 237, 0.18), 0 4px 20px rgba(0, 0, 0, 0.35);
}

.college-result-card:hover::before {
  opacity: 1;
}

.college-result-card:hover::after {
  opacity: 1;
}

.crc-icon {
  font-size: 28px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.35));
}

.crc-info {
  flex: 1;
  min-width: 0;
}

.crc-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text);
}

.crc-meta {
  font-size: 11px;
  color: var(--text2);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.crc-url {
  font-size: 11px;
  color: var(--blue);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crc-arrow {
  color: var(--text3);
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.3s;
}

.college-result-card:hover .crc-arrow {
  color: var(--violet);
  transform: translateX(5px);
}

/* ── Premium Crawl Card ── */
.crawl-card {
  background: linear-gradient(145deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
}

.crawl-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--blue), var(--cyan));
  animation: scanLine 1.5s ease-in-out infinite;
}

.crawl-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* ── Premium Feature Grid ── */
.feature-item:hover {
  border-color: rgba(124, 58, 237, 0.45);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.06));
  transform: translateY(-2px);
}

.feature-item .fi-icon {
  font-size: 19px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}

/* ── Premium Suggestion Chips ── */
.suggest-chip {
  background: linear-gradient(135deg, var(--surface2), var(--surface3));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 15px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Outfit', sans-serif;
}

.suggest-chip:hover {
  border-color: rgba(124, 58, 237, 0.55);
  color: var(--violet);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(59, 130, 246, 0.09));
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.22);
}

/* ── Premium Link Items ── */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text2);
  font-size: 13px;
  transition: all 0.25s;
}

.link-item:hover {
  border-color: var(--violet);
  color: var(--violet);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), transparent);
  transform: translateX(5px);
}

.link-item .link-icon {
  font-size: 16px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.link-item .link-label {
  flex: 1;
  font-weight: 500;
}

.link-item .link-arrow {
  color: var(--violet);
  transition: all 0.3s;
}

.link-item:hover .link-arrow {
  transform: translateX(4px);
}

/* ── Premium Chart Card ── */
.chart-card {
  background: linear-gradient(145deg, var(--surface2), var(--surface3));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
  position: relative;
  max-height: 230px;
  overflow: hidden;
}

.chart-card:hover {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
}

.chart-card-title {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.expand-hint {
  font-size: 10px;
  color: var(--violet);
}

/* ── Premium Course Tags ── */
.courses-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.course-tag {
  background: linear-gradient(135deg, var(--surface3), var(--surface2));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  color: var(--text2);
  transition: all 0.25s;
}

.course-tag:hover {
  border-color: rgba(124, 58, 237, 0.35);
  color: var(--violet);
  background: rgba(124, 58, 237, 0.1);
}

/* ── Premium Success Box ── */
.success-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--green);
  margin-top: 12px;
  position: relative;
  padding-left: 24px;
}

.success-box::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 45%;
  background: linear-gradient(180deg, var(--green), var(--cyan));
  border-radius: 2px;
}

/* ── Premium Tags/Badges ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.13), rgba(124, 58, 237, 0.09));
  border: 1px solid rgba(59, 130, 246, 0.28);
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 11px;
  color: var(--blue);
  font-weight: 500;
  transition: all 0.25s;
}

.tag:hover {
  border-color: rgba(124, 58, 237, 0.45);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(59, 130, 246, 0.11));
}

/* ── Premium Send Button ── */
.send-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--violet), var(--blue));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  flex-shrink: 0;
  box-shadow: 0 0 22px rgba(124, 58, 237, 0.45);
}

.send-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 10px 35px rgba(124, 58, 237, 0.55);
}

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

/* ── Premium Intro Card ── */
.intro-card {
  background: linear-gradient(145deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  max-width: 720px;
  width: 100%;
  animation: msgIn 0.5s cubic-bezier(0.2, 0, 0.3, 1);
}

.intro-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--blue), var(--cyan));
}

.intro-glow {
  position: absolute;
  top: -75px;
  right: -75px;
  width: 230px;
  height: 230px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.16) 0%, transparent 70%);
  pointer-events: none;
}

.intro-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--violet), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 0 38px rgba(124, 58, 237, 0.55);
  margin-bottom: 22px;
}

/* ── Premium Logo ── */
.logo-icon-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  border-radius: var(--radius-md);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.55);
}

.logo-icon-ring {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--violet);
  border-radius: calc(var(--radius-md) + 4px);
  opacity: 0.55;
  animation: ringPulse 3s ease-in-out infinite;
}

/* ── Premium Sidebar Labels ── */
.sidebar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
/* ═══════════════════════════════════════════════════════
   VOICE MODE PAGE — v4 Full Fix
   ═══════════════════════════════════════════════════════ */

#voiceModePage {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #080f1e;
  display: flex;
  flex-direction: column;
  font-family: 'Outfit', sans-serif;
  color: #f1f5f9;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
#voiceModePage::before {
  content:'';position:absolute;inset:0;pointer-events:none;
  background: radial-gradient(ellipse 90% 55% at 50% -5%, rgba(124,58,237,.18) 0%, transparent 65%),
              radial-gradient(ellipse 55% 40% at 85% 90%, rgba(16,185,129,.09) 0%, transparent 60%);
}
#voiceModePage.vmp-open { transform: translateY(0); }

/* ── Header ── */
.vmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255,255,255,.045);
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  gap: 10px;
}
.vmp-logo { display:flex; align-items:center; gap:10px; }
.vmp-logo-icon { font-size:1.6rem; }
.vmp-logo-title { font-size:.95rem; font-weight:700; color:#f1f5f9; line-height:1.2; }
.vmp-mode-lbl { font-size:.75rem; color:#a78bfa; font-weight:600; margin-top:1px; }

.vmp-header-right { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

.vmp-mode-toggle { display:flex; background:rgba(255,255,255,.07); border-radius:8px; padding:3px; gap:2px; }
.vmp-mode-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all .2s;
  white-space: nowrap;
}
.vmp-mode-btn.active {
  background: linear-gradient(135deg,#7c3aed,#5b21b6);
  color: #fff;
  box-shadow: 0 2px 14px rgba(124,58,237,.45);
}
.vmp-mode-btn:disabled { opacity:.35; cursor:not-allowed; }

.vmp-lang-wrap { display:flex; align-items:center; gap:6px; }
.vmp-lang-icon { font-size:1rem; }
.vmp-lang-sel {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: #e2e8f0;
  padding: 6px 10px;
  font-size: .82rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  outline: none;
}
.vmp-lang-sel option { background:#1e293b; color:#e2e8f0; }

.vmp-exit-btn {
  padding: 7px 16px;
  background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.38);
  border-radius: 8px;
  color: #fca5a5;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all .2s;
  white-space: nowrap;
}
.vmp-exit-btn:hover { background: rgba(239,68,68,.28); }

/* ── Body (two-column layout) ── */
.vmp-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* ── Left column: Avatar + Mic ── */
.vmp-avatar-col {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 20px;
  border-right: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.18);
  gap: 10px;
}
.vmp-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vmp-avatar {
  width: 86px; height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg,#7c3aed,#5b21b6);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 0 32px rgba(124,58,237,.5);
  position: relative; z-index: 3;
  transition: box-shadow .3s;
}
.vmp-avatar.speaking {
  animation: avatarSpk 1.1s ease-in-out infinite;
  box-shadow: 0 0 55px rgba(16,185,129,.7);
}
@keyframes avatarSpk {
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.06); }
}
.vmp-ring {
  position: absolute; border-radius: 50%; border: 2px solid;
  animation: ringAnim 3.2s ease-in-out infinite;
}
.vmp-ring.r1 { inset:-9px; border-color:rgba(124,58,237,.45); animation-delay:0s; }
.vmp-ring.r2 { inset:-19px; border-color:rgba(124,58,237,.22); animation-delay:.42s; }
.vmp-ring.r3 { inset:-30px; border-color:rgba(124,58,237,.1); animation-delay:.84s; }
@keyframes ringAnim {
  0%,100%{ opacity:.5; transform:scale(1); }
  50%{ opacity:1; transform:scale(1.03); }
}
.vmp-ai-label { font-size:.82rem; font-weight:700; color:#e2e8f0; text-align:center; }
.vmp-status-lbl { font-size:.75rem; color:#64748b; min-height:18px; text-align:center; }

.vmp-mic-wrap { display:flex; flex-direction:column; align-items:center; gap:10px; margin-top:8px; }
.vmp-mic-btn {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg,rgba(124,58,237,.3),rgba(91,33,182,.22));
  border: 2px solid rgba(124,58,237,.55);
  color: #a78bfa;
  cursor: pointer;
  display: flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  transition: all .25s;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 22px rgba(124,58,237,.25);
}
.vmp-mic-btn svg { width:24px; height:24px; }
.vmp-mic-label { font-size:.6rem; font-weight:700; color:inherit; white-space:nowrap; }
.vmp-mic-btn:hover { transform:scale(1.06); box-shadow:0 6px 32px rgba(124,58,237,.5); border-color:rgba(124,58,237,.85); }
.vmp-mic-btn.recording {
  background: linear-gradient(135deg,rgba(239,68,68,.3),rgba(220,38,38,.22));
  border-color: rgba(239,68,68,.75);
  color: #fca5a5;
  animation: micPulseAnim 1s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(239,68,68,.55);
}
@keyframes micPulseAnim { 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.07); } }
.vmp-mic-hint { font-size:.68rem; color:#475569; text-align:center; max-width:130px; line-height:1.4; }

/* ── Right column: Chat ── */
.vmp-chat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vmp-chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.vmp-chat-scroll::-webkit-scrollbar { width:4px; }
.vmp-chat-scroll::-webkit-scrollbar-thumb { background:rgba(255,255,255,.12); border-radius:2px; }

/* ── Messages ── */
.vmp-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: msgSlide .28s ease-out;
}
@keyframes msgSlide { from{ opacity:0; transform:translateY(10px); } to{ opacity:1; transform:translateY(0); } }

.vmp-msg.ai  { justify-content: flex-start; }
.vmp-msg.user{ justify-content: flex-end; }

.vmp-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items:center; justify-content:center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ai-av   { background: linear-gradient(135deg,#7c3aed,#5b21b6); box-shadow:0 2px 12px rgba(124,58,237,.4); }
.user-av { background: linear-gradient(135deg,#1d4ed8,#1e40af); }

.vmp-bubble-wrap { max-width:76%; display:flex; flex-direction:column; gap:6px; }
.user-wrap { align-items:flex-end; }

/* ── AI Bubble — highly readable ── */
.vmp-bubble {
  padding: 13px 16px;
  border-radius: 16px 16px 16px 4px;
  font-size: .92rem;
  line-height: 1.7;
  word-break: break-word;
}
.ai-bubble {
  background: #1e2a3d;      /* solid dark navy — readable */
  border: 1px solid rgba(124,58,237,.3);
  color: #f1f5f9;           /* bright white text */
}
.user-bubble {
  background: linear-gradient(135deg,rgba(124,58,237,.35),rgba(91,33,182,.28));
  border: 1px solid rgba(124,58,237,.45);
  color: #f1f5f9;
  border-radius: 16px 16px 4px 16px;
  text-align: right;
}

/* ── Rich text inside AI bubble ── */
.ai-bubble p   { margin:0 0 10px; color:#f1f5f9; }
.ai-bubble p:last-child { margin:0; }
.ai-bubble strong, .ai-bubble b { color:#a78bfa; font-weight:700; }
.ai-bubble em, .ai-bubble i { color:#93c5fd; font-style:italic; }
.ai-bubble h1,.ai-bubble h2,.ai-bubble h3,.ai-bubble h4 {
  color:#c4b5fd; margin:10px 0 6px; font-weight:700; line-height:1.3;
}
.ai-bubble h1 { font-size:1.1rem; }
.ai-bubble h2 { font-size:1rem; }
.ai-bubble h3 { font-size:.93rem; }
.ai-bubble ul, .ai-bubble ol {
  padding-left: 18px; margin: 8px 0; color:#f1f5f9;
}
.ai-bubble li { margin-bottom:4px; line-height:1.65; color:#f1f5f9; }
.ai-bubble li::marker { color:#a78bfa; }
.ai-bubble code {
  background: rgba(124,58,237,.22);
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .84em;
  color: #c4b5fd;
  font-family: monospace;
}
.ai-bubble pre {
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(124,58,237,.25);
  border-radius: 8px;
  padding: 10px 14px;
  overflow-x: auto;
  margin: 8px 0;
}
.ai-bubble pre code { background:none; border:none; padding:0; color:#86efac; font-size:.85em; }
.ai-bubble table {
  width: 100%; border-collapse: collapse; margin: 8px 0; font-size:.85rem;
}
.ai-bubble th {
  background: rgba(124,58,237,.3); color:#e2e8f0; padding:7px 10px;
  border: 1px solid rgba(124,58,237,.35); text-align:left;
}
.ai-bubble td {
  padding: 6px 10px; border: 1px solid rgba(255,255,255,.1); color:#f1f5f9;
}
.ai-bubble tr:nth-child(even) td { background: rgba(255,255,255,.04); }
.ai-bubble a { color:#60a5fa; text-decoration:underline; }
.ai-bubble blockquote {
  border-left: 3px solid #7c3aed; margin:8px 0; padding:6px 12px;
  background:rgba(124,58,237,.1); border-radius:0 8px 8px 0; color:#cbd5e1;
}
.ai-bubble hr { border:none; border-top:1px solid rgba(255,255,255,.1); margin:10px 0; }

/* Typing dots inside VMS */
.vmp-typing { display:flex; align-items:center; gap:5px; padding:14px 18px !important; }
.vmp-typing .t-dot {
  width:8px; height:8px; border-radius:50%; background:#a78bfa;
  animation:dotBounce 1.2s ease-in-out infinite;
}
.vmp-typing .t-dot:nth-child(2){ animation-delay:.2s; }
.vmp-typing .t-dot:nth-child(3){ animation-delay:.4s; }
@keyframes dotBounce{ 0%,80%,100%{transform:scale(.7);opacity:.5;} 40%{transform:scale(1.1);opacity:1;} }

/* Listen again button */
.vmp-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: rgba(16,185,129,.13);
  border: 1px solid rgba(16,185,129,.32);
  border-radius: 20px;
  color: #34d399;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all .2s;
  align-self: flex-start;
}
.vmp-listen-btn:hover { background:rgba(16,185,129,.25); border-color:rgba(16,185,129,.6); }
.vmp-listen-btn svg { width:13px; height:13px; }

/* ── Text input row ── */
.vmp-text-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.22);
  flex-shrink: 0;
}
.vmp-text-inp {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 11px 16px;
  color: #f1f5f9;
  font-size: .9rem;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: border-color .2s;
}
.vmp-text-inp::placeholder { color: #475569; }
.vmp-text-inp:focus { border-color: rgba(124,58,237,.6); background:rgba(255,255,255,.1); }

.vmp-send-btn {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg,#7c3aed,#5b21b6);
  border: none; color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  flex-shrink: 0; transition:all .2s;
  box-shadow: 0 3px 14px rgba(124,58,237,.4);
}
.vmp-send-btn svg { width:17px; height:17px; }
.vmp-send-btn:hover { transform:scale(1.05); box-shadow:0 5px 20px rgba(124,58,237,.65); }

.vmp-status-bar {
  padding: 7px 16px;
  font-size: .75rem;
  color: #475569;
  background: rgba(0,0,0,.2);
  border-top: 1px solid rgba(255,255,255,.05);
  text-align: center;
  flex-shrink: 0;
}

/* ── Per-message listen button (main chat) ── */
.msg-listen-row { display:flex; align-items:center; margin-top:6px; }
.msg-listen-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(16,185,129,.09);
  border: 1px solid rgba(16,185,129,.28);
  border-radius: 20px;
  color: #34d399;
  font-size: .73rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all .2s;
}
.msg-listen-icon-btn:hover { background:rgba(16,185,129,.2); border-color:rgba(16,185,129,.55); }
.msg-listen-icon-btn svg { width:12px; height:12px; }

/* ── Responsive ── */
@media(max-width:640px){
  .vmp-body { flex-direction:column; }
  .vmp-avatar-col {
    width:100%; border-right:none; border-bottom:1px solid rgba(255,255,255,.07);
    flex-direction:row; padding:14px 16px; justify-content:center; gap:20px;
  }
  .vmp-avatar-wrap { width:68px; height:68px; }
  .vmp-avatar { width:60px; height:60px; font-size:1.7rem; }
  .vmp-mic-wrap { margin-top:0; }
  .vmp-mic-btn { width:60px; height:60px; }
  .vmp-mic-btn svg { width:20px; height:20px; }
  .vmp-bubble-wrap { max-width:90%; }
  .vmp-header { padding:10px 14px; }
}

/* ══════════════════════════════════════════
   v5 ADDITIONS — New VMP Buttons & Upload
   ══════════════════════════════════════════ */

/* Generic action buttons in VMP header */
.vmp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: #94a3b8;
  transition: all 0.2s;
  white-space: nowrap;
}
.vmp-action-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3);
  color: #e2e8f0;
  transform: translateY(-1px);
}

/* Upload button */
.vmp-upload-btn {
  border-color: rgba(124,58,237,0.4) !important;
  color: #a78bfa !important;
  background: rgba(124,58,237,0.1) !important;
}
.vmp-upload-btn:hover {
  background: rgba(124,58,237,0.22) !important;
  border-color: rgba(124,58,237,0.7) !important;
  color: #c4b5fd !important;
}

/* PDF export button */
.vmp-pdf-btn {
  border-color: rgba(59,130,246,0.4) !important;
  color: #60a5fa !important;
  background: rgba(59,130,246,0.08) !important;
}
.vmp-pdf-btn:hover {
  background: rgba(59,130,246,0.2) !important;
  border-color: rgba(59,130,246,0.65) !important;
  color: #93c5fd !important;
}

/* Stop voice button in header (shown while AI speaks) */
.vmp-stop-voice-btn {
  border-color: rgba(239,68,68,0.45) !important;
  color: #f87171 !important;
  background: rgba(239,68,68,0.1) !important;
  animation: stopBtnPulse 1.5s ease-in-out infinite;
}
.vmp-stop-voice-btn:hover {
  background: rgba(239,68,68,0.25) !important;
  border-color: rgba(239,68,68,0.8) !important;
  color: #fca5a5 !important;
}
@keyframes stopBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 10px 2px rgba(239,68,68,0.35); }
}

/* Stop inline button in AI message bubbles */
.vmp-stop-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.28);
  border-radius: 20px;
  color: #f87171;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: all 0.2s;
}
.vmp-stop-inline-btn:hover {
  background: rgba(239,68,68,0.22);
  border-color: rgba(239,68,68,0.6);
  color: #fca5a5;
}

/* College mode button disabled state */
.vmp-mode-btn:disabled {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Upload preview area */
#vmpUploadPreview {
  animation: fadeSlideIn 0.25s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive tweaks for new buttons ── */
@media(max-width:720px) {
  .vmp-action-btn { padding: 5px 8px; font-size: 0.72rem; }
  .vmp-header-right { gap: 6px; }
}
@media(max-width:520px) {
  .vmp-pdf-btn { display: none; } /* hide PDF on very small screens, accessible via other means */
}
