/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ../../../../nodevenv/domains/tts.snowfarn.space/public_html/myapp/22/lib/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!../../../../nodevenv/domains/tts.snowfarn.space/public_html/myapp/22/lib/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/* ============================================================
   เว็บ TTS — ธีมดำล้วน + ออโรร่าเล็กน้อย (เน้นลื่น ไม่แล็ค)
   ※ อนิเมชันทุกอันใช้ transform/opacity เท่านั้น (GPU ลื่น)
   ※ ห้ามอนิเมชัน background-position/filter (ทำให้วาดใหม่ทุกเฟรม = แล็ค)
   ============================================================ */

:root {
  --bg: #000000;
  --violet: #5227ff;
  --pink: #ff7ac6;
  --mint: #7cffcb;
  --text: #f4f3fa;
  --muted: #9a94b5;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-border: rgba(255, 255, 255, 0.09);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Anuphan", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- พื้นหลังออโรร่า (เล็กน้อย + ลื่น) ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  mix-blend-mode: screen;
  opacity: 0.32; /* นิดหน่อยตามสั่ง */
  will-change: transform;
  transform: translateZ(0);
}

.blob-1 {
  width: 44vmax;
  height: 44vmax;
  background: radial-gradient(circle at center, rgba(82, 39, 255, 0.6), transparent 62%);
  top: -16%;
  left: -14%;
  animation: drift-1 34s ease-in-out infinite;
}

.blob-2 {
  width: 36vmax;
  height: 36vmax;
  background: radial-gradient(circle at center, rgba(255, 122, 198, 0.45), transparent 62%);
  bottom: -18%;
  right: -12%;
  animation: drift-2 44s ease-in-out infinite;
}

/* เลื่อนอย่างเดียว (ไม่มี scale/filter เปลี่ยน = ไม่ต้อง re-raster) */
@keyframes drift-1 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(6%, 8%, 0); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-8%, -6%, 0); }
}

/* ---------- โครงหน้า ---------- */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 20px 72px;
}

