/* ==================== RESET & ROOT ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Neon Color Palette */
  --neon-pink: #ff006e;
  --neon-cyan: #00f5ff;
  --neon-magenta: #ff00ff;
  --neon-orange: #ff8500;
  --neon-purple: #8338ec;
  --neon-green: #06ffa5;

  /* Background */
  --bg-dark: #0a0e27;
  --bg-navy: #10132b;
  --bg-purple: #1a1240;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: rgba(0, 0, 0, 0.3);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== GLOBAL STYLES ==================== */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-navy) 50%, var(--bg-purple) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== ANIMATED BACKGROUND ==================== */
.animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s infinite ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--neon-pink), transparent);
  top: -250px;
  left: -250px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--neon-cyan), transparent);
  bottom: -200px;
  right: -200px;
  animation-delay: -7s;
}

.orb-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--neon-purple), transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(100px, -100px) scale(1.1);
  }
  66% {
    transform: translate(-100px, 100px) scale(0.9);
  }
}

/* ==================== GLASS PANEL ==================== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px var(--glass-shadow);
}

/* ==================== DASHBOARD CONTAINER ==================== */
.dashboard-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== TAB NAVIGATION ==================== */
.tab-navigation {
  display: flex;
  gap: 12px;
  padding: 12px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid transparent;
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.tab-icon {
  font-size: 24px;
}

.tab-label {
  font-size: 15px;
  font-weight: 600;
}

.tab-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background: var(--neon-cyan);
  color: var(--bg-dark);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(131, 56, 236, 0.2));
  border-color: var(--neon-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

/* ==================== TAB CONTENT ==================== */
.tab-content-container {
  flex: 1;
  position: relative;
}

.tab-panel {
  display: none;
  animation: fadeInPanel 0.4s ease-out;
}

.tab-panel.active {
  display: block;
}

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

.tab-panel-inner {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  min-height: calc(100vh - 180px);
}

.tab-title {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.tab-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ==================== TAB 1: FEELINGS & ACTIONS ==================== */
/* Session Info Bar */
.session-info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

.session-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.info-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.feeling-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feeling-btn {
  position: relative;
  display: flex;
  align-items: center;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  text-align: left;
}

.feeling-content {
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1;
}

.feeling-emoji {
  font-size: 32px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.feeling-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feeling-label {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-transform: lowercase;
}

.feeling-description {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: lowercase;
}

.feeling-ripple {
  position: absolute;
  inset: 0;
  border-radius: 50px;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

/* Lost Button */
.feeling-lost {
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.15), rgba(255, 133, 0, 0.15));
  border-color: rgba(255, 0, 110, 0.3);
}

.feeling-lost:hover {
  transform: translateX(8px) scale(1.02);
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.25), rgba(255, 133, 0, 0.25));
  border-color: var(--neon-pink);
  box-shadow: 0 8px 32px rgba(255, 0, 110, 0.4);
}

.feeling-lost:hover .feeling-emoji {
  transform: rotate(-15deg) scale(1.2);
}

.feeling-lost.active {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-orange));
  border-color: var(--neon-pink);
  box-shadow: 0 0 40px rgba(255, 0, 110, 0.6);
  animation: bounce-wiggle 0.6s ease;
}

/* Flash animation for updated counts */
.update-flash {
  animation: pulseFlash 900ms ease;
}

@keyframes pulseFlash {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(0,0,0,0);
    color: var(--text-primary);
  }
  30% {
    transform: scale(1.06);
    color: var(--neon-cyan);
    text-shadow: 0 6px 18px rgba(0,245,255,0.12);
  }
  60% {
    transform: scale(1.02);
    color: var(--neon-magenta);
  }
  100% {
    transform: scale(1);
    color: var(--text-primary);
  }
}

/* Acknowledged button visual state */
.action-card.acknowledged,
.cta-help.acknowledged {
  border-color: var(--neon-green);
  box-shadow: 0 6px 18px rgba(6,255,165,0.12);
}

.feeling-lost.active .feeling-ripple {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent);
  animation: ripple-pulse 2s infinite;
}

