/**
 * Temajet Web Speech TTS Audio Player Styles
 * 
 * 100% Native, 0 External Dependencies, 0 KB Icon Fonts
 * Core Web Vitals 0 CLS, 0 TTFB Impact, Dark Mode & Mobile Optimized
 */

:root {
  --tj-tts-bg: #f8fafc;
  --tj-tts-border: #e2e8f0;
  --tj-tts-text: #0f172a;
  --tj-tts-subtext: #64748b;
  --tj-tts-accent: #e11d48;
  --tj-tts-accent-hover: #be123c;
  --tj-tts-btn-text: #ffffff;
}

.temajet-audio-player {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--tj-tts-bg);
  border: 1px solid var(--tj-tts-border);
  border-radius: 12px;
  padding: 10px 16px;
  margin: 16px 0 20px 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.temajet-audio-player:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.temajet-audio-player.is-playing {
  border-color: rgba(225, 29, 72, 0.3);
  background: #fff5f6;
}

/* Left Group (Play Button + Info) */
.tj-tts-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

/* Main Action Button (Play / Pause) */
.tj-tts-play-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--tj-tts-accent);
  color: var(--tj-tts-btn-text);
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.28);
  -webkit-tap-highlight-color: transparent;
}

.tj-tts-play-btn:hover {
  background: var(--tj-tts-accent-hover);
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.38);
}

.tj-tts-play-btn:active {
  transform: scale(0.95);
}

.tj-tts-play-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.15s ease;
}

/* Icon Switching */
.tj-tts-play-btn .icon-pause {
  display: none;
}

.temajet-audio-player.is-playing .tj-tts-play-btn .icon-play {
  display: none;
}

.temajet-audio-player.is-playing .tj-tts-play-btn .icon-pause {
  display: block;
}

/* Middle Info (Title, Duration, Status, Soundwave) */
.tj-tts-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.tj-tts-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--tj-tts-text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tj-tts-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--tj-tts-subtext);
}

.tj-tts-status {
  font-weight: 500;
  transition: color 0.2s ease;
}

.temajet-audio-player.is-playing .tj-tts-status {
  color: var(--tj-tts-accent);
  font-weight: 600;
}

/* Equalizer / Soundwave Animation */
.tj-tts-waves {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 14px;
  vertical-align: middle;
}

.tj-tts-wave-bar {
  width: 3px;
  height: 4px;
  background-color: var(--tj-tts-accent);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.temajet-audio-player.is-playing .tj-tts-wave-bar {
  animation: tjWaveAnim 1s ease-in-out infinite alternate;
}

.temajet-audio-player.is-playing .tj-tts-wave-bar:nth-child(1) {
  animation-delay: 0s;
}
.temajet-audio-player.is-playing .tj-tts-wave-bar:nth-child(2) {
  animation-delay: 0.25s;
}
.temajet-audio-player.is-playing .tj-tts-wave-bar:nth-child(3) {
  animation-delay: 0.5s;
}
.temajet-audio-player.is-playing .tj-tts-wave-bar:nth-child(4) {
  animation-delay: 0.15s;
}

@keyframes tjWaveAnim {
  0% {
    height: 4px;
  }
  100% {
    height: 14px;
  }
}

/* Right Controls (Speed Selector + Stop Button) */
.tj-tts-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tj-tts-speed-btn,
.tj-tts-stop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--tj-tts-border);
  color: var(--tj-tts-subtext);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tj-tts-stop-btn {
  width: 32px;
  padding: 0;
}

.tj-tts-speed-btn:hover,
.tj-tts-stop-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--tj-tts-text);
}

.tj-tts-stop-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Responsive Rules for Mobile */
@media (max-width: 576px) {
  .temajet-audio-player {
    padding: 8px 12px;
    gap: 10px;
  }
  .tj-tts-play-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .tj-tts-label {
    font-size: 13px;
  }
  .tj-tts-meta-row {
    font-size: 11px;
  }
  .tj-tts-speed-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }
  .tj-tts-stop-btn {
    width: 28px;
    height: 28px;
  }
}
