/* ===== AI TUTOR V3 — FIGMA-QUALITY REDESIGN ===== */

/* ===== NAV XP BADGE ===== */
.nav-xp {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #1a1a2e; font-weight: 900; font-size: 0.8rem;
  padding: 0.3rem 0.8rem; border-radius: 50px;
}

/* ===== XP POPUP ===== */
.xp-popup {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem; font-weight: 900;
  color: #fbbf24; text-shadow: 0 4px 16px rgba(251,191,36,0.5);
  z-index: 500; pointer-events: none;
}
.xp-popup.show {
  display: block;
  animation: xpBurst 1.2s ease-out forwards;
}
@keyframes xpBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  30% { transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

/* ===== COMBO COUNTER ===== */
.combo-counter {
  display: none; position: fixed; top: 80px; right: 20px;
  background: linear-gradient(135deg, #1a1a2e, #2d1b69);
  border-radius: 16px; padding: 0.8rem 1.2rem;
  text-align: center; z-index: 100;
  border: 2px solid rgba(251,191,36,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.combo-counter.show { display: block; animation: comboSlide 0.3s ease; }
@keyframes comboSlide {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.combo-number {
  font-size: 2rem; font-weight: 900; color: #fbbf24;
  line-height: 1; text-shadow: 0 2px 8px rgba(251,191,36,0.4);
}
.combo-label {
  font-size: 0.65rem; font-weight: 900; letter-spacing: 2px;
  color: rgba(255,255,255,0.6); margin-top: 0.1rem;
}
.combo-fire { font-size: 0.8rem; margin-top: 0.2rem; }

/* ===== LAYOUT ===== */
.tutor-layout-v2 {
  display: grid; grid-template-columns: 300px 1fr;
  height: calc(100vh - 60px);
}

/* ===== SIDEBAR ===== */
.tutor-sidebar-v2 {
  background: linear-gradient(180deg, #f0f1ff 0%, #e8eaff 50%, #f5f0ff 100%);
  border-right: 1px solid rgba(91,94,244,0.12);
  padding: 1rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.8rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(91,94,244,0.15) transparent;
}
.tutor-sidebar-v2::-webkit-scrollbar { width: 4px; }
.tutor-sidebar-v2::-webkit-scrollbar-thumb {
  background: rgba(91,94,244,0.15); border-radius: 4px;
}

/* ===== GYANI CHARACTER CARD ===== */
.gyani-card {
  text-align: center; padding: 1.5rem 1rem 1.2rem;
  background: white;
  border-radius: 20px;
  border: 1px solid rgba(91,94,244,0.08);
  box-shadow: 0 4px 24px rgba(91,94,244,0.08), 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.gyani-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 80px;
  background: linear-gradient(135deg, rgba(91,94,244,0.06), rgba(114,9,183,0.04));
  border-radius: 20px 20px 50% 50%;
}
.gyani-avatar {
  position: relative; width: 100px; height: 100px; margin: 0 auto 0.75rem;
  z-index: 1;
}
.gyani-lottie-container {
  width: 100px; height: 100px;
  border-radius: 50%;
  overflow: visible;
  animation: gyaniFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 6px 20px rgba(91,94,244,0.25));
}
.teacher-avatar-wrap {
  --avatar-scale: 1;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.28)),
    radial-gradient(circle at 50% 22%, #dbeafe 0 32%, #eef2ff 33% 100%);
  border: 3px solid #ffffff;
  box-shadow: inset 0 -10px 22px rgba(91,94,244,0.1), 0 10px 26px rgba(91,94,244,0.16);
  overflow: hidden;
  position: relative;
}
.teacher-avatar-wrap.compact {
  --avatar-scale: 0.48;
  width: 46px;
  height: 46px;
  border-width: 2px;
  box-shadow: inset 0 -5px 12px rgba(91,94,244,0.1);
}
.teacher-cb-avatar {
  background: #eef2ff;
  overflow: hidden;
  border-radius: 12px;
}
.teacher-cb-avatar .teacher-avatar {
  transform: scale(0.38) translateY(8px);
}
.teacher-avatar-wrap.tiny {
  --avatar-scale: 0.38;
  width: 36px;
  height: 36px;
  border: 0;
  box-shadow: none;
}
.teacher-avatar {
  width: 86px;
  height: 102px;
  position: relative;
  transform: scale(var(--avatar-scale));
  transform-origin: center bottom;
}
.teacher-hair {
  position: absolute;
  left: 22px;
  top: 6px;
  width: 45px;
  height: 50px;
  border-radius: 24px 24px 18px 18px;
  background: #23202a;
  box-shadow: -9px 13px 0 #23202a, 9px 13px 0 #23202a;
}
.teacher-face {
  position: absolute;
  left: 25px;
  top: 16px;
  width: 38px;
  height: 44px;
  border-radius: 18px 18px 20px 20px;
  background: #c88458;
  box-shadow: inset 0 -5px 0 rgba(127,67,38,0.13);
  z-index: 2;
}
.teacher-ear {
  position: absolute;
  top: 33px;
  width: 8px;
  height: 12px;
  border-radius: 50%;
  background: #bd7a50;
  z-index: 1;
}
.teacher-ear.left { left: 20px; }
.teacher-ear.right { right: 18px; }
.teacher-bindi {
  position: absolute;
  left: 18px;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #be123c;
}
.teacher-eye {
  position: absolute;
  top: 20px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1f2937;
  transform: translate(var(--eye-x, 0), var(--eye-y, 0));
}
.teacher-eye.left { left: 10px; }
.teacher-eye.right { right: 10px; }
.teacher-smile {
  position: absolute;
  left: 13px;
  top: 30px;
  width: 13px;
  height: 7px;
  border-bottom: 3px solid #7f1d1d;
  border-radius: 0 0 14px 14px;
}
.teacher-neck {
  position: absolute;
  left: 36px;
  top: 55px;
  width: 16px;
  height: 15px;
  background: #b9734b;
  z-index: 1;
}
.teacher-sari {
  position: absolute;
  left: 15px;
  top: 66px;
  width: 58px;
  height: 42px;
  border-radius: 22px 22px 8px 8px;
  background: linear-gradient(135deg, #2563eb 0 52%, #1d4ed8 53% 100%);
  z-index: 2;
}
.teacher-dupatta {
  position: absolute;
  left: 5px;
  top: -2px;
  width: 48px;
  height: 45px;
  border-radius: 20px 8px 18px 8px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  clip-path: polygon(0 0, 70% 0, 44% 100%, 0 100%);
  opacity: 0.95;
}
.teacher-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fef3c7;
  border: 2px solid #f59e0b;
}
.teacher-hand {
  position: absolute;
  right: 7px;
  top: 70px;
  width: 11px;
  height: 28px;
  border-radius: 10px;
  background: #bd7a50;
  transform: rotate(-30deg);
  transform-origin: top center;
  z-index: 3;
}
.teacher-chalk {
  position: absolute;
  right: 0;
  top: 62px;
  width: 17px;
  height: 4px;
  border-radius: 999px;
  background: #f8fafc;
  transform: rotate(-18deg);
  z-index: 4;
}
.teacher-avatar-wrap[data-mood="thinking"] .teacher-eye {
  height: 3px;
}
.teacher-avatar-wrap[data-mood="teaching"] .teacher-hand,
.teacher-avatar-wrap[data-mood="excited"] .teacher-hand {
  animation: chalkPoint 1s ease-in-out infinite;
}
.teacher-avatar-wrap[data-mood="teaching"] .teacher-chalk,
.teacher-avatar-wrap[data-mood="excited"] .teacher-chalk {
  animation: chalkWrite 1s ease-in-out infinite;
}
.teacher-avatar-wrap[data-mood="happy"] .teacher-smile,
.teacher-avatar-wrap[data-mood="proud"] .teacher-smile,
.teacher-avatar-wrap[data-mood="encouraging"] .teacher-smile {
  width: 16px;
  left: 11px;
}
@keyframes chalkPoint {
  0%, 100% { transform: rotate(-30deg) translateY(0); }
  50% { transform: rotate(-42deg) translateY(-3px); }
}
@keyframes chalkWrite {
  0%, 100% { transform: rotate(-18deg) translate(0, 0); }
  50% { transform: rotate(-18deg) translate(4px, -3px); }
}
.gyani-face {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, #5b5ef4, #7c3aed, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  box-shadow: 0 8px 28px rgba(91,94,244,0.35), inset 0 -2px 6px rgba(0,0,0,0.1);
  animation: gyaniFloat 3s ease-in-out infinite;
  border: 3px solid white;
}
@keyframes gyaniFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.gyani-mood-bar {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.72rem; font-weight: 700; color: #64748b;
}
.mood-label { color: #94a3b8; }
.mood-emoji { font-size: 1rem; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.mood-text { color: #5b5ef4; font-weight: 800; }
.gyani-name {
  font-size: 1.15rem; font-weight: 900; color: #1e1b4b;
  margin-bottom: 0.1rem; position: relative;
}
.gyani-title {
  font-size: 0.76rem; color: #7c7c9a;
  margin-bottom: 0.6rem; font-weight: 600;
}
.gyani-status {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.72rem; font-weight: 700; color: #059669;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  padding: 0.3rem 0.75rem; border-radius: 50px;
  border: 1px solid rgba(5,150,105,0.15);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #06d6a0;
  box-shadow: 0 0 6px rgba(6,214,160,0.5);
  animation: statusPulse 2s ease infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== SESSION STATS ===== */
.session-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}
.ss-item {
  text-align: center; padding: 0.65rem 0.3rem;
  background: white; border-radius: 14px;
  border: 1px solid rgba(91,94,244,0.08);
  box-shadow: 0 2px 8px rgba(91,94,244,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.ss-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(91,94,244,0.1);
}
.ss-icon { font-size: 1.1rem; display: block; margin-bottom: 0.15rem; }
.ss-val {
  font-size: 1.15rem; font-weight: 900; display: block; line-height: 1.2;
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ss-label {
  font-size: 0.58rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ===== WEEKLY USAGE TRACKER ===== */
.weekly-usage-card {
  background: white;
  border: 1px solid rgba(91,94,244,0.08);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 2px 12px rgba(91,94,244,0.05);
}
.wu-header {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.wu-icon { font-size: 1rem; }
.wu-title {
  font-weight: 800; font-size: 0.82rem;
  color: #1e1b4b; letter-spacing: 0.02em;
}
.wu-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem; margin-bottom: 0.7rem;
}
.wu-stat {
  text-align: center;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: 10px; padding: 0.5rem 0.2rem;
  border: 1px solid rgba(91,94,244,0.06);
}
.wu-stat-val {
  display: block; font-size: 1.2rem; font-weight: 900;
  background: linear-gradient(135deg, #5b5ef4, #a855f7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.wu-stat-label {
  font-size: 0.6rem; color: #7c7c9a; text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 700;
}
.wu-goal { margin-bottom: 0.6rem; }
.wu-goal-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.7rem; color: #7c7c9a; margin-bottom: 0.3rem; font-weight: 700;
}
.wu-progress-bar {
  height: 7px; background: #ede9fe;
  border-radius: 10px; overflow: hidden;
}
.wu-progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, #818cf8, #a855f7, #ec4899);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wu-days {
  display: flex; justify-content: space-between; gap: 0.3rem;
}
.wu-day {
  flex: 1; text-align: center;
  font-size: 0.68rem; font-weight: 800; color: #a5a5c0;
  padding: 0.35rem 0; border-radius: 8px;
  background: #f5f3ff;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid transparent;
}
.wu-day.active {
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  color: #fff;
  box-shadow: 0 3px 10px rgba(91,94,244,0.25);
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.05);
}

/* ===== USAGE SUGGESTIONS ===== */
.wu-suggest {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(91,94,244,0.08);
}
.wu-suggest-title {
  font-size: 0.74rem; font-weight: 800; color: #5b5ef4;
  margin-bottom: 0.35rem;
}
.wu-suggest-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.wu-suggest-list li {
  font-size: 0.68rem; color: #7c7c9a; line-height: 1.45;
  padding-left: 0.9rem; position: relative;
}
.wu-suggest-list li::before {
  content: '→'; position: absolute; left: 0;
  color: #a855f7; font-weight: 700;
}
.wu-suggest-list li strong { color: #1e1b4b; }
.wu-suggest-tip {
  margin-top: 0.45rem;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.4rem 0.6rem; border-radius: 10px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  color: #5b5ef4; text-align: center;
  display: none;
  border: 1px solid rgba(91,94,244,0.1);
}
.wu-suggest-tip.show { display: block; }

/* ===== SIDEBAR SECTIONS ===== */
.ts-section { }
.ts-label {
  font-size: 0.7rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1.2px; color: #7c7c9a; margin-bottom: 0.45rem;
}
.ts-topics { display: flex; flex-direction: column; gap: 0.3rem; }
.ts-topic-btn {
  padding: 0.5rem 0.75rem; border-radius: 11px;
  background: white; border: 1px solid rgba(91,94,244,0.1);
  font-weight: 700; font-size: 0.8rem; cursor: pointer;
  text-align: left; font-family: 'Nunito', sans-serif;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #4a4a6a;
  box-shadow: 0 1px 4px rgba(91,94,244,0.03);
}
.ts-topic-btn:hover {
  border-color: #5b5ef4; background: rgba(91,94,244,0.04);
  transform: translateX(4px);
  box-shadow: 0 3px 12px rgba(91,94,244,0.1);
  color: #5b5ef4;
}

/* ===== TEACHING STYLE GRID ===== */
.style-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}
.style-btn {
  padding: 0.55rem 0.3rem; border-radius: 12px;
  background: white; border: 1px solid rgba(91,94,244,0.1);
  font-weight: 700; font-size: 0.72rem; cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  color: #7c7c9a;
  box-shadow: 0 1px 4px rgba(91,94,244,0.03);
}
.style-btn span { font-size: 1.15rem; }
.style-btn:hover {
  border-color: #5b5ef4; color: #5b5ef4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91,94,244,0.1);
}
.style-btn.active {
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  color: white; border-color: transparent;
  box-shadow: 0 4px 16px rgba(91,94,244,0.3);
  transform: scale(1.02);
}

/* ===== WEAK AREAS ===== */
.ts-weak-v2 { display: flex; flex-direction: column; gap: 0.3rem; }
.ts-weak-item-v2 {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.7rem; border-radius: 11px;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  font-size: 0.78rem; font-weight: 700;
  border: 1px solid rgba(249,115,22,0.15);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #92400e;
}
.ts-weak-item-v2:hover {
  transform: translateX(4px);
  border-color: #f97316;
  box-shadow: 0 3px 12px rgba(249,115,22,0.12);
}
.ts-weak-pct { color: #c2410c; font-weight: 900; font-size: 0.75rem; }

/* ===== MAIN CHAT AREA ===== */
.tutor-main-v2 {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fafaff 0%, #f5f5ff 100%);
  position: relative;
}
.tutor-main-v2::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(91,94,244,0.03) 0%, transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(168,85,247,0.03) 0%, transparent 50%);
  pointer-events: none;
}

/* ===== CHAT HEADER ===== */
.chat-header-v2 {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 1.5rem; background: white;
  border-bottom: 1px solid rgba(91,94,244,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.03);
  position: relative; z-index: 2;
}
.ch-left { display: flex; align-items: center; gap: 0.75rem; }
.ch-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 16px rgba(91,94,244,0.25);
  overflow: visible;
  position: relative;
}
.ch-avatar-lottie {
  width: 46px; height: 46px;
  filter: drop-shadow(0 2px 8px rgba(91,94,244,0.2));
}
.ch-left h3 { font-size: 1rem; font-weight: 900; color: #1e1b4b; }
.ch-left p { font-size: 0.75rem; color: #7c7c9a; font-weight: 600; }
.session-xp-badge {
  display: flex; align-items: center; gap: 0.35rem;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #1a1a2e; font-weight: 900; font-size: 0.82rem;
  padding: 0.45rem 0.9rem; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(251,191,36,0.25);
  animation: xpGlow 3s ease infinite;
}
@keyframes xpGlow {
  0%, 100% { box-shadow: 0 4px 16px rgba(251,191,36,0.25); }
  50% { box-shadow: 0 4px 24px rgba(251,191,36,0.45); }
}

/* ===== CHAT MESSAGES ===== */
.chat-messages-v2 {
  flex: 1; overflow-y: auto; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.8rem;
  position: relative; z-index: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(91,94,244,0.1) transparent;
}
.chat-messages-v2::-webkit-scrollbar { width: 5px; }
.chat-messages-v2::-webkit-scrollbar-thumb {
  background: rgba(91,94,244,0.1); border-radius: 5px;
}

.chat-bubble {
  display: flex; gap: 0.6rem; max-width: 80%;
  animation: msgSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes msgSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-bubble.ai { align-self: flex-start; }
.chat-bubble.user { align-self: flex-end; flex-direction: row-reverse; }

.cb-avatar {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; flex-shrink: 0;
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  box-shadow: 0 3px 10px rgba(91,94,244,0.2);
}
.chat-bubble.user .cb-avatar {
  background: linear-gradient(135deg, #06d6a0, #059669);
  box-shadow: 0 3px 10px rgba(6,214,160,0.2);
}

.cb-content-v2 {
  background: white; border-radius: 18px 18px 18px 4px;
  padding: 0.85rem 1.1rem; line-height: 1.7;
  border: 1px solid rgba(91,94,244,0.08);
  font-size: 0.88rem; color: #374151;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 0 0 1px rgba(91,94,244,0.03);
  position: relative;
}
.cb-name {
  font-size: 0.68rem; font-weight: 800; color: #5b5ef4;
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 0.25rem;
}
.chat-bubble.user .cb-content-v2 {
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  color: white; border-color: transparent;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 20px rgba(91,94,244,0.25);
}
.chat-bubble.user .cb-name { color: rgba(255,255,255,0.6); }

.cb-content-v2 p { margin-bottom: 0.5rem; }
.cb-content-v2 p:last-of-type { margin-bottom: 0; }
.cb-content-v2 strong { color: #1e1b4b; }
.chat-bubble.user .cb-content-v2 strong { color: #fff; }

.cb-content-v2 table {
  width: 100%; border-collapse: collapse; margin: 0.5rem 0;
  font-size: 0.82rem; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(91,94,244,0.06);
}
.cb-content-v2 th {
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  color: white; padding: 0.5rem 0.7rem;
  text-align: left; font-weight: 800; font-size: 0.75rem;
  letter-spacing: 0.3px;
}
.cb-content-v2 td {
  padding: 0.4rem 0.7rem; border-bottom: 1px solid #f0f2ff;
  font-weight: 600;
}
.cb-content-v2 tr:last-child td { border-bottom: none; }
.cb-content-v2 tr:hover td { background: rgba(91,94,244,0.02); }

.cb-content-v2 pre {
  background: #1e1b4b; color: #e8e8f5; padding: 0.8rem 1rem;
  border-radius: 12px; overflow-x: auto; font-size: 0.82rem;
  border: 1px solid rgba(91,94,244,0.2);
}
.cb-content-v2 code {
  background: rgba(91,94,244,0.08); padding: 0.15rem 0.4rem;
  border-radius: 6px; font-size: 0.82rem; color: #5b5ef4;
  font-weight: 700;
}

/* ===== CLASSROOM BOARD TEACHING ===== */
.teacher-board {
  background: #12382f;
  color: #f5fff9;
  border-radius: 8px;
  padding: 0.9rem;
  border: 6px solid #9a6a3d;
  box-shadow: inset 0 0 22px rgba(0,0,0,0.22), 0 10px 26px rgba(18,56,47,0.14);
  min-width: min(560px, 100%);
}
.board-topline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #c9f7df;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  padding-bottom: 0.55rem;
  margin-bottom: 0.65rem;
  border-bottom: 1px solid rgba(245,255,249,0.18);
}
.board-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 10px rgba(250,204,21,0.6);
}
.board-section {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.62rem 0;
  border-bottom: 1px dashed rgba(245,255,249,0.16);
}
.board-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.board-label {
  color: #facc15;
  font-weight: 900;
  font-size: 0.78rem;
  text-transform: uppercase;
  line-height: 1.35;
}
.board-text {
  color: #f5fff9;
  font-weight: 700;
  line-height: 1.65;
}
.board-text strong {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(250,204,21,0.7);
  text-underline-offset: 3px;
}
.board-text code {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}
.teacher-voice-toggle,
.listen-btn {
  border: 1px solid rgba(91,94,244,0.18);
  background: #ffffff;
  color: #4f46e5;
  border-radius: 999px;
  padding: 0.42rem 0.7rem;
  font-weight: 900;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}
.listen-btn {
  color: #0f766e;
  border-color: rgba(15,118,110,0.18);
  background: #ecfdf5;
}

/* ===== MESSAGE REACTIONS ===== */
.cb-reactions {
  display: flex; gap: 0.3rem; margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(91,94,244,0.06);
}
.reaction-btn {
  background: #f8f9ff; border: 1px solid rgba(91,94,244,0.08);
  border-radius: 50px; padding: 0.2rem 0.5rem;
  font-size: 0.75rem; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reaction-btn:hover {
  background: #ede9fe; border-color: #a855f7;
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(168,85,247,0.15);
}
.reaction-btn.reacted {
  background: linear-gradient(135deg, #ede9fe, #f5f3ff);
  border-color: #5b5ef4;
  box-shadow: 0 2px 8px rgba(91,94,244,0.12);
}

/* ===== LOADING DOTS ===== */
.cb-loading {
  display: flex; gap: 0.35rem; padding: 0.5rem 0;
}
.cb-loading span {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, #5b5ef4, #a855f7);
  animation: bounce 1.4s ease-in-out infinite;
}
.cb-loading span:nth-child(2) { animation-delay: 0.2s; }
.cb-loading span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,80%,100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ===== QUICK CHIPS ===== */
.quick-chips {
  display: flex; gap: 0.4rem; padding: 0.7rem 1.5rem;
  overflow-x: auto; flex-wrap: nowrap;
  border-top: 1px solid rgba(91,94,244,0.06);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  position: relative; z-index: 2;
}
.quick-chips::-webkit-scrollbar { height: 0; }
.qc-chip {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.5rem 0.9rem; border-radius: 12px;
  background: white; border: 1px solid rgba(91,94,244,0.1);
  font-weight: 700; font-size: 0.78rem; cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #64748b; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(91,94,244,0.04);
}
.qc-chip:hover {
  border-color: #5b5ef4; color: #5b5ef4;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(91,94,244,0.12);
}
.qc-chip.primary {
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  color: white; border-color: transparent;
  box-shadow: 0 4px 16px rgba(91,94,244,0.25);
}
.qc-chip.primary:hover {
  box-shadow: 0 8px 28px rgba(91,94,244,0.35);
  transform: translateY(-3px) scale(1.02);
}
.qc-chip span { font-size: 0.9rem; }

/* ===== DAILY LIMIT BANNER ===== */
.daily-limit-banner {
  display: none; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 16px; padding: 1rem 1.2rem;
  margin: 0.5rem 1.5rem;
  box-shadow: 0 4px 16px rgba(239,68,68,0.06);
  position: relative; z-index: 2;
}
.dlb-icon { font-size: 1.8rem; }
.dlb-text { flex: 1; }
.dlb-text strong { color: #dc2626; font-size: 0.88rem; display: block; margin-bottom: 0.15rem; }
.dlb-text p { color: #6b7280; font-size: 0.75rem; margin: 0; font-weight: 600; }
.dlb-btn {
  font-size: 0.78rem !important; padding: 0.5rem 1.2rem !important;
  border-radius: 12px !important; white-space: nowrap;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border: none !important; color: white !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(239,68,68,0.2) !important;
  transition: all 0.2s !important;
}
.dlb-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(239,68,68,0.3) !important;
}

/* ===== USAGE COUNTER ===== */
.usage-counter {
  display: none; align-items: center; gap: 0.6rem;
  padding: 0.5rem 1.5rem;
  position: relative; z-index: 2;
}
.uc-bar {
  flex: 1; height: 5px; background: #ede9fe;
  border-radius: 6px; overflow: hidden;
}
.uc-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #818cf8, #a855f7);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.uc-text {
  font-size: 0.68rem; color: #7c7c9a; font-weight: 700;
  white-space: nowrap;
}

/* ===== CHAT INPUT ===== */
.chat-input-v2 {
  padding: 0.75rem 1.5rem 1rem;
  background: white;
  border-top: 1px solid rgba(91,94,244,0.06);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.02);
  position: relative; z-index: 2;
}
.ci-wrap {
  display: flex; gap: 0.5rem;
  background: linear-gradient(135deg, #f8f9ff, #f5f3ff);
  border-radius: 16px;
  padding: 0.35rem 0.35rem 0.35rem 1rem;
  border: 2px solid rgba(91,94,244,0.1);
  transition: all 0.3s ease;
}
.ci-wrap:focus-within {
  border-color: #5b5ef4;
  box-shadow: 0 0 0 4px rgba(91,94,244,0.08);
  background: white;
}
#chatInput {
  flex: 1; padding: 0.6rem 0; border: none;
  background: transparent; font-family: 'Nunito', sans-serif;
  font-size: 0.92rem; font-weight: 600; outline: none;
  color: #1e1b4b;
}
#chatInput::placeholder { color: #a5a5c0; font-weight: 600; }
.ci-send {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  color: white; border: none; cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(91,94,244,0.3);
}
.ci-send:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(91,94,244,0.4);
}
.ci-send:active { transform: scale(0.95); }
.ci-send:disabled { opacity: 0.4; cursor: wait; transform: none; box-shadow: none; }
.send-icon { transform: rotate(0deg); display: inline-block; }

/* ===== CORRECT/WRONG FEEDBACK ===== */
.cb-correct {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5) !important;
  border-color: rgba(6,214,160,0.2) !important;
}
.cb-wrong {
  background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
  border-color: rgba(239,68,68,0.15) !important;
}

/* ===== QUIZ OPTION BUTTONS ===== */
.quiz-opt-btn {
  border-radius: 12px !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.quiz-opt-btn:hover:not(:disabled) {
  transform: translateX(4px) !important;
  box-shadow: 0 3px 12px rgba(91,94,244,0.12) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .tutor-layout-v2 { grid-template-columns: 260px 1fr; }
}
@media (max-width: 768px) {
  .tutor-layout-v2 { grid-template-columns: 1fr; }
  .tutor-sidebar-v2 { display: none; }
  .combo-counter { top: 65px; right: 10px; }
  .chat-messages-v2 { padding: 1rem; }
  .chat-bubble { max-width: 90%; }
  .quick-chips { padding: 0.6rem 1rem; }
  .chat-input-v2 { padding: 0.6rem 1rem 0.8rem; }
  .usage-counter { padding: 0.4rem 1rem; }
  .daily-limit-banner { margin: 0.4rem 1rem; }
}
@media (max-width: 480px) {
  .chat-bubble { max-width: 95%; }
  .cb-content-v2 { padding: 0.7rem 0.9rem; font-size: 0.85rem; }
  .qc-chip { padding: 0.4rem 0.7rem; font-size: 0.72rem; }
  .teacher-board { min-width: 0; padding: 0.7rem; border-width: 5px; }
  .board-section { grid-template-columns: 1fr; gap: 0.25rem; }
  .board-label { font-size: 0.72rem; }
}