/* Kinda Button */
.feeling-kinda {
  background: linear-gradient(135deg, rgba(255, 133, 0, 0.15), rgba(0, 245, 255, 0.15));
  border-color: rgba(255, 133, 0, 0.3);
}

.feeling-kinda:hover {
  transform: translateX(8px) scale(1.02);
  background: linear-gradient(135deg, rgba(255, 133, 0, 0.25), rgba(0, 245, 255, 0.25));
  border-color: var(--neon-orange);
  box-shadow: 0 8px 32px rgba(255, 133, 0, 0.4);
}

.feeling-kinda:hover .feeling-emoji {
  transform: rotate(15deg) scale(1.2);
}

.feeling-kinda.active {
  background: linear-gradient(135deg, var(--neon-orange), var(--neon-cyan));
  border-color: var(--neon-orange);
  box-shadow: 0 0 40px rgba(255, 133, 0, 0.6);
  animation: bounce-wiggle 0.6s ease;
}

.feeling-kinda.active .feeling-ripple {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent);
  animation: ripple-pulse 2s infinite;
}

/* Got It Button */
.feeling-gotit {
  background: linear-gradient(135deg, rgba(6, 255, 165, 0.15), rgba(0, 245, 255, 0.15));
  border-color: rgba(6, 255, 165, 0.3);
}

.feeling-gotit:hover {
  transform: translateX(8px) scale(1.02);
  background: linear-gradient(135deg, rgba(6, 255, 165, 0.25), rgba(0, 245, 255, 0.25));
  border-color: var(--neon-green);
  box-shadow: 0 8px 32px rgba(6, 255, 165, 0.4);
}

.feeling-gotit:hover .feeling-emoji {
  transform: rotate(360deg) scale(1.3);
}

.feeling-gotit.active {
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan));
  border-color: var(--neon-green);
  box-shadow: 0 0 40px rgba(6, 255, 165, 0.6);
  animation: bounce-wiggle 0.6s ease;
}

.feeling-gotit.active .feeling-ripple {
  opacity: 1;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3), transparent);
  animation: ripple-pulse 2s infinite;
}

.feeling-btn:active {
  transform: scale(0.97);
}

@keyframes bounce-wiggle {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-8px) rotate(-3deg); }
  75% { transform: translateX(8px) rotate(3deg); }
}

@keyframes ripple-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3);
  }
}

/* Live Transcript */
.live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0.3;
  }
}

.transcript-panel {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  height: 200px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.transcript-panel::-webkit-scrollbar {
  width: 4px;
}

.transcript-panel::-webkit-scrollbar-track {
  background: transparent;
}

.transcript-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.transcript-line {
  margin-bottom: 8px;
  animation: fadeInUp 0.3s ease-out;
}

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

.transcript-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* Action Buttons Section */
.actions-section {
  margin-top: 40px;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.action-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  overflow: hidden;
  text-align: left;
}

.action-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.action-content h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.action-content p {
  font-size: 13px;
  color: var(--text-secondary);
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.action-card.cta-question {
  border-color: var(--neon-cyan);
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.1), rgba(131, 56, 236, 0.1));
}

.action-card.cta-question:hover {
  box-shadow: 0 12px 32px rgba(0, 245, 255, 0.4);
  border-color: var(--neon-cyan);
}

.action-card.cta-help {
  border-color: var(--neon-pink);
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.1), rgba(255, 133, 0, 0.1));
}

.action-card.cta-help:hover {
  box-shadow: 0 12px 32px rgba(255, 0, 110, 0.4);
  border-color: var(--neon-pink);
}

.urgent-pulse {
  display: none;
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 3px solid var(--neon-pink);
  animation: urgent-pulse 1s infinite;
}

.cta-help.urgent .urgent-pulse {
  display: block;
}

@keyframes urgent-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.1);
    opacity: 0;
  }
}

/* ==================== TAB 2: TIMELINE VIEW ==================== */
.timeline-view {
  padding: 20px;
}

.timeline-header-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.stat-card {
  padding: 20px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.understanding-bar {
  margin-top: 12px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.understanding-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan), var(--neon-green));
  background-size: 200% 100%;
  border-radius: 3px;
  transition: width var(--transition-slow);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Timeline Header */
