/* Aprendos Audio Player - Shared Styles */
/* Based on HorizontalPlayer from Hero.jsx */

.audio-player {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  position: relative;
}


.audio-player-card {
  border-radius: 24px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  background: rgba(28, 25, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 30px 60px -15px rgba(0, 0, 0, 0.35),
    0 15px 30px -10px rgba(0, 0, 0, 0.2);
}

@media (min-width: 640px) {
  .audio-player-card {
    border-radius: 32px;
    padding: 2rem;
  }
}

/* Language Toggle */
.player-lang-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.player-lang-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1.5px solid rgba(214, 58, 180, 0.4);
  background: transparent;
  color: #a8a29e;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-lang-btn:hover {
  border-color: #D63AB4;
  color: #e7e5e4;
}

.player-lang-btn.active {
  background: #D63AB4;
  border-color: #D63AB4;
  color: white;
}

.player-lang-flag {
  border-radius: 2px;
  flex-shrink: 0;
}

/* Status Row */
.player-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #a8a29e;
  margin-bottom: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.player-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.player-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #57534e;
  transition: background-color 0.3s;
}

.player-status-dot.playing {
  background: #22c55e;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Main Content Row */
.player-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .player-content {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* Album Art */
.player-album-art {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.player-album-art img {
  width: 3.5rem;
  height: 3.5rem;
  transform: rotate(-12deg);
}

/* Track Info */
.player-track-info {
  flex: 1;
  min-width: 0;
  text-align: center;
  width: 100%;
}

@media (min-width: 640px) {
  .player-track-info {
    text-align: left;
  }
}

.player-track-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: white;
  line-height: 1.25;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-track-description {
  font-size: 0.875rem;
  color: #a8a29e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 1rem;
}

/* Progress Bar */
.player-progress-container {
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  cursor: pointer;
}

.player-progress-bar {
  height: 100%;
  background: #db2777;
  border-radius: 9999px;
  transition: width 0.3s;
  width: 0%;
}

/* Waveform Visualizer */
.player-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  height: 32px;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.waveform-bar {
  flex: 1;
  margin: 0 1px;
  border-radius: 9999px;
  background: #db2777;
  height: 4px;
  transition: height 0.1s ease;
}

.waveform-bar.idle {
  animation: waveIdle 2s ease-in-out infinite alternate;
}

.waveform-bar.playing {
  animation: waveActive 0.5s ease-in-out infinite alternate;
}

@keyframes waveIdle {
  0% { height: 4px; }
  100% { height: 10px; }
}

@keyframes waveActive {
  0% { height: 4px; }
  100% { height: 28px; }
}

/* Controls Row */
.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
}

.player-time {
  font-size: 0.75rem;
  font-family: monospace;
  color: #78716c;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 640px) {
  .player-buttons {
    gap: 1.5rem;
  }
}

.player-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.player-btn-skip {
  color: #78716c;
}

.player-btn-skip:hover {
  color: white;
}

.player-btn-play {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: white;
  color: black;
  box-shadow: 0 10px 25px -5px rgba(255, 255, 255, 0.1);
}

@media (min-width: 640px) {
  .player-btn-play {
    width: 3.5rem;
    height: 3.5rem;
  }
}

.player-btn-play:hover {
  transform: scale(1.05);
}

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

.player-btn-play svg {
  width: 24px;
  height: 24px;
}

.player-btn-play .play-icon {
  margin-left: 2px;
}

.player-speed {
  font-size: 0.75rem;
  font-weight: 700;
  color: #db2777;
  cursor: pointer;
  transition: color 0.2s;
}

.player-speed:hover {
  color: white;
}

/* Try Demo Tooltip (Desktop Only) - matches Hero.jsx */
.player-tooltip {
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateX(100%) translateY(-50%);
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #f5f5f4;
  display: none;
  cursor: pointer;
  opacity: 0;
}

.player-tooltip:hover {
  background: #fafaf9;
}

.player-tooltip-arrow {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateX(-6px) translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: white;
  border-left: 1px solid #f5f5f4;
  border-bottom: 1px solid #f5f5f4;
}

.player-tooltip-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1c1917;
  white-space: nowrap;
}

@media (min-width: 1280px) {
  .player-tooltip {
    display: block;
    opacity: 1;
    animation: tooltipBounceScale 1.3s ease-in-out infinite;
    animation-delay: 0.5s;
  }

  .player-tooltip.playing {
    animation: none;
    transform: translateX(100%) translateY(-50%);
  }
}

/* Bounce + Scale animation matching Hero.jsx */
@keyframes tooltipBounceScale {
  0%, 100% {
    transform: translateX(100%) translateY(-50%) translateX(0) scale(1);
  }
  50% {
    transform: translateX(100%) translateY(-50%) translateX(-6px) scale(1.05);
  }
}

/* More Languages Coming Soon Teaser - Editorial Caption Style */
.more-languages-teaser {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0 1rem;
}

/* Decorative line with gradient fade */
.teaser-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(214, 58, 180, 0.4) 20%,
    rgba(214, 58, 180, 0.4) 80%,
    transparent 100%
  );
}

/* The text container */
.teaser-content {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* Orbiting dots representing future languages */
.teaser-orbit {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
}

.teaser-orbit-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #D63AB4;
}

.teaser-orbit-dot:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: orbitFade 3s ease-in-out infinite;
}

.teaser-orbit-dot:nth-child(2) {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  animation: orbitFade 3s ease-in-out infinite 1s;
}

.teaser-orbit-dot:nth-child(3) {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: orbitFade 3s ease-in-out infinite 2s;
}

@keyframes orbitFade {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Editorial italic text */
.teaser-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #78716c;
  letter-spacing: 0.01em;
}

/* Hover state - text becomes magenta */
.more-languages-teaser:hover .teaser-text {
  color: #D63AB4;
  transition: color 0.3s ease;
}

.more-languages-teaser:hover .teaser-orbit-dot {
  animation-play-state: paused;
  opacity: 1;
}

/* Second decorative line */
.teaser-line-end {
  width: 2rem;
  height: 1px;
  background: rgba(214, 58, 180, 0.3);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .waveform-bar,
  .player-status-dot,
  .player-tooltip,
  .teaser-sparkle {
    animation: none !important;
  }

  .waveform-bar.idle,
  .waveform-bar.playing {
    height: 8px;
  }
}
