:root {
  --bg-dark: #0a0a0f;
  --bg-card: #13131f;
  --primary-glow: rgba(108, 92, 231, 0.4);
  --text-white: #ffffff;
  --text-gray: #a0a0b0;
  --accent-green: #00b894;
  --font-family: 'Inter', sans-serif;
  --background: #0f0f1a;
  --foreground: oklch(0.985 0 0);
  --card: rgba(26, 26, 46, 0.6);
  --card-foreground: oklch(0.985 0 0);
  --popover: #1a1a2e;
  --popover-foreground: oklch(0.985 0 0);
  --primary: #7c5cff;
  --primary-foreground: #ffffff;
  --secondary: #EB3E7E;
  --secondary-foreground: #ffffff;
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: #825DFF;
  --accent-foreground: #030213;
  --destructive: oklch(57.184% 0.16118 22.831);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --success: #22c55e;
  --success-foreground: #ffffff;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.05);
  --input-background: rgba(255, 255, 255, 0.05);
  --ring: #7c5cff;
  --radius: 24px;
  --sidebar: #0f0f1a;
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: #7c5cff;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-ring: #7c5cff;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  justify-content: space-between;
  align-items: center;
  /* padding: 1rem 2rem; */
  background-color: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 10;

}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand img {
  height: 4rem;
  width: auto;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-gray);
  margin-bottom: 4px;
}

.progress-bars {
  display: flex;
  gap: 4px;
}

.bar {
  width: 20px;
  height: 4px;
  background-color: #333;
  border-radius: 2px;
}

.bar.active {
  background-color: var(--primary);
}

.bar.completed {
  background-color: var(--primary);
  opacity: 0.5;
}

.exit-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.exit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Main Layout */
main {
  flex: 1;
  display: flex;
  position: relative;
  padding: 1rem;
  gap: 1rem;
}

/* Avatar/Video Area */
.video-container {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0f 100%);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: transform 0.3s;
}

.avatar-image.speaking {
  transform: scale(1.05);
  filter: brightness(1.2);
  /* Simple lipsync simulation via scale */
  animation: speaking-pulse 0.3s infinite alternate;
}

@keyframes speaking-pulse {
  from {
    transform: scale(1.02);
  }

  to {
    transform: scale(1.05);
    filter: brightness(1.1);
  }
}

/* AI Speaking Badge */
.ai-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 51;
}

.ai-badge.visible {
  opacity: 1;
}

.audio-wave {
  display: flex;
  gap: 3px;
  height: 12px;
  align-items: center;
}

.wave-bar {
  width: 3px;
  background-color: var(--primary);
  animation: wave 1s infinite;
}

.wave-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
  animation-delay: 0.3s;
}

@keyframes wave {

  0%,
  100% {
    height: 4px;
  }

  50% {
    height: 12px;
  }
}

/* Captions Overlay */
.captions-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 3rem 2rem 1.5rem;
  text-align: center;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.caption-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Quick Replies */
.quick-replies-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  z-index: 55;
  pointer-events: none;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  /* Subtle dimming while choosing */
  border-radius: 24px;
  padding-bottom: 200px;
}

.quick-replies-container>* {
  pointer-events: auto;
}

.reply-chip {
  background: var(--background);
  border: 1px solid var(--primary-foreground);
  color: var(--primary-foreground);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.reply-chip:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Mic Control Center */
.control-dock {
  /* position: absolute; */
  /* bottom: 100px; */
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}

.mic-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: all 0.3s;
}

.mic-button.active {
  background: #ea4335 !important;
  animation: pulse-ring 2s infinite !important;
}

.mic-button:hover {
  background: var(--accent) !important;
  transform: scale(1.1) !important;
}

.mic-button.active:hover {
  background: #ea4335 !important;
  transform: scale(1.1) !important;
}

.mic-label {
  font-size: 0.8rem;
  color: var(--text-gray);
  opacity: 0.8;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 67, 53, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(234, 67, 53, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(234, 67, 53, 0);
  }
}

/* Insights Sidebar */
.insights-sidebar {
  width: 320px;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insights-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.insight-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.insight-card.highlight {
  background: rgba(0, 184, 148, 0.1);
  border-color: rgba(0, 184, 148, 0.3);
}

.insight-label {
  font-size: 0.75rem;
  color: var(--text-gray);
  margin-bottom: 4px;
}

.insight-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.highlight .insight-value {
  color: var(--accent-green);
}

/* Utility Classes */


.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Problem Selection/Landing override */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.full-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  border-radius: 24px;
}

.loading-overlay.hidden {
  display: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loading-spinner {
  animation: rotate 2s linear infinite;
  width: 50px;
  height: 50px;
}

.loading-spinner .path {
  stroke: var(--primary);
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-white);
  animation: pulse-text 2s infinite ease-in-out;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }

  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }
}