#global-audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  direction: rtl;
}

#global-audio-player.gap-hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.gap-container {
  display: flex;
  gap: 20px;
  padding: 16px 24px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: flex-start;
}

.gap-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 200px;
  opacity: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* ========== NORMAL STATE ========== */
.gap-artwork {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.gap-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gap-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin: 4px 0 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.gap-actions {
  display: flex;
  gap: 8px;
}

.gap-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.gap-progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ========== MINIMIZE STATE ========== */
#global-audio-player.gap-minimized .gap-container {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

#global-audio-player.gap-minimized .gap-artwork {
  width: 50px;
  height: 50px;
  min-width: 50px;
}

#global-audio-player.gap-minimized .gap-content {
  flex: 1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  max-height: 100%;
  max-height: unset;
  opacity: 1;
  overflow: visible;
  flex-wrap: nowrap;
  margin: 0;
  padding: 0;
}

#global-audio-player.gap-minimized .gap-header {
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

#global-audio-player.gap-minimized .gap-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#global-audio-player.gap-minimized .gap-title {
  font-size: 14px;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

#global-audio-player.gap-minimized .gap-subtitle {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

#global-audio-player.gap-minimized .gap-actions {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

#global-audio-player.gap-minimized .gap-controls {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#global-audio-player.gap-minimized .gap-progress-container {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Button Styles */
.gap-btn-icon {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.gap-btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.gap-btn-icon svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

.gap-btn-control {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gap-btn-control:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.gap-btn-control:active {
  transform: scale(0.95);
}

.gap-btn-control svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.gap-btn-control.gap-play,
.gap-btn-control.gap-pause {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.95);
}

.gap-btn-control.gap-play svg,
.gap-btn-control.gap-pause svg {
  width: 26px;
  height: 26px;
  color: #667eea;
}

.gap-btn-control.gap-backward,
.gap-btn-control.gap-forward {
  width: 40px;
  height: 40px;
}

/* Cover Image */
.gap-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gap-artwork-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
}

.gap-artwork-placeholder svg {
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.8);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.gap-btn-control:active {
  transform: scale(0.95);
}

.gap-btn-control svg {
  width: 22px;
  height: 22px;
  color: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.gap-btn-control.gap-play,
.gap-btn-control.gap-pause {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.95);
}

.gap-btn-control.gap-play svg,
.gap-btn-control.gap-pause svg {
  width: 26px;
  height: 26px;
  color: #667eea;
}

.gap-btn-control.gap-backward,
.gap-btn-control.gap-forward {
  width: 40px;
  height: 40px;
}

/* Progress Container */
.gap-progress-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gap-progress {
  position: relative;
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  overflow: visible;
}

.gap-progress:hover .gap-progress-handle {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.gap-progress-played {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #ffffff, #f0f0f0);
  border-radius: 999px;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.gap-progress-handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.2s;
  pointer-events: none;
}

.gap-time {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  min-width: 100px;
  justify-content: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.gap-time-separator {
  opacity: 0.6;
}

/* Hidden audio element */
.gap-audio {
  display: none !important;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#global-audio-player:not(.gap-hidden) {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Playing animation */
.gap-playing .gap-artwork::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .gap-container {
    padding: 12px 16px;
    gap: 12px;
  }
  
  .gap-artwork {
    width: 60px;
    height: 60px;
  }
  
  .gap-title {
    font-size: 14px;
  }
  
  .gap-subtitle {
    font-size: 12px;
  }
  
  .gap-btn-control {
    width: 38px;
    height: 38px;
  }
  
  .gap-btn-control.gap-play,
  .gap-btn-control.gap-pause {
    width: 46px;
    height: 46px;
  }
  
  .gap-controls {
    gap: 8px;
  }
}

/* Audio Play Trigger Button Styles */
.audio-play-trigger {
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

.audio-play-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.audio-play-trigger::before {
  content: '▶';
  font-size: 12px;
}
