/**
 * Gabriele Verlag Custom Audio Player Styles
 *
 * Brand colors:
 * - Primary blue: #0077DD
 * - Dark blue: #21458E
 * - Light background: #F2F5F9
 */

/* Wrapper */
.gv-audio-player-wrapper {
  margin: 24px 0;
}

/* Player container */
.gv-audio-player {
  background: #f2f5f9;
  border-radius: 6px;
  padding: 25px;
  padding-bottom: 20px;
  overflow: hidden;
}

.gv-audio-player:focus {
  outline: 2px solid #0077dd;
  outline-offset: 2px;
}

.gv-player-inner {
  display: flex;
  gap: 20px;
}

/* Artwork */
.gv-player-artwork {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
}

.gv-player-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Controls container */
.gv-player-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

/* Title */
.gv-player-title {
  font-size: 18px;
  font-weight: 600;
  color: #21458e;
  margin-bottom: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main controls (play + progress) */
.gv-player-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

/* Play button */
.gv-play-btn {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 100px;
  background: #0077dd;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.1s;
}

.gv-play-btn:hover {
  background: #0066cc;
}

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

.gv-play-btn svg {
  width: 30px;
  height: 30px;
}

.gv-icon-play,
.gv-icon-pause {
  position: absolute;
}

/* Progress container */
.gv-progress-container {
  flex: 1;
  min-width: 0;
}

/* Progress bar */
.gv-progress-bar {
  position: relative;
  height: 8px;
  background: #d0d8e0;
  border-radius: 4px;
  cursor: pointer;
}

.gv-progress-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #0077dd;
  border-radius: 4px;
  pointer-events: none;
}

.gv-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  background: #0077dd;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gv-progress-bar:hover .gv-progress-handle,
.gv-audio-player:focus .gv-progress-handle {
  opacity: 1;
}

/* Time display */
.gv-time {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #21458e;
  font-variant-numeric: tabular-nums;
}

/* Secondary controls */
.gv-player-secondary {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Single track mode - space between controls */
.gv-audio-player-wrapper:not(.gv-playlist-mode) .gv-player-secondary {
  justify-content: space-between;
}

/* Nav buttons container */
.gv-nav-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Prev/Next buttons */
.gv-prev-btn,
.gv-next-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: #21458e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 18px;
  transition: background-color 0.2s;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.gv-prev-btn:hover,
.gv-next-btn:hover,
.gv-prev-btn:focus,
.gv-next-btn:focus {
  background: transparent;
  color: #0066cc;
}

.gv-prev-btn svg,
.gv-next-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.gv-btn-text {
  display: inline;
}

/* Volume container */
.gv-volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gv-volume-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #21458e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.gv-volume-btn:hover,
.gv-volume-btn:focus,
.gv-volume-btn:active {
  background: transparent;
  color: #0077dd;
}

.gv-volume-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.gv-icon-volume,
.gv-icon-mute {
  position: absolute;
}

/* Volume slider */
.gv-volume-slider-container {
  max-width: 100px;
  padding-bottom: 5px;
}

.gv-volume-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #d0d8e0;
  border-radius: 2px;
  cursor: pointer;
}

.gv-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #21458e;
  border-radius: 50%;
  cursor: pointer;
}

.gv-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #21458e;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* Download button */
.gv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #0077dd;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
}

a.gv-download-btn {
  background: #0066cc;
  color: #fff !important;
  text-decoration: none;
}

a.gv-download-btn:hover,
a.gv-download-btn:focus,
a.gv-download-btn:active {
  background: #0066cc;
  color: #fff !important;
  text-decoration: none;
}

.gv-download-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Playlist */

.gv-playlist {
  max-height: 280px;
  overflow-y: auto;
  padding-top: 10px;
}

.gv-playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 8px;
  margin: 4px 0;
  background: #f2f5f9;
}

.gv-playlist-item:nth-child(even) {
  background: #fff;
}

.gv-playlist-item:hover {
  background: rgba(33, 69, 142, 0.1);
}

/* Active playlist item */
.gv-playlist-item.active {
  background: #21458e;
}

.gv-playlist-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #21458e;
  border: 2px solid #21458e;
  border-radius: 50%;
  transition: all 0.2s;
  position: relative;
}

.gv-playlist-item.active .gv-playlist-item-icon {
  color: #fff;
  border-color: #fff;
  background: transparent;
}

.gv-playlist-item-icon svg {
  width: 16px;
  height: 16px;
}

.gv-playlist-icon-play {
  display: block;
}

.gv-playlist-icon-pause {
  display: none;
}

.gv-playlist-item.active .gv-playlist-icon-play {
  display: none;
}

.gv-playlist-item.active .gv-playlist-icon-pause {
  display: block;
}

.gv-playlist-item-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #21458e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gv-playlist-item.active .gv-playlist-item-title {
  color: #fff;
  font-weight: 600;
}

/* Playlist download button */
.gv-playlist-download {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #0077dd;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
}

a.gv-playlist-download {
  background: #0066cc;
  color: #fff !important;
  text-decoration: none;
}

a.gv-playlist-download:hover,
a.gv-playlist-download:focus {
  background: #0055bb;
  color: #fff;
  text-decoration: none;
}

.gv-playlist-download svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Playlist scrollbar */
.gv-playlist::-webkit-scrollbar {
  width: 6px;
}

.gv-playlist::-webkit-scrollbar-track {
  background: transparent;
}

.gv-playlist::-webkit-scrollbar-thumb {
  background: #d0d8e0;
  border-radius: 3px;
}

.gv-playlist::-webkit-scrollbar-thumb:hover {
  background: #b0b8c0;
}

/* Responsive */

/* Medium screens - hide button text */
@media (max-width: 1024px) {
  .gv-player-inner {
    flex-direction: column;
  }

  .gv-player-artwork {
    width: 120px;
    height: 120px;
  }

  .gv-player-controls {
    width: 100%;
  }

  .gv-btn-text {
    display: none;
  }

  .gv-prev-btn,
  .gv-next-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .gv-download-btn {
    padding: 8px 12px;
  }

  .gv-download-btn span {
    display: none;
  }

  .gv-playlist-download span {
    display: none;
  }

  .gv-playlist-download {
    padding: 8px;
  }
}

/* Small screens - stack layout */
@media (max-width: 600px) {
  .gv-audio-player {
    padding: 15px;
  }

  .gv-player-artwork {
    width: 100%;
    height: 120px;
  }

  .gv-player-controls {
    width: 100%;
  }

  .gv-player-title {
    text-align: center;
  }

  .gv-player-main {
    flex-direction: column;
    gap: 20px;
  }

  .gv-progress-container {
    width: 100%;
  }
}
