/* ==========================================================================
   FluencyCraft - Bright Modern Educational SaaS Theme
   Complementary styles for Bootstrap 5.3.3
   ========================================================================== */

:root {
  --fc-primary: #4f46e5;
  --fc-primary-hover: #4338ca;
  --fc-primary-light: #eef2ff;
  --fc-accent: #06b6d4;
  --fc-success: #10b981;
  --fc-warning: #f59e0b;
  --fc-danger: #ef4444;
  --fc-bg-subtle: #f8fafc;
  --fc-card-bg: #ffffff;
  --fc-border: #e2e8f0;
  --fc-border-subtle: #f1f5f9;
  --fc-text-main: #0f172a;
  --fc-text-secondary: #475569;
  --fc-text-muted: #94a3b8;
  --fc-font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fc-font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base resets & typography */
body {
  font-family: var(--fc-font-main);
  color: var(--fc-text-main);
  background-color: var(--fc-bg-subtle);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-outfit {
  font-family: var(--fc-font-heading);
  letter-spacing: -0.02em;
}

/* Brand badge */
.brand-badge-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.brand-title {
  letter-spacing: -0.03em;
}

/* Navigation pills customization */
.nav-pills .nav-link {
  color: var(--fc-text-secondary);
  transition: all 0.2s ease;
  font-size: 0.88rem;
}

.nav-pills .nav-link:hover {
  color: var(--fc-primary);
  background-color: rgba(79, 70, 229, 0.06);
}

.nav-pills .nav-link.active {
  background-color: var(--fc-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.nav-pills .nav-link.active i {
  color: #ffffff !important;
}

/* Hero section */
.hero-bright {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.hero-heading {
  letter-spacing: -0.03em;
  line-height: 1.25;
}

/* Online status dot */
.status-indicator {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.status-indicator.online {
  background-color: var(--fc-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.4); }
}

/* Chat arena */
#chatMessages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #fcfcfd;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: fadeInMsg 0.25s ease-out;
}

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

.chat-msg.assistant {
  align-self: flex-start;
}

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

.chat-msg.assistant .msg-bubble {
  background-color: #ffffff;
  color: var(--fc-text-main);
  border: 1px solid var(--fc-border);
  border-radius: 18px 18px 18px 4px;
  padding: 12px 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.chat-msg.user .msg-bubble {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.msg-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 0 4px;
}

.chat-msg.user .msg-toolbar {
  justify-content: flex-end;
}

.msg-listen-btn {
  background: none;
  border: none;
  color: var(--fc-text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-listen-btn:hover {
  color: var(--fc-primary);
  background-color: var(--fc-primary-light);
}

/* Coach Note Box */
.coach-card {
  margin-top: 8px;
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #92400e;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.08);
}

.coach-header {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #b45309;
}

.coach-section {
  margin-top: 4px;
  line-height: 1.45;
}

.coach-section strong {
  color: #78350f;
}

/* Mic pulse */
#micBtn.listening {
  background-color: #fee2e2 !important;
  color: #ef4444 !important;
  border-color: #fca5a5 !important;
  animation: pulse-mic 1.2s infinite;
}

@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

#micStatus.active {
  color: #ef4444 !important;
  font-weight: 600;
}

/* Sentence Polisher Output */
.polished-box {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  border: 1.5px solid #bbf7d0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.polished-headline {
  font-size: 0.82rem;
  font-weight: 700;
  color: #16a34a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.polished-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.5;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-item {
  background-color: var(--fc-bg-subtle);
  border: 1px solid var(--fc-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.86rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.breakdown-item strong {
  color: var(--fc-primary);
  font-size: 0.82rem;
}

/* Sample chips */
.sample-chip {
  transition: all 0.15s ease;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-chip:hover {
  background-color: var(--fc-primary-light);
  border-color: var(--fc-primary);
  color: var(--fc-primary);
}

/* Quiz Styles */
.quiz-item {
  background-color: var(--fc-bg-subtle);
  border: 1px solid var(--fc-border);
  border-radius: 14px;
  padding: 16px 20px;
  transition: border-color 0.2s ease;
}

.quiz-q-title {
  font-weight: 600;
  color: var(--fc-text-main);
  margin-bottom: 12px;
  font-size: 0.96rem;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.quiz-opt-btn {
  background-color: #ffffff;
  border: 1.5px solid var(--fc-border);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fc-text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: var(--fc-primary);
  background-color: var(--fc-primary-light);
  color: var(--fc-primary);
}

.quiz-opt-btn.correct {
  background-color: #dcfce7 !important;
  border-color: #86efac !important;
  color: #15803d !important;
  font-weight: 700;
}

.quiz-opt-btn.incorrect {
  background-color: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

.quiz-opt-btn:disabled {
  cursor: default;
}

.quiz-explanation {
  margin-top: 12px;
  padding: 10px 14px;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 0.85rem;
  color: #1e40af;
}

/* Phrasal Verbs Card Grid */
.pv-card {
  background-color: #ffffff;
  border: 1px solid var(--fc-border);
  border-radius: 14px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pv-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border-color: var(--fc-primary);
}

.rv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.rv-verb {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fc-text-main);
  font-family: var(--fc-font-heading);
}

.icon-btn-sm {
  background-color: var(--fc-bg-subtle);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  color: var(--fc-text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.rv-meaning {
  font-size: 0.88rem;
  color: var(--fc-text-secondary);
  margin-bottom: 10px;
  line-height: 1.45;
  flex-grow: 1;
}

.pv-example {
  font-size: 0.83rem;
  color: #15803d;
  background-color: #f0fdf4;
  border-left: 3px solid #22c55e;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 0;
  font-style: italic;
}

/* Category filter buttons */
.cat-pill.active {
  background-color: var(--fc-primary) !important;
  color: #ffffff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .chat-msg {
    max-width: 92%;
  }
  .hero-heading {
    font-size: 1.75rem;
  }
}
