/* ==========================================================================
   GIỌNG NÓI AI — dùng lại token màu khai báo trong style.css
   ========================================================================== */

.tts-header {
  padding: 24px 24px 4px;
}

.tts-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.tts-header h2 .fa-wand-magic-sparkles { color: var(--color-purple); }

.tts-header p {
  max-width: 760px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.tts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 20px 24px 32px;
}

.tts-col {
  min-width: 0;
  padding: 20px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
}

.tts-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.tts-textarea,
.tts-select {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-main);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  outline: none;
  transition: var(--transition-smooth);
}

.tts-textarea { resize: vertical; line-height: 1.6; }

.tts-textarea:focus,
.tts-select:focus {
  background: var(--bg-surface-solid);
  border-color: var(--border-color-focus);
  box-shadow: var(--glow-cyan);
}

.tts-counter {
  margin: 6px 0 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.tts-select { margin-bottom: 14px; }

/* --- Cảnh báo khi chọn giọng nhân bản ---------------------------------- */

.tts-clone-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--color-warning);
  border-radius: 9px;
}

.tts-clone-warning .fa-triangle-exclamation {
  margin-top: 2px;
  color: var(--color-warning);
}

.tts-clone-warning[hidden] { display: none; }

/* --- Nút tạo ----------------------------------------------------------- */

.btn-tts-generate {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  background: var(--color-purple);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-tts-generate:hover:not(:disabled) { box-shadow: var(--glow-purple); }
.btn-tts-generate:disabled { cursor: not-allowed; opacity: 0.65; }

/* --- Trạng thái -------------------------------------------------------- */

.tts-status {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.tts-status-info    { color: var(--text-muted); }
.tts-status-success { color: var(--color-success); }
.tts-status-error   { color: var(--color-danger); }

/* --- Kết quả ----------------------------------------------------------- */

.tts-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--text-muted);
  text-align: center;
}

.tts-result > .fas { font-size: 34px; opacity: 0.35; }
.tts-result p { margin: 0; font-size: 13px; }

.tts-result-filled {
  width: 100%;
  text-align: left;
}

.tts-result-text {
  margin: 0 0 10px;
  font-size: 15px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-main);
}

.tts-result-source {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.tts-audio { width: 100%; margin-bottom: 14px; }

.tts-download {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.tts-download:hover { text-decoration: underline; }

/* --- Trạng thái tắt / chưa đăng nhập ----------------------------------- */

.tts-offline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 40px 24px;
  color: var(--text-muted);
  text-align: center;
}

.tts-offline .fas { font-size: 40px; opacity: 0.3; }
.tts-offline h3 { margin: 0; font-size: 17px; color: var(--text-main); }
.tts-offline p { max-width: 420px; margin: 0; font-size: 13px; line-height: 1.6; }
.tts-offline .btn-tts-generate { width: auto; padding: 11px 26px; }

/* --- Công tắc đồng ý nhân bản trong khu quản trị ----------------------- */

.clone-consent-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid var(--color-warning);
  border-radius: 9px;
  cursor: pointer;
}

.clone-consent-toggle strong { color: var(--text-main); }

/* --- Màn hình nhỏ ------------------------------------------------------ */

@media (max-width: 900px) {
  .tts-grid { grid-template-columns: minmax(0, 1fr); }
  .tts-result { min-height: 180px; }
}
