/**
 * Global Audio Player Styles
 * Floating player in bottom-right corner
 */

/* ========================================
   PLAYER CONTAINER
   ======================================== */

.global-audio-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.global-audio-player.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gap-inner {
  background: var(--content-bg, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  width: 320px;
  overflow: hidden;
}

/* ========================================
   HEADER
   ======================================== */

.gap-header {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 8px 8px 0;
}

.gap-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--content-text, #1f2937);
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}

.gap-btn:hover {
  opacity: 1;
  background: var(--hover-bg, #f3f4f6);
}

.gap-btn.active {
  opacity: 1;
  color: var(--primary-color, #667eea);
}

/* ========================================
   CONTENT (EXPANDED)
   ======================================== */

.gap-content {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gap-minimized .gap-content {
  display: none;
}

/* Track Info */
.gap-track-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gap-cover {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--hover-bg, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.gap-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gap-cover-icon {
  font-size: 20px;
}

.gap-details {
  flex: 1;
  min-width: 0;
}

.gap-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--content-text, #1f2937);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gap-artist {
  font-size: 12px;
  color: var(--content-text-muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress Bar */
.gap-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gap-time {
  font-size: 11px;
  color: var(--content-text-muted, #6b7280);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

.gap-current {
  text-align: right;
}

.gap-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border-color, #e5e7eb);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.gap-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--primary-color, #667eea);
  border-radius: 2px;
  transition: width 0.1s linear;
}

.gap-progress-bar:hover .gap-progress-fill {
  background: var(--primary-hover, #5a67d8);
}

/* Controls */
.gap-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.gap-controls .gap-btn {
  font-size: 18px;
  padding: 6px 10px;
}

.gap-play-pause {
  font-size: 24px !important;
  padding: 8px 14px !important;
}

/* Volume */
.gap-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.gap-volume-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-color, #e5e7eb);
  border-radius: 2px;
  cursor: pointer;
}

.gap-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--primary-color, #667eea);
  border-radius: 50%;
  cursor: pointer;
}

.gap-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--primary-color, #667eea);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* ========================================
   MINIMIZED STATE
   ======================================== */

.gap-mini-content {
  display: none;
  padding: 12px 16px;
  align-items: center;
  gap: 12px;
}

.gap-minimized .gap-mini-content {
  display: flex;
}

.gap-mini-info {
  flex: 1;
  min-width: 0;
}

.gap-mini-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--content-text, #1f2937);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gap-play-pause-mini {
  font-size: 20px !important;
}

/* ========================================
   HIDDEN AUDIO ELEMENT
   ======================================== */

.gap-audio-element {
  display: none;
}

/* ========================================
   DARK MODE
   ======================================== */

[data-theme="dark"] .gap-inner {
  background: var(--content-bg, #1f2937);
  border-color: var(--border-color, #374151);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .gap-btn:hover {
  background: var(--hover-bg, #374151);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
  .global-audio-player {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }
  
  .gap-inner {
    width: 100%;
  }
}
