/* st-tools.css — Tone section, improve section, OCR banner, source loading, toast, segment alignment, vocabulary cards */
/* ===== WU-5: Tone Section ===== */
.st-drawer-section-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.st-tone-section {
  margin-bottom: var(--space-6);
}

.st-tone-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.st-tone-preset-btn {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: var(--color-card);
  transition: all var(--transition);
}

.st-tone-preset-btn:hover {
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--color-text-primary);
}

.st-tone-preset-btn.active {
  background: var(--color-text-primary);
  color: var(--color-card);
  border-color: var(--color-text-primary);
}

.st-tone-slider-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.st-slider-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.st-tone-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  outline: none;
}

.st-tone-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-text-primary);
  cursor: pointer;
  border: 2px solid var(--color-card);
  box-shadow: 0 1px 3px var(--st-overlay-light);
}

.st-tone-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-text-primary);
  cursor: pointer;
  border: 2px solid var(--color-card);
}

/* ===== WU-5: Improve Section ===== */
.st-improve-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.st-improve-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  background: var(--color-card);
  transition: border-color var(--transition), background var(--transition);
  text-align: left;
}

.st-improve-btn:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.04);
}

.st-improve-btn svg {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

/* ===== WU-5: Drawer panel layout fix ===== */
.st-drawer-panel[data-panel="chat"] {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
}

/* ===== Mobile drawer — full width ===== */
@media (max-width: 767px) {
  .st-drawer {
    width: 100%;
  }
}

/* ===== WU-5: Dark mode additions ===== */
/* prefers-color-scheme block removed — [data-theme="dark"] block below is the single source of truth */

[data-theme="dark"] {
  .st-tone-preset-btn {
    background: var(--st-hover-dark);
  }
  .st-improve-btn {
    background: var(--st-hover-dark);
  }
  .st-shortcut-card {
    background: var(--st-hover-dark);
    border-color: var(--color-border);
  }
  .st-shortcut-icon {
    background: rgba(255,255,255,0.06);
  }
  .st-chat-mic-btn:hover {
    background: var(--st-hover-dark);
  }
}

/* ===== OCR loading banner ===== */
.st-ocr-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-primary);
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
.st-ocr-banner svg {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

/* ===== Source panel loading overlay (file upload) ===== */
.st-source-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-card, #fff);
  z-index: 5;
  border-radius: 8px;
}
.st-source-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  width: 80%;
  max-width: 320px;
}
.st-source-loading-inner span {
  font-size: var(--font-size-sm, 13px);
  font-weight: 500;
  color: var(--color-text-secondary, #646e78);
}
.st-source-loading .st-skeleton {
  position: static;
  padding: 0;
  background: none;
}

/* ===== WU-4: Toast notification ===== */
.st-toast {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text-primary);
  color: var(--color-card);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-modal);
  z-index: 200;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
  white-space: nowrap;
}

.st-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Segment Alignment (hover highlight) ===== */
.st-source-editor .ql-editor > *,
.st-target-output .ql-editor > * {
  transition: background 180ms ease;
  border-radius: 4px;
}
.st-target-output .ql-editor > * {
  cursor: pointer !important;
}

.st-align-active {
  background: rgba(0, 0, 0, 0.04) !important;
}

/* Dark mode alignment */
[data-theme="dark"] .st-align-active { background: rgba(255, 255, 255, 0.06) !important; }
/* prefers-color-scheme .st-align-active removed — [data-theme="dark"] rule above is the single source of truth */

/* ===== Alternative Translations Popover ===== */
/* ===== Vocabulary Cards Popover ===== */
.st-alt-popover {
  position: absolute;
  z-index: 100;
  background: var(--color-card, #fff);
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.st-alt-popover.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Header */
.st-vocab-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border, #e4e6e8);
  color: var(--color-text-secondary, #73716c);
  font-size: var(--font-size-xs, 12px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.st-vocab-header svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* Vocabulary card row */
.st-vocab-card {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border, #e4e6e8);
}
.st-vocab-card:last-child {
  border-bottom: none;
}

/* Word pair row */
.st-vocab-words {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* TTS button on vocab card */
.st-vocab-tts {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  color: var(--color-text-tertiary, #8f8e8a);
  transition: color 180ms ease, background 180ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-vocab-tts:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.05);
}
.st-vocab-tts.playing {
  color: var(--color-text-primary);
}
.st-vocab-src {
  font-weight: 600;
  font-size: var(--font-size-sm, 14px);
  color: var(--color-text-primary, #131313);
}
.st-vocab-arrow {
  color: var(--color-text-tertiary, #8f8e8a);
  font-size: 13px;
  flex-shrink: 0;
}
.st-vocab-tgt {
  font-weight: 600;
  font-size: var(--font-size-sm, 14px);
  color: var(--color-text-primary);
}

/* Meta line: word class + note */
.st-vocab-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.st-vocab-class {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-tertiary, #8f8e8a);
  font-style: italic;
}
.st-vocab-note {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-secondary, #73716c);
}
.st-vocab-note::before {
  content: '·';
  margin-right: 6px;
  color: var(--color-text-tertiary, #8f8e8a);
}

/* Loading dots */
.st-alt-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-4, 16px);
}
.st-alt-loading .st-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-tertiary, #8f8e8a);
  animation: st-pulse-dot 1.2s infinite;
}
.st-alt-loading .st-dot:nth-child(2) { animation-delay: 0.15s; }
.st-alt-loading .st-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes st-pulse-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Dark mode popover */
[data-theme="dark"] .st-alt-popover,
.dark .st-alt-popover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
}
/* prefers-color-scheme .st-alt-popover removed — [data-theme="dark"] rule above is the single source of truth */

