/* assets/css/tts.css */

/* ========== Base / Typography ========== */
.gpt4o-tts { display:grid; gap:12px; font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif; }

/* ========== Usage / Limits ========== */
.gpt4o-usage { padding:10px 12px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:10px; color:#0f172a; font-size:14px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.gpt4o-usage strong { font-weight:600; }
.gpt4o-usage .gpt4o-reset { margin-left:auto; color:#64748b; }

.gpt4o-limit { display:none; padding:12px; border-radius:10px; background:#fef2f2; border:1px solid #fecaca; color:#7f1d1d; }
.gpt4o-limit.show { display:block; }

/* ========== Container + Fields ========== */
.gpt4o-wrap { display:grid; gap:14px; background:#ffffff; border:1px solid #e5e7eb; border-radius:12px; padding:14px; }
.gpt4o-field { display:grid; gap:8px; }
.gpt4o-label { font-size:13px; font-weight:600; color:#334155; }
textarea, select { width:100%; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; font-size:14px; background:#fff; color:#0f172a; }
textarea { min-height:120px; resize:vertical; }

/* ========== Grid Layout ========== */
.gpt4o-grid { display:grid; gap:12px; grid-template-columns:repeat(3, minmax(160px,1fr)); }
@media (max-width: 860px) { .gpt4o-grid { grid-template-columns:1fr; } }

/* ========== Actions + Status ========== */
.gpt4o-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.gpt4o-status { font-size:14px; color:#475569; min-height:22px; }

/* ========== Buttons ========== */
.gpt4o-btn {
  appearance:none; border:none; cursor:pointer;
  padding:10px 14px; border-radius:10px;
  font-weight:600; font-size:14px;
  box-shadow:0 1px 0 rgba(0,0,0,0.05);
  transition:transform .02s ease-in;
  display:inline-flex; align-items:center; justify-content:center;
  height:42px; min-width:120px;
}
.gpt4o-btn:active { transform:translateY(1px); }
.gpt4o-btn:disabled { opacity:0.6; cursor:not-allowed; }
.gpt4o-recraft-btn { background:#2563eb; color:#fff; }
.gpt4o-generate-btn { background:#111827; color:#fff; margin-top:24px; }

/* ========== Spinner (inline) ========== */
.gpt4o-spinner { width:16px; height:16px; border-radius:50%; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; animation:gpt4o-spin .7s linear infinite; display:none; margin-left:6px; vertical-align:middle; }
.gpt4o-spinner.show { display:inline-block; }
@keyframes gpt4o-spin { to { transform:rotate(360deg);} }

/* ========== Recraft Section (show/hide) ========== */
.gpt4o-tts #gpt4o-recraft-section { display:none !important; }
.gpt4o-tts #gpt4o-recraft-section.show { display:block !important; }

/* ========== Pills (Use Original / Use Recrafted) ========== */
.gpt4o-pill {
  appearance:none; border:1px solid #cbd5e1; background:#fff; color:#0f172a;
  padding:6px 10px; border-radius:8px; font-weight:600; cursor:pointer;
  transition:transform .02s ease-in, background-color .15s ease;
}
.gpt4o-pill:hover { background:#f8fafc; }
.gpt4o-pill:active { transform:translateY(1px); }
.gpt4o-pill-active { background:#111827; color:#fff; border-color:#111827; }
.gpt4o-toggle-group { display:flex; gap:8px; margin-top:8px; }

/* ========== Toggle Buttons (Whisper / Legacy) ========== */
.gpt4o-toggle {
  display:inline-flex; align-items:center; justify-content:center;
  height:42px; min-width:120px; padding:0 16px;
  border-radius:8px; border:1px solid #cbd5e1;
  background:#f1f5f9; color:#334155;
  font-weight:600; font-size:14px; cursor:pointer;
  transition:all 0.15s ease-in-out; user-select:none; box-sizing:border-box;
  margin-top:24px;
}
.gpt4o-toggle:hover { background:#e2e8f0; }
.gpt4o-toggle.gpt4o-toggle-active { background:#2563eb; border-color:#1e40af; color:#fff; }
.gpt4o-toggle input { display:none; }

/* ========== Audio + Format + Download ========== */
.gpt4o-audio { margin-top:8px; width:100%; }
.gpt4o-audio-row { grid-template-columns: 1fr auto auto; align-items: center; }
.gpt4o-audio-row .gpt4o-field { display:flex; align-items:center; gap:8px; }
.gpt4o-audio-row .gpt4o-field .gpt4o-label { margin:0; white-space:nowrap; }
.gpt4o-audio-row .gpt4o-field select { width:auto; min-width:120px; }

/* Download Button */
.gpt4o-download {
  display:none; text-decoration:none;
  background:#2563eb; color:#fff;
  padding:10px 14px; border-radius:10px; font-weight:700;
  box-shadow:0 1px 0 rgba(0,0,0,0.05);
  transition:transform .02s ease-in, filter .15s ease-in;
}
.gpt4o-download:hover { filter:brightness(1.05); }
.gpt4o-download:active { transform:translateY(1px); }

/* ========== Recraft Overlay (covers Original Script) ========== */
.gpt4o-script-wrap { position:relative; }
.gpt4o-overlay {
  position:absolute; inset:24px 0 0 0;
  display:none; align-items:center; justify-content:center;
  background:rgba(15,23,42,0.55); border-radius:10px; z-index:2;
  backdrop-filter: blur(1px);
}
.gpt4o-overlay-box {
  display:flex; flex-direction:column; align-items:center; gap:10px;
  padding:14px 16px; background:rgba(255,255,255,0.9);
  border-radius:10px; border:1px solid #e2e8f0;
}
.gpt4o-overlay-spinner {
  width:20px; height:20px; border-radius:50%;
  border:2px solid rgba(15,23,42,.25); border-top-color:#111827;
  animation:gpt4o-spin .7s linear infinite;
}
.gpt4o-overlay-text { color:#111827; font-weight:700; font-size:14px; }

/* ========== Pronunciation Overlay ========== */
.gpt4o-pro-overlay {
  position:fixed; inset:0; background:rgba(2,6,23,.55);
  display:none; align-items:center; justify-content:center; z-index:9999;
}
.gpt4o-pro-panel {
  width:min(680px, 92vw); background:#fff; color:#0f172a; border-radius:12px;
  border:1px solid #e5e7eb; box-shadow:0 20px 60px rgba(0,0,0,.20); padding:10px 12px;
}
.gpt4o-pro-header { display:flex; align-items:center; justify-content:space-between; }
.gpt4o-pro-header h3 { margin:6px 0; font-size:16px; font-weight:800; color:#111827; }
.gpt4o-pro-close {
  background:transparent; border:0; font-size:22px; line-height:1; cursor:pointer; color:#475569;
}
.gpt4o-pro-body { padding:8px 0; }
.gpt4o-pro-list { display:grid; gap:8px; max-height:280px; overflow:auto; padding-right:4px; }
.gpt4o-pro-item {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  border:1px solid #e5e7eb; border-radius:8px; padding:8px 10px;
  background:#f8fafc;
}
.gpt4o-pro-word { font-weight:600; color:#0f172a; }
.gpt4o-pro-footer { display:flex; justify-content:flex-end; padding-top:8px; }

/* ========== Tip under Accent (conditional British tip) ========== */
.gpt4o-tip { margin-top:6px; font-size:12px; color:#475569; }

/* Pronunciation scan loading state */
.gpt4o-pro-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: #111827;
  font-weight: 600;
}
.gpt4o-pro-loading .gpt4o-pro-spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(15,23,42,.25);
  border-top-color: #111827;
  animation: gpt4o-spin .7s linear infinite;
}

