/**
 * Audio Player Widget Styles
 * v1.0.0
 */

.audio-player-widget {
  width: 270px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  transition: box-shadow 0.3s ease;
}

.audio-player-widget:hover {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.audio-player-visual {
  position: relative;
  height: 80px;
  background-color: #f3f4f6; /* Default header color */
}

.audio-player-waveform {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 0 24px;
  opacity: 0.25;
}

.waveform-bar {
  width: 4px;
  background-color: #2563eb;
  border-radius: 2px;
}

.audio-player-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  border-radius: 8px;
  z-index: 1;
}

.audio-player-title {
  font-weight: 500;
  font-size: 14px;
  color: #111827;
  margin: 0 0 2px 0;
}

.audio-player-subinfo {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.audio-player-progress {
  width: 100%;
  height: 4px;
  background-color: #e5e7eb;
  cursor: pointer;
  position: relative;
}

.audio-player-progress-bar {
  height: 100%;
  background-color: #2563eb;
  position: relative;
}

.audio-player-progress-handle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  width: 8px;
  height: 8px;
  background-color: #2563eb;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

.audio-player-controls {
  padding: 12px 16px;
}

.audio-player-main-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.audio-player-left-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-player-play-button {
  background: none;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding: 0;
  position: relative;
  overflow: visible;
  /* Barva ikony se nastavuje dynamicky v JS kódu, aby pasovala k barvě pozadí tlačítka */
}

.audio-player-play-button svg {
  width: 16px;
  height: 16px;
  display: block;
  position: relative;
  z-index: 1;
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 2px;
  fill: none; /* Zajistí, že se vykreslí pouze obrys */
}

.audio-player-play-button:hover {
  background-color: rgba(0, 0, 0, 0.1); /* Tmavnutí při najetí myší, které funguje na všech barvách pozadí */
}

.audio-player-time {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

.audio-player-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}

.audio-player-volume-button {
  background: none;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding: 0;
  position: relative;
  overflow: visible;
  color: #4b5563; /* Výchozí tmavá barva pro ikonu */
}

.audio-player-volume-button svg {
  width: 16px;
  height: 16px;
  display: block;
  position: relative;
  z-index: 1;
  pointer-events: none;
  stroke: currentColor; /* Zajistí, že ikona používá barvu nadřazeného elementu */
  stroke-width: 2px;
}

.audio-player-volume-button:hover {
  background-color: #f3f4f6;
  color: #2563eb; /* Modrá barva při najetí myší */
}

.audio-player-volume-slider {
  width: 64px;
  height: 4px;
  background-color: #e5e7eb;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.audio-player-volume-level {
  height: 100%;
  background-color: #2563eb;
  border-radius: 2px;
}

.audio-player-advanced-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

.audio-player-left-advanced {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-player-speed {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #6b7280;
}

.audio-player-speed svg {
  width: 12px;
  height: 12px;
  display: block;
  position: relative;
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 2px;
}

.audio-player-speed-button {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.audio-player-speed-button:hover {
  color: #2563eb;
}

.audio-player-loop {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s ease;
  color: #6b7280;
}

.audio-player-loop svg {
  width: 14px;
  height: 14px;
  display: block;
  position: relative;
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 2px;
}

.audio-player-loop:hover {
  color: #2563eb;
}

.audio-player-download {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s ease;
  text-decoration: none;
  color: #6b7280;
}

.audio-player-download svg {
  width: 14px;
  height: 14px;
  display: block;
  position: relative;
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 2px;
}

.audio-player-download:hover {
  color: #2563eb;
}

.audio-player-shortcuts {
  font-size: 11px;
  color: #6b7280;
  padding: 0 16px 12px 16px;
  line-height: 1.5;
}

.audio-player-kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 4px;
  font-size: 10px;
  font-family: monospace;
  line-height: 18px;
  text-align: center;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  .audio-player-widget {
    background-color: #1f2937;
  }
  
  .audio-player-visual {
    background-color: #111827;
  }
  
  .audio-player-info {
    background-color: rgba(31, 41, 55, 0.8);
  }
  
  .audio-player-title {
    color: #f9fafb;
  }
  
  .audio-player-subinfo {
    color: #9ca3af;
  }
  
  .audio-player-progress {
    background-color: #374151;
  }
  
  .audio-player-play-button:hover,
  .audio-player-volume-button:hover {
    background-color: #374151;
  }
  
  .audio-player-time {
    color: #d1d5db;
  }
  
  .audio-player-volume-slider {
    background-color: #4b5563;
  }
  
  .audio-player-advanced-controls {
    color: #9ca3af;
  }
  
  .audio-player-speed-button {
    color: #9ca3af;
  }
  
  .audio-player-kbd {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
  }
}