/* Scoped CSS for Free Text Translator */
.ftt-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  line-height: 1.5;
}

.ftt-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.ftt-hero-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369a1;
  background-color: #e0f2fe;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.ftt-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem;
  letter-spacing: -0.025em;
}

.ftt-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  max-width: 650px;
  margin: 0 auto;
}

/* Tabs */
.ftt-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.75rem;
  overflow-x: auto;
}

.ftt-tab {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ftt-tab:hover {
  color: #0f172a;
}

.ftt-tab-active {
  color: #0284c7;
  border-bottom-color: #0284c7;
}

/* Views */
.ftt-view {
  display: none;
}

.ftt-view-active {
  display: block;
}

/* Card */
.ftt-translator-card, .ftt-phrasebook-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Language Bar */
.ftt-lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.ftt-lang-select-box {
  flex: 1;
}

.ftt-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  background-color: #ffffff;
  color: #0f172a;
}

.ftt-select:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.ftt-swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.ftt-swap-btn:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* Panels Grid */
.ftt-panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .ftt-panels-grid {
    grid-template-columns: 1fr;
  }
}

.ftt-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background-color: #ffffff;
  overflow: hidden;
}

.ftt-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 1rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8125rem;
}

.ftt-panel-title {
  font-weight: 600;
  color: #475569;
}

.ftt-count {
  color: #94a3b8;
}

.ftt-textarea {
  width: 100%;
  box-sizing: border-box;
  height: 200px;
  padding: 1rem;
  border: none;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-family: inherit;
  color: #0f172a;
  resize: vertical;
  outline: none;
}

.ftt-result-area {
  width: 100%;
  box-sizing: border-box;
  height: 200px;
  padding: 1rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: #0f172a;
  background-color: #f8fafc;
  overflow-y: auto;
  user-select: text;
}

.ftt-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.ftt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ftt-action-btn:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.ftt-action-btn-active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.ftt-copied-notice {
  color: #16a34a;
}

/* Main action buttons */
.ftt-main-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ftt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #0284c7;
  border: 1px solid #0284c7;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ftt-btn:hover {
  background-color: #0369a1;
}

.ftt-btn-primary {
  background-color: #0284c7;
}

.ftt-btn-secondary {
  background-color: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}

.ftt-btn-secondary:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.ftt-btn-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

/* Phrasebook */
.ftt-section-heading {
  font-size: 1.375rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.5rem;
}

.ftt-section-desc {
  font-size: 0.9375rem;
  color: #64748b;
  margin: 0 0 1.25rem;
}

.ftt-filter-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.ftt-chip {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ftt-chip:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.ftt-chip-active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.ftt-phrases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.ftt-phrase-item {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ftt-phrase-en {
  font-size: 0.9375rem;
  color: #0f172a;
}

.ftt-phrase-trans {
  font-size: 0.9375rem;
  color: #0284c7;
  font-weight: 500;
}

.ftt-phrase-apply-btn {
  margin-top: 0.25rem;
  align-self: flex-start;
}

/* Ad slots */
.ftt-ad-slot {
  min-height: 280px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  color: #94a3b8;
  font-size: 0.875rem;
}

.ftt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ftt-panel-source {
  /* styled panel */
}

.ftt-panel-target {
  /* styled panel */
}

.ftt-mt-4 { margin-top: 1.5rem; }