.timeline-header {
  text-align: center;
  margin-bottom: 8px;
}

.timeline-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.timeline-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Timeline Container */
.timeline-container-full {
  padding: 20px;
  min-height: 500px;
  position: relative;
}

.timeline-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.empty-animation {
  margin-bottom: 24px;
}

.empty-icon {
  width: 120px;
  height: 120px;
}

.circle-orbit {
  fill: none;
  stroke: var(--neon-cyan);
  stroke-width: 2;
  stroke-dasharray: 10 5;
  animation: rotate 8s linear infinite;
  transform-origin: center;
}

.circle-core {
  fill: var(--neon-pink);
  filter: drop-shadow(0 0 10px var(--neon-pink));
  animation: pulse-core 2s ease-in-out infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-core {
  0%, 100% {
    r: 20;
    opacity: 1;
  }
  50% {
    r: 25;
    opacity: 0.7;
  }
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-text {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Timeline Feed */
.timeline-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Concept Card */
.concept-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.concept-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border-color: var(--neon-cyan);
}

.concept-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan), var(--neon-magenta));
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

.concept-card.pinned {
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.3);
}

.concept-card.pulse-in {
  animation: slideInRight 0.5s ease-out, pulse-brief 0.6s ease-out 0.5s;
}

@keyframes pulse-brief {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.concept-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.concept-title-area {
  flex: 1;
}

.concept-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.concept-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.concept-timestamp {
  display: flex;
  align-items: center;
  gap: 4px;
}

.concept-confidence {
  display: flex;
  align-items: center;
  gap: 6px;
}

.confidence-bar {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-orange), var(--neon-green));
  border-radius: 2px;
  transition: width var(--transition-base);
}

.concept-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.concept-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.concept-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.concept-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.concept-action-btn.pinned {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
}

/* Student Question Card */
.student-question-card {
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.1), rgba(131, 56, 236, 0.1));
  border: 1px solid var(--neon-pink);
  border-radius: 20px;
  padding: 24px;
  animation: slideInRight 0.5s ease-out;
}

.question-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--neon-pink);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ==================== TAB 3: AVATAR VIEW ==================== */
.avatar-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar-main-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
  width: 100%;
  max-width: 500px;
}

.avatar-circle-large {
  position: relative;
  width: 200px;
  height: 200px;
}

.avatar-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 0, 110, 0.6), transparent);
  filter: blur(30px);
  animation: avatar-breathe 4s ease-in-out infinite;
}

@keyframes avatar-breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.avatar-circle-large .avatar-inner {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 0, 110, 0.2), rgba(131, 56, 236, 0.2));
  border: 4px solid var(--neon-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 50px rgba(255, 0, 110, 0.6);
}

.avatar-icon {
  width: 100px;
  height: 100px;
}

.avatar-status-large {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Avatar Action Button */
.avatar-action-btn-large {
  position: relative;
  width: 100%;
  padding: 20px 32px;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  border: none;
  border-radius: 18px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  animation: shimmer-move 3s infinite;
}

@keyframes shimmer-move {
  to {
    transform: translateX(100%);
  }
}

.avatar-action-btn-large:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(255, 0, 110, 0.6);
}

.avatar-action-btn-large:active {
  transform: translateY(-2px) scale(0.98);
}

.btn-icon {
  font-size: 28px;
}

/* Suggestions Grid */
.suggestions-grid {
  width: 100%;
  max-width: 800px;
}

.suggestion-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.suggestion-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: 500;
}

.suggestion-card:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--neon-cyan);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 245, 255, 0.3);
}

.suggestion-icon {
  font-size: 24px;
  flex-shrink: 0;
}

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  padding: 32px;
  animation: scaleIn 0.3s ease-out;
}

