/**
 * @file
 * Sticky audio player styles.
 */

/* Button wrapper */
.sticky-audio-player-button-wrapper {
  margin: 1em 0;
}

/* Listen to Article button */
.listen-to-article-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  background-color: #0073aa;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.listen-to-article-btn:hover {
  background-color: #005a87;
  transform: translateY(-1px);
}

.listen-to-article-btn:active {
  transform: translateY(0);
}

.listen-to-article-btn:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

/* Sticky player container */
.sticky-audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  z-index: 10;
  transform: translateY(100%);
  transition: transform 0.3s ease, left 0.3s ease;
  border-top: 1px solid #e0e0e0;
}

.sticky-audio-player.visible {
  transform: translateY(0);
}

/* Player content layout */
.player-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.5em;
  gap: 1.5em;
  max-width: 1400px;
  margin: 0 auto;
}

/* Left section: Play button and info */
.player-left {
  display: flex;
  align-items: center;
  gap: 1em;
  flex: 0 0 auto;
  min-width: 200px;
}

.player-control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #333;
  font-size: 1.2em;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.player-control:hover {
  background-color: #f0f0f0;
}

.player-control:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.player-control .icon {
  display: block;
  line-height: 1;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  min-width: 0;
  flex: 1;
}

.player-title {
  font-weight: 500;
  font-size: 0.95em;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-time {
  font-size: 0.85em;
  color: #666;
}

/* Center section: Progress bar */
.player-center {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 1em;
}

.progress-wrapper {
  width: 100%;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background-color: #e0e0e0;
  border-radius: 3px;
  cursor: pointer;
  transition: height 0.2s ease;
}

.progress-bar:hover {
  height: 8px;
}

.progress-bar:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
  border-radius: 4px;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: #0073aa;
  border-radius: 3px;
  transition: width 0.1s linear;
  min-width: 2px;
}

/* Right section: Speed and close */
.player-right {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex: 0 0 auto;
}

.speed-control {
  padding: 0.5em 1em;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9em;
  color: #333;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  min-width: 50px;
}

.speed-control:hover {
  background-color: #f0f0f0;
  border-color: #bbb;
}

.speed-control:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.close-button {
  font-size: 1.5em;
  line-height: 1;
}

.close-button .icon {
  font-size: 1.2em;
  font-weight: 300;
}

/* Responsive design */
@media (max-width: 768px) {
  .player-content {
    padding: 0 1em;
    gap: 1em;
  }

  .player-left {
    min-width: 150px;
  }

  .player-title {
    font-size: 0.85em;
  }

  .player-time {
    font-size: 0.75em;
  }

  .player-center {
    padding: 0 0.5em;
  }

  .speed-control {
    padding: 0.4em 0.8em;
    font-size: 0.85em;
    min-width: 45px;
  }
}

@media (max-width: 480px) {
  .sticky-audio-player {
    height: 70px;
  }

  .player-content {
    padding: 0 0.75em;
    gap: 0.75em;
  }

  .player-left {
    min-width: 120px;
    gap: 0.75em;
  }

  .player-control {
    width: 36px;
    height: 36px;
    font-size: 1em;
  }

  .player-title {
    font-size: 0.8em;
  }

  .player-time {
    font-size: 0.7em;
  }

  .player-center {
    padding: 0 0.25em;
  }

  .speed-control {
    padding: 0.3em 0.6em;
    font-size: 0.8em;
    min-width: 40px;
  }
}