/* อนิเมชันเข้า (transform+opacity = ลื่น) */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.enter {
  animation: fade-up 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.enter-2 { animation-delay: 0.1s; }
.enter-3 { animation-delay: 0.2s; }

/* ---------- หัวข้อ ---------- */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.header .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mint);
  background: rgba(124, 255, 203, 0.07);
  border: 1px solid rgba(124, 255, 203, 0.22);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.header h1 {
  margin: 0;
  font-size: clamp(28px, 5.5vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  /* gradient คงที่ (ไม่อนิเมชัน — กันแล็ค) */
  background: linear-gradient(90deg, #7d5cff, #ff7ac6, #7cffcb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header p {
  color: var(--muted);
  margin: 12px 0 0;
  font-size: 15px;
}

/* ---------- การ์ด glass ---------- */
.card {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  padding: 26px;
}

/* ---------- กล่องพิมพ์ ---------- */
.textarea-wrap {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: "Anuphan", "Inter", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  padding: 14px 14px 36px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea::placeholder {
  color: #6b6590;
}

textarea:focus {
  border-color: rgba(124, 255, 203, 0.45);
  box-shadow: 0 0 0 4px rgba(124, 255, 203, 0.1);
}

.char-count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 12px;
  color: var(--muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ---------- ปุ่มตัวอย่าง ---------- */
.samples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}

.samples button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, color 0.15s, border-color 0.15s;
}

.samples button:hover {
  color: var(--text);
  border-color: rgba(255, 122, 198, 0.45);
  transform: translateY(-1px);
}

/* ---------- ช่องตัวเลือก ---------- */
.field {
  margin-top: 18px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 9px;
}

select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 999px; /* กลมแบบเม็ดยา — กันดูเหลี่ยม */
  color: var(--text);
  font-family: "Anuphan", "Inter", sans-serif;
  font-size: 15px;
  padding: 14px 46px 14px 18px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 55%, calc(100% - 17px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

select:hover {
  border-color: rgba(255, 122, 198, 0.4);
  background-color: rgba(255, 255, 255, 0.06);
}

select:focus {
  border-color: rgba(255, 122, 198, 0.5);
  box-shadow: 0 0 0 4px rgba(255, 122, 198, 0.12);
}

select optgroup,
select option {
  background: #0c0c12;
  color: var(--text);
}

/* ---------- slider ---------- */
input[type="range"] {
  flex: 1 1;
  width: 100%;
  height: 6px;
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--violet);
  box-shadow: 0 2px 10px rgba(82, 39, 255, 0.45);
  cursor: pointer;
  -webkit-transition: transform 0.15s;
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--violet);
  cursor: pointer;
}

.slider-value {
  min-width: 54px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 6px 9px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* ---------- ปุ่มแปลง ---------- */
.convert-btn {
  margin-top: 24px;
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border: none;
  border-radius: var(--radius-md);
  padding: 15px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, opacity 0.15s;
  box-shadow: 0 10px 30px rgba(82, 39, 255, 0.3);
}

.convert-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(82, 39, 255, 0.45);
}

.convert-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.convert-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---------- สถานะ ---------- */
.status {
  margin-top: 16px;
  font-size: 14px;
  text-align: center;
  min-height: 22px;
  font-weight: 500;
}

.status.error {
  color: #ff8fa3;
}

.status.info {
  color: var(--muted);
}

/* ---------- ผลลัพธ์ ---------- */
.result {
  margin-top: 20px;
  background: rgba(124, 255, 203, 0.06);
  border: 1px solid rgba(124, 255, 203, 0.25);
  border-radius: var(--radius-md);
  padding: 18px;
  animation: fade-up 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.result audio {
  width: 100%;
  outline: none;
  border-radius: 10px;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #052019;
  background: linear-gradient(90deg, var(--mint), #6ee8c9);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.25s;
  box-shadow: 0 8px 24px rgba(124, 255, 203, 0.25);
}

.download-btn:hover {
  transform: translateY(-2px);
}

/* ---------- อธิบาย ---------- */
.how {
  margin-top: 44px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.how h2 {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
}

.how p {
  margin: 0 0 10px;
}

.how p:last-child {
  margin-bottom: 0;
}

.how code {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 1px 7px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 12.5px;
  color: var(--pink);
}

.footer {
  margin-top: 40px;
  text-align: center;
  color: #5f5a80;
  font-size: 13px;
}

::selection {
  background: #fff;
  color: var(--bg);
}

/* ---------- เคารพการลดการเคลื่อนไหว ---------- */
@media (prefers-reduced-motion: reduce) {
  .blob,
  .enter,
  .result {
    animation: none !important;
  }
}

/* ============================================================
   หน้า คุยกับ AI (/voice)
   ============================================================ */

/* ---------- แถบลิงก์สลับหน้า ---------- */
.nav-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.nav-link {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 9px 18px;
  text-decoration: none;
  transition: transform 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  border-color: rgba(255, 122, 198, 0.45);
  transform: translateY(-1px);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, var(--violet), #7a4bff);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(82, 39, 255, 0.3);
}

/* ---------- การ์ดบทสนทนา ---------- */
.voice-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 480px;
}

.chat-log {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 6px 2px;
  scrollbar-width: thin;
}

.chat-empty {
  align-self: center;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  padding: 34px 10px;
  max-width: 320px;
}

.bubble {
  max-width: 80%;
  padding: 11px 16px;
  border-radius: 18px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  animation: fade-up 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.bubble.user {
  align-self: flex-end;
  background: linear-gradient(90deg, var(--violet), #7a4bff);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.bubble.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 6px;
}

/* จุด "กำลังคิด" */
.bubble.typing {
  display: inline-flex;
  gap: 5px;
  padding: 14px 16px;
}

.bubble.typing .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing-dot 1.2s ease-in-out infinite;
}

.bubble.typing .dot:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- ปุ่มไมค์ ---------- */
.mic-row {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 26px;
  background: linear-gradient(135deg, var(--violet), var(--pink));
  color: #fff;
  box-shadow: 0 10px 30px rgba(82, 39, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.25s;
}

.mic-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(82, 39, 255, 0.5);
}

.mic-btn.listening {
  animation: mic-pulse 1.2s ease-in-out infinite;
}

/* ใช้ scale เท่านั้น (transform) — กันแล็ค */
@keyframes mic-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.mic-status {
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
  min-height: 20px;
}

/* ---------- ช่องพิมพ์ ---------- */
.input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: "Anuphan", "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
  border-color: rgba(255, 122, 198, 0.45);
  box-shadow: 0 0 0 4px rgba(255, 122, 198, 0.1);
}

.send-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, opacity 0.15s;
  box-shadow: 0 8px 22px rgba(82, 39, 255, 0.3);
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.speech-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.speech-toggle input {
  accent-color: var(--violet);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