.modal-large {
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.modal-chat {
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
  max-height: 320px;
  padding: 16px 0;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 90%;
  align-self: flex-start;
  animation: fadeInUp 0.3s ease-out;
}

.chat-bubble-user {
  align-self: flex-end;
}

.chat-bubble-inner {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble-user .chat-bubble-inner {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(131, 56, 236, 0.2));
  border: 1px solid rgba(0, 245, 255, 0.4);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.chat-bubble-agent .chat-bubble-inner {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  border-bottom-left-radius: 4px;
  white-space: pre-wrap;
}

.chat-bubble-agent .chat-bubble-inner p {
  margin: 0 0 0.75em 0;
  line-height: 1.6;
}

.chat-bubble-agent .chat-bubble-inner p:last-child {
  margin-bottom: 0;
}

.chat-bubble-agent .chat-bubble-inner strong {
  color: var(--neon-cyan);
  font-weight: 600;
}

.chat-bubble-agent .chat-bubble-inner ul,
.chat-bubble-agent .chat-bubble-inner ol {
  margin: 0.5em 0;
  padding-left: 1.25em;
}

.chat-bubble-agent .chat-bubble-inner li {
  margin-bottom: 0.25em;
  line-height: 1.5;
}

.chat-bubble-agent .chat-bubble-inner code {
  background: rgba(0, 245, 255, 0.15);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.chat-bubble-error .chat-bubble-inner {
  background: rgba(255, 0, 110, 0.15);
  border: 1px solid rgba(255, 0, 110, 0.4);
  color: var(--neon-pink);
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-input-area .question-input {
  margin-bottom: 0;
  resize: none;
  min-height: 60px;
}

.chat-submit-btn {
  position: relative;
}

.chat-loading {
  display: none;
  align-items: center;
  gap: 4px;
}

.chat-loading-dots {
  display: none;
}

.chat-loading-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: loading-dot 1.4s ease-in-out infinite both;
}

.chat-loading-dots .dot:nth-child(1) { animation-delay: 0s; }
.chat-loading-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-loading-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes loading-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-bubble-loading .chat-bubble-inner {
  display: flex;
  gap: 6px;
  padding: 16px 20px;
}

.chat-bubble-loading .typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  animation: loading-dot 1.4s ease-in-out infinite both;
}

.chat-bubble-loading .typing-dot:nth-child(1) { animation-delay: 0s; }
.chat-bubble-loading .typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble-loading .typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.question-input {
  width: 100%;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  transition: all var(--transition-base);
  margin-bottom: 20px;
}

.question-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

.modal-submit-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.modal-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 245, 255, 0.4);
}

.btn-arrow {
  width: 20px;
  height: 20px;
}

.avatar-explanation-content {
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  min-height: 150px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.avatar-video-section {
  margin-bottom: 20px;
}

#avatar-video {
  width: 100%;
  max-width: 600px;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  display: block;
}

.explanation-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.avatar-controls {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.avatar-status-text {
  text-align: center;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #00f5ff;
  margin-bottom: 10px;
}

.concept-select {
  flex: 1;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.concept-select:focus {
  outline: none;
  border-color: var(--neon-cyan);
}

.speak-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--neon-orange), var(--neon-pink));
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 8px;
}

.speak-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 133, 0, 0.4);
}

.speak-icon {
  font-size: 18px;
}

.stop-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #ff4757, #ff6348);
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.4);
}

.stop-icon {
  font-size: 18px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .dashboard-container {
    padding: 16px;
  }

  .tab-panel-inner {
    padding: 24px;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-container {
    padding: 12px;
    gap: 12px;
  }

  .tab-navigation {
    padding: 8px;
    gap: 8px;
  }

  .tab-btn {
    flex-direction: column;
    padding: 12px;
    gap: 6px;
  }

  .tab-label {
    font-size: 12px;
  }

  .tab-icon {
    font-size: 20px;
  }

  .tab-panel-inner {
    padding: 20px;
    min-height: calc(100vh - 160px);
  }

  .tab-title {
    font-size: 24px;
  }

  .feeling-emoji {
    font-size: 40px;
  }

  .session-info-bar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .session-info-item {
    justify-content: center;
  }

  .avatar-circle-large {
    width: 150px;
    height: 150px;
  }

  .avatar-circle-large .avatar-inner {
    width: 150px;
    height: 150px;
  }

  .suggestion-cards {
    grid-template-columns: 1fr;
  }
}
