/**
 * Modern Audio Player Styling
 * Initial state with text, then transforms to horizontal player
 */

/* Initial state - play button with text */
.audio-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0;
  transition: all 0.3s ease;
}

.audio-container.player-active {
  align-items: center;
  flex-direction: row;
  gap: 16px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* Audio wrapper - initial state */
.audio-wrapper {
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: none;
  width: fit-content;
  gap: 12px;
}

.audio-wrapper:hover {
  background: transparent;
  box-shadow: none;
}

/* Transform to horizontal player */
.audio-container.player-active .audio-wrapper {
  gap: 16px;
  width: 100%;
  background: transparent;
  padding: 0;
  box-shadow: none;
  cursor: default;
}

.audio-container.player-active .audio-wrapper:hover {
  background: transparent;
  box-shadow: none;
}

/* Initial play button styling */
.audio-play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  color: #0D0D0D;
  transition: all 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
}

.audio-play-button:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
  transform: scale(1.05);
  color: #0D0D0D;
}

.audio-play-button:active {
  transform: scale(0.95);
}

/* Button text styling - visible initially */
.audio-button-text {
  font-size: 14px;
  font-weight: 500;
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0.3px;
  color: #0D0D0D;
}

/* Hide text when in player mode */
.audio-container.player-active .audio-button-text {
  display: none;
}

/* Hide standalone total time when in player mode */
.audio-container.player-active .audio-wrapper > .audio-time-total {
  display: none;
}

/* Icon styling */
.audio-play-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.audio-wrapper:hover .audio-play-button svg {
  transform: scale(1.1);
}

.audio-container.player-active .audio-wrapper:hover .audio-play-button svg {
  transform: none;
}

/* Progress section - hidden initially */
.audio-progress-section {
  flex: 1;
  display: none;
  align-items: center;
  gap: 12px;
}

.audio-container.player-active .audio-progress-section {
  display: flex;
}

/* Volume section - hidden initially */
.audio-volume-section {
  display: none;
  align-items: center;
  gap: 8px;
}

.audio-container.player-active .audio-volume-section {
  display: flex;
}

/* Time displays */
.audio-time-current {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #0D0D0D;
  font-weight: 500;
  min-width: 35px;
  text-align: right;
}

.audio-time-total {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #888888;
  font-weight: 400;
  min-width: 35px;
}

/* Show total time in initial state after button text */
.audio-container:not(.player-active) .audio-time-total {
  display: block;
}

/* Hide total time in initial state when inside progress section */
.audio-container:not(.player-active) .audio-progress-section .audio-time-total {
  display: none;
}

/* Progress bar */
.audio-progress-bar {
  flex: 1;
  height: 4px;
  background: #e8e8e8;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.audio-progress-fill {
  height: 100%;
  background: #0D0D0D;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

.audio-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #0D0D0D;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.audio-progress-bar:hover .audio-progress-handle {
  opacity: 1;
}

/* Volume control styling */
.audio-volume-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666666;
}

.audio-volume-button:hover {
  background: #f0f0f0;
  color: #0D0D0D;
}

.audio-volume-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.audio-volume-bar {
  width: 60px;
  height: 3px;
  background: #e8e8e8;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.audio-volume-fill {
  height: 100%;
  background: #0D0D0D;
  border-radius: 2px;
  width: 70%;
  transition: width 0.1s ease;
}

/* Playing state */
.audio-container.player-active .audio-wrapper.playing .audio-play-button {
  background: #0D0D0D;
  border-color: #0D0D0D;
  color: #ffffff;
}

.audio-container.player-active .audio-wrapper.playing .audio-play-button:hover {
  background: #333333;
  border-color: #333333;
}

.audio-container.player-active .audio-wrapper.playing .audio-play-button svg {
  fill: #ffffff;
}

/* Floating audio shortcut */
.audio-shortcut-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.audio-shortcut-float.show {
  display: flex;
}

.audio-shortcut-play,
.audio-shortcut-volume {
  width: 40px;
  height: 40px;
  background: #0D0D0D;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.audio-shortcut-play:hover,
.audio-shortcut-volume:hover {
  background: #333333;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.audio-shortcut-play svg,
.audio-shortcut-volume svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Hide the default audio element */
.custom-audio-element {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .audio-container.player-active {
    gap: 12px;
  }
  
  .audio-container.player-active .audio-play-button {
    width: 36px;
    height: 36px;
  }
  
  .audio-shortcut-float {
    bottom: 20px;
    right: 20px;
    gap: 6px;
  }
  
  .audio-shortcut-play,
  .audio-shortcut-volume {
    width: 36px;
    height: 36px;
  }
  
  .audio-shortcut-play svg,
  .audio-shortcut-volume svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .audio-shortcut-float {
    bottom: 16px;
    right: 16px;
    gap: 6px;
  }
  
  .audio-shortcut-play,
  .audio-shortcut-volume {
    width: 36px;
    height: 36px;
  }
  
  .audio-shortcut-play svg,
  .audio-shortcut-volume svg {
    width: 18px;
    height: 18px;
  }
}
