/* ==========================================================================
   COMPONENTS STYLESHEET - HUMAN UI POLISH
   ========================================================================== */

/* --------------------------------------------------------------------------
   HERO SECTION (Clean, Welcoming, Non-AI)
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  padding: 4rem 0 5rem;
  background: var(--bg-primary);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.hero-pill-announcement {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
  color: var(--text-secondary);
}

.hero-pill-announcement:hover {
  border-color: var(--border-strong);
}

.hero-title {
  margin-bottom: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.hero-title-highlight {
  color: var(--primary);
  display: inline;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2.25rem;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Live Search Box */
.hero-search-wrapper {
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 620px;
  margin: 0 auto 1.25rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.hero-search-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-light);
}

.hero-search-icon {
  padding-left: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.hero-search-input {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0.5rem 0;
}

.hero-search-input::placeholder {
  color: var(--text-muted);
}

.quick-topics {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.quick-topic-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-topic-tag:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

/* Trust / Stats Banner */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-top: 3.5rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 850px) {
  .stats-banner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 500px) {
  .stats-banner {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1.5rem 1.25rem;
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   SUBJECT HUB SECTION
   -------------------------------------------------------------------------- */
.section-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  margin-bottom: 0.65rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.subject-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.subject-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.subject-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.subject-icon-math { background: #EEF2FF; color: #4F46E5; }
.subject-icon-science { background: #ECFDF5; color: #059669; }
.subject-icon-english { background: #FEF3C7; color: #D97706; }
.subject-icon-history { background: #FFF1F2; color: #E11D48; }
.subject-icon-cs { background: #ECFEFF; color: #0891B2; }
.subject-icon-testprep { background: #F5F3FF; color: #7C3AED; }

[data-theme="dark"] .subject-icon-math { background: rgba(99, 102, 241, 0.18); color: #A5B4FC; }
[data-theme="dark"] .subject-icon-science { background: rgba(16, 185, 129, 0.18); color: #6EE7B7; }
[data-theme="dark"] .subject-icon-english { background: rgba(217, 119, 6, 0.18); color: #FCD34D; }
[data-theme="dark"] .subject-icon-history { background: rgba(225, 29, 72, 0.18); color: #FDA4AF; }
[data-theme="dark"] .subject-icon-cs { background: rgba(8, 145, 178, 0.18); color: #67E8F9; }
[data-theme="dark"] .subject-icon-testprep { background: rgba(124, 58, 237, 0.18); color: #C4B5FD; }

.subject-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.45rem;
}

.subject-card p {
  font-size: 0.9rem;
  margin-bottom: 1.15rem;
  line-height: 1.5;
}

.subject-subtopics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.subtopic-pill {
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

.subject-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.subject-explore-link {
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* --------------------------------------------------------------------------
   STUDY GUIDES CATALOGUE
   -------------------------------------------------------------------------- */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.guide-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.guide-bookmark-btn {
  color: var(--text-muted);
  transition: color var(--transition-fast);
  padding: 4px;
}

.guide-bookmark-btn:hover, .guide-bookmark-btn.saved {
  color: var(--coral);
}

.guide-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
  line-height: 1.35;
}

.guide-excerpt {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 1.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.guide-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.guide-read-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   INTERACTIVE STEP-BY-STEP SOLVER
   -------------------------------------------------------------------------- */
.solver-widget-container {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 2.5rem auto 0;
  max-width: 900px;
}

.solver-widget-header {
  background: var(--bg-tertiary);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.solver-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.solver-tab {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.solver-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-xs);
}

.solver-widget-body {
  padding: 1.75rem;
}

.solver-question-box {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.solver-question-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.solver-question-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.solver-steps-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.solver-step-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
}

.step-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.step-number-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.step-math-box {
  background: var(--bg-tertiary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0.5rem 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border-subtle);
}

.step-explanation {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.solver-final-answer {
  background: var(--emerald-light);
  border: 1px solid var(--emerald-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.final-answer-badge {
  background: var(--emerald);
  color: #FFFFFF;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.final-answer-content {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--emerald-text);
}

/* --------------------------------------------------------------------------
   HOMEWORK HELP Q&A FEED
   -------------------------------------------------------------------------- */
.qa-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .qa-layout {
    grid-template-columns: 1fr;
  }
}

.qa-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.filter-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.filter-count {
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  gap: 1.15rem;
  transition: all var(--transition-fast);
}

.question-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.vote-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.vote-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  transition: all var(--transition-fast);
  font-size: 0.75rem;
}

.vote-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.vote-btn.active {
  color: #FFFFFF;
  background: var(--primary);
}

.vote-count {
  font-weight: 700;
  font-size: 0.9rem;
}

.question-main {
  flex: 1;
  min-width: 0;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.question-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1.35;
}

.question-title:hover {
  color: var(--primary);
}

.question-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.55;
  word-break: break-word;
}

.question-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.question-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.question-status-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.question-status-badge.solved {
  color: var(--emerald);
}

/* Question Solution Accordion */
.solution-collapsible {
  margin-top: 1rem;
  padding: 1.15rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--emerald);
  display: none;
}

.solution-collapsible.open {
  display: block;
}

/* --------------------------------------------------------------------------
   FLASHCARDS STUDY ENGINE
   -------------------------------------------------------------------------- */
.flashcard-stage {
  perspective: 1000px;
  max-width: 580px;
  height: 340px;
  margin: 1.75rem auto;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.flashcard-stage.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-md);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: var(--bg-tertiary);
}

.card-deck-tag {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.card-center-prompt {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin: auto 0;
}

.card-center-answer {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  margin: auto 0;
}

.card-flip-prompt {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.flashcard-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

.flashcard-progress-bar {
  max-width: 580px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-pill);
  margin: 1.25rem auto;
  overflow: hidden;
}

.flashcard-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 10%;
  transition: width 0.25s ease;
}

/* --------------------------------------------------------------------------
   LEGAL / PRIVACY / TOS LAYOUT
   -------------------------------------------------------------------------- */
.legal-container {
  max-width: 820px;
  margin: 1.5rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 700px) {
  .legal-container {
    padding: 1.75rem 1.25rem;
  }
}

.legal-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
}

.legal-header h1 {
  font-size: 2.1rem;
  margin-bottom: 0.4rem;
}

.legal-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.legal-content section {
  margin-bottom: 2.25rem;
}

.legal-content h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.legal-content p, .legal-content li {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.85rem;
}

.legal-content ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-bottom: 1.15rem;
}

.legal-callout {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
}

.legal-callout p {
  color: var(--primary-text);
  font-size: 0.88rem;
  margin-bottom: 0;
}

.legal-toc {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 2.25rem;
}

.legal-toc-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
}

.legal-toc ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

.legal-toc li {
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}

.legal-toc a {
  color: var(--primary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   YEBRUH GROQ AI TUTOR WIDGET
   -------------------------------------------------------------------------- */
.ai-launcher-btn {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  z-index: 1500;
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-launcher-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.ai-launcher-text {
  font-weight: 700;
  font-size: 0.92rem;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.ai-chat-drawer {
  position: fixed;
  bottom: 5.5rem;
  right: 1.75rem;
  width: 400px;
  max-width: calc(100vw - 2.5rem);
  height: 580px;
  max-height: calc(100vh - 7.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.96);
  transition: all var(--transition-smooth);
}

.ai-chat-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chat-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.9rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ai-avatar-badge {
  width: 34px;
  height: 34px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ai-header-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.ai-header-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  transition: all var(--transition-fast);
}

.ai-icon-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.ai-subject-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1.15rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ai-subject-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
}

.ai-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ai-message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.ai-user-message {
  align-self: flex-end;
}

.ai-user-message .ai-msg-bubble {
  background: var(--primary);
  color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xs);
}

.ai-bot-message {
  align-self: flex-start;
}

.ai-bot-message .ai-msg-bubble {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: 16px 16px 16px 4px;
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-subtle);
  line-height: 1.55;
  box-shadow: var(--shadow-xs);
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.ai-prompt-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--transition-fast);
}

.ai-prompt-pill:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-border);
}

.ai-chat-input-wrapper {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-chat-input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  resize: none;
  max-height: 120px;
}

.ai-chat-input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
}

.ai-send-button {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.ai-send-button:hover {
  background: var(--primary-hover);
}

/* Typing Indicator Animation */
.ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: aiPulse 1.4s infinite ease-in-out both;
}

.ai-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
