/* LingoTech - Shadcn Zinc Minimalist Design System */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* Dark Mode Default (Calm Zinc) */
  --bg-primary: #09090b;
  --bg-card: #18181b;
  --bg-card-subtle: #27272a;
  --border-color: rgba(63, 63, 70, 0.4);
  --border-focus: #a1a1aa;
  
  --text-primary: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  
  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --border-color: rgba(203, 213, 225, 0.6);
  --border-focus: #475569;
  
  --text-primary: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 24px));
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-muted);
}

/* Reusable Shadcn Card */
.shadcn-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color 0.15s ease;
}

.shadcn-card:focus-within {
  border-color: var(--border-focus);
}

/* Reusable Button System */
.shadcn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.shadcn-btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}
.shadcn-btn-primary:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.shadcn-btn-secondary {
  background-color: var(--bg-card-subtle);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.shadcn-btn-secondary:active {
  background-color: var(--border-color);
}

.shadcn-btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.shadcn-btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
}
.shadcn-btn-ghost:hover, .shadcn-btn-ghost:active {
  color: var(--text-primary);
  background-color: var(--bg-card-subtle);
}

/* Mode Selector Tabs (Top Bar) */
.chat-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
}
.chat-mode-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}
.chat-mode-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
.chat-mode-btn.active svg {
  stroke: var(--bg-primary);
}

.shadcn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-full);
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  letter-spacing: 0.02em;
}

.shadcn-badge-neutral {
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 500;
}

.shadcn-badge-emerald {
  background-color: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Flashcards Spaced Repetition (SRS) Action Grid */
.srs-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.srs-btn {
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.srs-btn:active {
  transform: scale(0.96);
}

.srs-btn-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.srs-btn-sub {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.srs-btn-hard {
  border-color: rgba(239, 68, 68, 0.25);
  background-color: rgba(239, 68, 68, 0.04);
}
.srs-btn-hard .srs-btn-title {
  color: #f87171;
}

.srs-btn-good {
  border-color: var(--border-color);
  background-color: var(--bg-card-subtle);
}

.srs-btn-easy {
  border-color: rgba(16, 185, 129, 0.25);
  background-color: rgba(16, 185, 129, 0.04);
}
.srs-btn-easy .srs-btn-title {
  color: var(--accent-emerald);
}

/* Reusable Shadcn InputOTP Group */
.otp-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.otp-box {
  width: 44px;
  height: 52px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.15s ease;
}

.otp-box:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.otp-separator {
  color: var(--text-dim);
  font-size: 18px;
  font-weight: 300;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.35s ease;
}

/* Reusable Audio Control Component */
.audio-control-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Circular Clean Audio Play Button */
.audio-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.audio-circle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-subtle);
  border-color: var(--border-color);
}

.audio-circle-btn:active {
  transform: scale(0.92);
  background-color: var(--border-color);
}

.audio-circle-btn.playing {
  background-color: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.audio-speed-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.audio-speed-btn:hover {
  border-color: var(--border-focus);
  color: var(--text-primary);
}
.audio-speed-btn:active {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}
.audio-speed-btn.playing {
  background: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.audio-speed-btn svg {
  width: 13px;
  height: 13px;
}

/* Reusable Voice Mic Button */
.mic-action-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mic-action-btn.listening {
  background-color: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   FLOATING DOCK BOTTOM NAVIGATION (TASTE SKILL SPECIFICATION)
   ========================================================================== */
.floating-dock-container {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 50;
  pointer-events: none;
  padding: 0 16px;
}

.floating-dock {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
}

.dock-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card-subtle);
  color: var(--text-dim);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.dock-btn:active {
  transform: scale(0.92);
}

/* Active circular button state */
.dock-btn.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transform: scale(1.08);
}
.dock-btn.active svg {
  stroke: var(--bg-primary);
}

/* Subtle floating tooltip pill above the active button */
.dock-tooltip {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-tooltip.show-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Floating Scroll-to-Top Button */
.scroll-top-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
}
.scroll-top-btn:active {
  transform: scale(0.92);
}
.scroll-top-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* Bilingual Feedback Card Styling */
.feedback-box {
  border-left: 3px solid var(--accent-blue);
  background-color: var(--bg-card-subtle);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
}

.feedback-row {
  margin-bottom: 8px;
}
.feedback-row:last-child {
  margin-bottom: 0;
}
.feedback-label {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.feedback-label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.feedback-content {
  color: var(--text-muted);
  margin-top: 2px;
  padding-left: 20px;
  line-height: 1.45;
}
