/**
 * Audio Player Component - Blueprint Noir Design
 * Premium dark duotone aesthetic
 * Professional audio controls with construction theme
 */

.audio-player {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  background: rgba(26, 31, 38, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-medium), 0 0 24px rgba(212, 165, 116, 0.15);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

/* Metal texture overlay */
.audio-player::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.02) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Blueprint grid subtle background */
.audio-player::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
  pointer-events: none;
  border-radius: inherit;
}

.audio-player > * {
  position: relative;
  z-index: 1;
}

/* Desktop layout */
@media (min-width: 769px) {
  .audio-player {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
}

/* ===== PLAY/PAUSE BUTTON ===== */
.audio-player .btn-play {
  padding: 1rem 2.5rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-slate-deepest);
  background: linear-gradient(
    135deg,
    var(--color-copper-light) 0%,
    var(--color-gold-accent) 100%
  );
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-medium), 0 0 20px rgba(212, 165, 116, 0.3);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Shimmer effect on play button */
.audio-player .btn-play::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s;
}

.audio-player .btn-play:hover::before {
  left: 100%;
}

.audio-player .btn-play:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong), 0 0 30px rgba(212, 165, 116, 0.5);
}

.audio-player .btn-play:active {
  transform: translateY(0) scale(0.98);
}

/* Mobile */
@media (max-width: 768px) {
  .audio-player .btn-play {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
  }
}

/* ===== TIME DISPLAY ===== */
.audio-player .time-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: rgba(42, 52, 65, 0.7);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-copper-light);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.audio-player .time-display span {
  tabular-nums: tabular-nums;
  letter-spacing: 0.05em;
}

.audio-player .time-display::before {
  content: '⏱';
  font-size: 1.25rem;
  opacity: 0.7;
}

/* Mobile */
@media (max-width: 768px) {
  .audio-player .time-display {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
}

/* ===== SPEED CONTROLS ===== */
.audio-player .speed-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.audio-player .speed-controls .label {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-copper-light);
  margin-right: 0.5rem;
}

/* Mobile */
@media (max-width: 768px) {
  .audio-player .speed-controls {
    width: 100%;
    justify-content: space-between;
  }

  .audio-player .speed-controls .label {
    width: 100%;
    text-align: center;
    margin: 0 0 0.5rem 0;
  }
}

/* ===== SPEED BUTTONS ===== */
.audio-player .btn-speed {
  padding: 0.75rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #9CA3AF;
  background: rgba(42, 52, 65, 0.6);
  border: 2px solid rgba(212, 165, 116, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-quick);
  position: relative;
  overflow: hidden;
}

.audio-player .btn-speed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(212, 165, 116, 0.1) 0%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--transition-quick);
}

.audio-player .btn-speed:hover {
  border-color: rgba(212, 165, 116, 0.4);
  color: #D1D5DB;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.audio-player .btn-speed:hover::before {
  opacity: 1;
}

/* Active speed button */
.audio-player .btn-speed.active {
  color: var(--color-slate-deepest);
  background: linear-gradient(
    135deg,
    var(--color-copper-light) 0%,
    var(--color-gold-accent) 100%
  );
  border-color: var(--color-copper-light);
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4),
              inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.audio-player .btn-speed.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 165, 116, 0.5),
              inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.audio-player .btn-speed:active {
  transform: translateY(0) scale(0.97);
}

/* Mobile */
@media (max-width: 768px) {
  .audio-player .btn-speed {
    flex: 1;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    min-width: 0;
  }
}

/* ===== FOCUS STATES ===== */
.audio-player button:focus-visible {
  outline: 2px solid var(--color-copper-light);
  outline-offset: 3px;
}

/* ===== HIDE NATIVE AUDIO ===== */
.audio-player audio {
  display: none;
}

/* ===== DISABLED STATE ===== */
.audio-player button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== LOADING STATE ===== */
.audio-player[data-loading="true"] .btn-play {
  position: relative;
}

.audio-player[data-loading="true"] .btn-play::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}
