/* GAHM Compact Dark Player Styling */
.gahm-compact-player {
  background: #2d2d2d;
  border-radius: 16px;
  padding: 16px 20px 16px 20px;
  width: 320px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid #3a3a3a;
  margin: 20px auto;
  transition: padding-bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Helvetica Neue", sans-serif;
}

.gahm-compact-player.gahm-settings-open {
  padding-bottom: 16px;
}

/* Hide Plyr wrapper since we're using custom UI */
.gahm-compact-player .plyr {
  display: none;
}

/* Hide default Plyr controls */
.gahm-compact-player .plyr__controls {
  display: none;
}

/* Track Info */
.gahm-track-info {
  text-align: center;
  margin-bottom: 12px;
}

.gahm-track-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
  line-height: 1.2;
}

.gahm-track-artist {
  font-size: 13px;
  color: #8e8e93;
  font-weight: 400;
}

/* Progress Bar */
.gahm-progress-container {
  margin: 12px 0;
}

.gahm-progress-bar {
  width: 100%;
  height: 3px;
  background: #48484a;
  border-radius: 1.5px;
  position: relative;
  cursor: pointer;
  margin: 8px 0;
  padding: 12px 0;
  background-clip: content-box;
  transition: all 0.2s ease;
}

.gahm-progress-bar:hover {
  transform: scaleY(1.2);
}

.gahm-progress-bar::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 3px;
  background: #48484a;
  border-radius: 1.5px;
  z-index: 1;
}

.gahm-progress-fill {
  position: absolute;
  top: 12px;
  left: 0;
  height: 3px;
  background: #f0f0f0;
  border-radius: 1.5px;
  width: 0%;
  transition: width 0.1s ease;
  z-index: 2;
}

/* Progress thumb appears on hover */
.gahm-progress-bar::after {
  content: "";
  position: absolute;
  top: 8px;
  left: var(--gahm-thumb-position, 0%);
  width: 11px;
  height: 11px;
  background: #f0f0f0;
  border-radius: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gahm-progress-bar:hover::after {
  opacity: 1;
}

/* Loading state for progress fill */
.gahm-progress-fill.gahm-loading {
  background: linear-gradient(90deg, #ffffff 0%, #8e8e93 50%, #ffffff 100%);
  background-size: 200% 100%;
  animation: gahm-shimmer 1.5s infinite;
}

@keyframes gahm-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Time Display */
.gahm-time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.gahm-time-display span {
  cursor: pointer;
  transition: color 0.2s ease;
}

.gahm-time-display span:hover {
  color: #ffffff;
}

/* Control Buttons */
.gahm-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.gahm-control-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.gahm-control-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.gahm-control-btn:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.gahm-control-btn:hover::before {
  width: 100%;
  height: 100%;
}

.gahm-control-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

.gahm-play-pause-btn {
  width: 36px;
  height: 36px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gahm-play-pause-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.gahm-secondary-btn {
  width: 32px;
  height: 32px;
  font-size: 14px;
  color: #8e8e93;
}

.gahm-secondary-btn:hover {
  color: #ffffff;
}

/* Settings Button */
.gahm-settings-btn {
  width: 24px;
  height: 24px;
  font-size: 11px;
  color: #6d6d70;
  margin-left: 8px;
  opacity: 0.8;
}

.gahm-settings-btn:hover {
  color: #ffffff;
  opacity: 1;
  transform: scale(1.1);
}

.gahm-settings-btn.gahm-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

/* Settings Badge */
.gahm-settings-btn::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: #ff6b6b;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 4;
}

.gahm-settings-btn.gahm-has-changes::after {
  opacity: 1;
}

/* Icon animations */
.gahm-control-btn svg {
  transition: transform 0.2s ease;
}

.gahm-play-pause-btn svg {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gahm-play-pause-btn [data-play-icon] {
  transform: scale(1);
}

.gahm-play-pause-btn [data-pause-icon] {
  transform: scale(1);
}

/* Smooth icon transitions */
.gahm-icon-enter {
  animation: gahm-iconFadeIn 0.3s ease;
}

.gahm-icon-exit {
  animation: gahm-iconFadeOut 0.3s ease;
}

@keyframes gahm-iconFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes gahm-iconFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8);
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .gahm-compact-player {
    width: 280px;
    max-width: calc(100vw - 40px);
    margin: 20px auto;
  }

  .gahm-controls {
    gap: 20px;
  }
}

/* Settings Panel */
.gahm-settings-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 0;
  padding-top: 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gahm-settings-panel.gahm-expanded {
  opacity: 1;
  max-height: 120px;
  margin-top: 16px;
  padding-top: 12px;
}

/* Speed Control */
.gahm-speed-control {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  gap: 6px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(-10px);
}

.gahm-speed-control.gahm-expanded {
  max-height: 40px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 12px;
}

.gahm-speed-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 600;
  color: #8e8e93;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 28px;
  text-align: center;
  opacity: 0.7;
}

.gahm-speed-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: scale(1.05);
  opacity: 1;
}

.gahm-speed-btn.gahm-active {
  background: #ffffff;
  color: #2d2d2d;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
  opacity: 1;
}

/* Volume Control */
.gahm-volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 0 6px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(-10px);
}

.gahm-volume-control.gahm-expanded {
  max-height: 30px;
  opacity: 1;
  transform: translateY(0);
}

.gahm-volume-icon {
  color: #8e8e93;
  font-size: 13px;
  min-width: 18px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.gahm-volume-icon:hover {
  color: #ffffff;
}

.gahm-volume-slider {
  flex: 1;
  height: 2px;
  background: #48484a;
  border-radius: 1px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 12px 0;
  background-clip: content-box;
}

.gahm-volume-slider::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 2px;
  background: #48484a;
  border-radius: 1px;
  z-index: 1;
}

.gahm-volume-slider:hover {
  transform: scaleY(1.5);
}

.gahm-volume-slider:hover::before {
  transform: scaleY(1.5);
}

.gahm-volume-fill {
  position: absolute;
  top: 12px;
  left: 0;
  height: 2px;
  background: #f0f0f0;
  border-radius: 1px;
  width: 100%;
  transition: width 0.1s ease;
  z-index: 2;
}

/* Loading States */
.gahm-player-loading {
  opacity: 0.7;
}

.gahm-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: gahm-spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gahm-loading-indicator.gahm-visible {
  opacity: 1;
}

@keyframes gahm-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
