/* ==========================================================================
   Tokvian Audio Studio Chat Layout (/audio)
   Matches the exact layout of /playground, /images, and /videos
   ========================================================================== */

/* Audio Reference Card in Composer */
.audio-ref-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(154, 239, 210, 0.12);
  border: 1px solid rgba(154, 239, 210, 0.25);
  display: grid;
  place-items: center;
  color: #9aefd2;
  flex-shrink: 0;
}

.audio-ref-player {
  flex: 1 1 200px;
  max-width: 320px;
  height: 32px;
}

/* User Message Audio Attachment Card */
.chat-audio-attachment {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 8px;
  max-width: 480px;
  flex-wrap: wrap;
}

.chat-audio-attachment .audio-att-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(154, 239, 210, 0.1);
  display: grid;
  place-items: center;
  color: #9aefd2;
  flex-shrink: 0;
}

.chat-audio-attachment .audio-att-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-audio-attachment .audio-att-info strong {
  font-size: 15px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-audio-attachment .audio-att-info small {
  font-size: 15px;
  color: #9da0b3;
}

.chat-audio-attachment .chat-audio-player {
  width: 100%;
  height: 34px;
  margin-top: 4px;
}

/* Model Audio Response Card */
.audio-chat-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  padding: 18px 22px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  backdrop-filter: blur(20px) !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

.audio-chat-player-row {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  width: 100% !important;
}

.audio-chat-player-row audio,
.chat-audio-player {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 44px !important;
  border-radius: 999px !important;
  outline: none !important;
}

.audio-download-btn {
  height: 44px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  font-size: 13.5px !important;
  font-weight: 550 !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  flex-shrink: 0 !important;
}

.audio-chat-prompt-quote {
  font-size: 15px;
  line-height: 1.5;
  color: #9da0b3;
  border-left: 2px solid rgba(154, 239, 210, 0.3);
  padding-left: 10px;
  font-style: italic;
}

.audio-chat-transcript-text {
  font-size: 15px;
  line-height: 1.6;
  color: #e2e2ea;
  white-space: pre-wrap;
  word-break: break-word;
}

.audio-chat-transcript-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 600px) {
  .audio-chat-player-row {
    flex-direction: column;
    align-items: stretch;
  }
  .audio-chat-player-row a {
    justify-content: center;
  }
}

#audio-form .form-error.visible {
  display: block !important;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.5;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
}

/* Unified chips sizing across Mode, Voice, Speed and Language */
[data-page=audio] .video-settings-group,
[data-page=speech] .video-settings-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

[data-page=audio] .settings-bar-label,
[data-page=speech] .settings-bar-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary, #9da0b3);
  line-height: 1;
}

[data-page=audio] .ratio-chip-compact,
[data-page=speech] .ratio-chip-compact {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 0 14px !important;
  min-width: 44px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 34px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: #9da0b3 !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
}

[data-page=audio] .ratio-chip-compact:hover,
[data-page=speech] .ratio-chip-compact:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

[data-page=audio] .ratio-chip-compact.is-active,
[data-page=speech] .ratio-chip-compact.is-active {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #0d0e12 !important;
  font-weight: 600 !important;
}

[data-page=audio] .ratio-chip-compact span,
[data-page=speech] .ratio-chip-compact span {
  font-size: 15px !important;
  line-height: 1 !important;
}

/* Light Theme Overrides for /audio (Strictly neutral per AGENTS.md) */
html.theme-light .audio-chat-card,
[data-theme="light"] .audio-chat-card {
  background: #ffffff !important;
  border: 1px solid #e3e6eb !important;
  border-radius: 18px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
  color: #11141a !important;
}

html.theme-light [data-page=audio] .ratio-chip-compact,
[data-theme="light"] [data-page=audio] .ratio-chip-compact,
html.theme-light [data-page=speech] .ratio-chip-compact,
[data-theme="light"] [data-page=speech] .ratio-chip-compact {
  background: #ffffff !important;
  border: 1px solid #d5d9e0 !important;
  color: #374151 !important;
}

html.theme-light [data-page=audio] .ratio-chip-compact:hover,
[data-theme="light"] [data-page=audio] .ratio-chip-compact:hover,
html.theme-light [data-page=speech] .ratio-chip-compact:hover,
[data-theme="light"] [data-page=speech] .ratio-chip-compact:hover {
  background: #f0f2f5 !important;
  border-color: #b8bec9 !important;
  color: #11141a !important;
}

html.theme-light [data-page=audio] .ratio-chip-compact.is-active,
[data-theme="light"] [data-page=audio] .ratio-chip-compact.is-active,
html.theme-light [data-page=speech] .ratio-chip-compact.is-active,
[data-theme="light"] [data-page=speech] .ratio-chip-compact.is-active {
  background: #11141a !important;
  border-color: #11141a !important;
  color: #ffffff !important;
}

html.theme-light .audio-chat-transcript-text,
[data-theme="light"] .audio-chat-transcript-text {
  color: #11141a !important;
}

html.theme-light .audio-chat-prompt-quote,
[data-theme="light"] .audio-chat-prompt-quote {
  color: #333742 !important;
  border-left-color: #11141a !important;
}

html.theme-light .audio-chat-transcript-actions,
[data-theme="light"] .audio-chat-transcript-actions {
  border-top-color: #dce1e8 !important;
}

html.theme-light .chat-audio-attachment,
[data-theme="light"] .chat-audio-attachment {
  background: #f8f9fa !important;
  border: 1px solid #dce1e8 !important;
  color: #11141a !important;
}

html.theme-light .chat-audio-attachment .audio-att-info strong,
[data-theme="light"] .chat-audio-attachment .audio-att-info strong {
  color: #11141a !important;
}

html.theme-light .chat-audio-attachment .audio-att-info small,
[data-theme="light"] .chat-audio-attachment .audio-att-info small {
  color: #5e6573 !important;
}

html.theme-light .chat-audio-attachment .audio-att-icon,
html.theme-light .audio-ref-icon,
[data-theme="light"] .chat-audio-attachment .audio-att-icon,
[data-theme="light"] .audio-ref-icon {
  background: #f0f2f5 !important;
  border: 1px solid #dce1e8 !important;
  color: #11141a !important;
}

html.theme-light [data-page=audio] .settings-bar-label,
[data-theme="light"] [data-page=audio] .settings-bar-label,
html.theme-light [data-page=speech] .settings-bar-label,
[data-theme="light"] [data-page=speech] .settings-bar-label {
  color: #333742 !important;
}
