/**
 * ISSMCSP Audio Player Widget — "Ghost Frequencies"
 * Dark cyber aesthetic. Lo-fi / study music player with pay-to-download.
 * Drop this file in the same folder as index.html, or inline as a <style> block.
 */

/* ==================== MUSIC SECTION WRAPPER ==================== */
.music-section {
  padding: 6rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ==================== PLAYER CARD ==================== */
.mp-wrapper {
  background: var(--bg-card, #161620);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 1.2rem;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.mp-wrapper::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--accent-primary, #00e5cc), var(--accent-secondary, #ff6b35));
}

/* ==================== NOW PLAYING ==================== */
.mp-now-playing {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.mp-art {
  width: 80px;
  height: 80px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(0,229,204,0.2), rgba(255,107,53,0.2));
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.mp-art-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.mp-art-icon {
  font-size: 2rem;
  filter: grayscale(0.3);
}

.mp-vinyl {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  border-radius: 50%;
  background: conic-gradient(
    #1a1a2e 0deg, #0a0a0f 45deg,
    #1a1a2e 90deg, #0a0a0f 135deg,
    #1a1a2e 180deg, #0a0a0f 225deg,
    #1a1a2e 270deg, #0a0a0f 315deg,
    #1a1a2e 360deg
  );
  z-index: 0;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.mp-vinyl::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent-primary, #00e5cc);
  box-shadow: 0 0 8px rgba(0,229,204,0.6);
}

.mp-spinning {
  animation: mp-spin 3s linear infinite !important;
  opacity: 0.6 !important;
}

@keyframes mp-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.mp-track-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #e0e0e8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.mp-track-artist {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent-primary, #00e5cc);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 0.15rem;
}

.mp-track-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted, #4a4a58);
  font-family: 'JetBrains Mono', monospace;
}

.mp-meta-sep {
  font-size: 0.5rem;
  opacity: 0.4;
}

/* ==================== PROGRESS BAR ==================== */
.mp-progress-container {
  margin-bottom: 1rem;
}

.mp-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: height 0.15s;
}

.mp-progress-bar:hover {
  height: 6px;
}

.mp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary, #00e5cc), #00a8a0);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.mp-progress-thumb {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background: var(--accent-primary, #00e5cc);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  left: 0%;
  box-shadow: 0 0 8px rgba(0,229,204,0.4);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.mp-progress-bar:hover .mp-progress-thumb {
  opacity: 1;
}

.mp-time-display {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted, #4a4a58);
  margin-top: 0.3rem;
}

/* ==================== CONTROLS ==================== */
.mp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.mp-btn {
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  color: var(--text-primary, #e0e0e8);
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0.7;
}

.mp-btn:hover {
  border-color: var(--accent-primary, #00e5cc);
  color: var(--accent-primary, #00e5cc);
  opacity: 1;
}

.mp-btn-play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary, #00e5cc), #00a8a0);
  border: none;
  color: var(--bg-primary, #0a0a0f);
  font-size: 1.2rem;
  opacity: 1;
  box-shadow: 0 4px 15px rgba(0,229,204,0.3);
}

.mp-btn-play:hover {
  box-shadow: 0 6px 25px rgba(0,229,204,0.5);
  transform: scale(1.05);
  color: var(--bg-primary, #0a0a0f);
}

/* Volume */
.mp-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.mp-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.mp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary, #00e5cc);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,229,204,0.4);
}

.mp-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary, #00e5cc);
  cursor: pointer;
  border: none;
}

.mp-extra-controls {
  display: flex;
  gap: 0.3rem;
  margin-left: 0.5rem;
}

.mp-extra-controls .mp-btn {
  width: 34px;
  height: 34px;
  font-size: 0.8rem;
}

/* ==================== DOWNLOAD CTA ==================== */
.mp-download-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
  flex-wrap: wrap;
}

.mp-download-info {
  font-size: 0.8rem;
  color: var(--text-muted, #4a4a58);
  font-family: 'JetBrains Mono', monospace;
}

.mp-btn-buy {
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-secondary, #ff6b35), #e55a2b);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Inter', sans-serif;
}

.mp-btn-buy:hover {
  box-shadow: 0 4px 20px rgba(255,107,53,0.4);
  transform: translateY(-2px);
}

/* ==================== TRACKLIST ==================== */
.ml-tracklist {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ml-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.ml-track:hover {
  background: rgba(255,255,255,0.03);
  border-color: var(--border, rgba(255,255,255,0.06));
}

.ml-track-active {
  background: rgba(0,229,204,0.06) !important;
  border-color: rgba(0,229,204,0.2) !important;
}

.ml-track-active .ml-track-num {
  color: var(--accent-primary, #00e5cc);
}

.ml-track-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted, #4a4a58);
  width: 28px;
  flex-shrink: 0;
}

.ml-track-main {
  flex: 1;
  min-width: 0;
}

.ml-track-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary, #e0e0e8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-track-desc {
  font-size: 0.75rem;
  color: var(--text-muted, #4a4a58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-track-vibe {
  flex-shrink: 0;
}

.ml-vibe-tag {
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary, #7a7a88);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.ml-track-duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted, #4a4a58);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.ml-track-price {
  flex-shrink: 0;
}

.ml-buy-small {
  padding: 0.3rem 0.7rem;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  color: var(--text-secondary, #7a7a88);
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.ml-buy-small:hover {
  border-color: var(--accent-secondary, #ff6b35);
  color: var(--accent-secondary, #ff6b35);
}

.ml-track-active .ml-buy-small {
  border-color: var(--accent-secondary, #ff6b35);
  background: rgba(255,107,53,0.1);
  color: var(--accent-secondary, #ff6b35);
}

/* ==================== PURCHASE MODAL ==================== */
.mp-purchase-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.mp-purchase-modal {
  background: var(--bg-card, #161620);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 1.2rem;
  padding: 2.5rem;
  max-width: 420px;
  width: 90%;
  position: relative;
  text-align: center;
}

.mp-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted, #4a4a58);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.mp-modal-close:hover { color: var(--text-primary, #e0e0e8); }

.mp-modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.mp-modal-details {
  margin: 1.5rem 0;
  text-align: left;
}

.mp-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85rem;
}

.mp-modal-row span:first-child {
  color: var(--text-muted, #4a4a58);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.mp-modal-row span:last-child {
  color: var(--text-primary, #e0e0e8);
  text-align: right;
}

.mp-modal-price {
  text-align: right;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary, #00e5cc);
  margin-top: 0.5rem;
}

.mp-modal-buy-btn {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--accent-primary, #00e5cc), #00a8a0);
  color: var(--bg-primary, #0a0a0f);
  border: none;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.mp-modal-buy-btn:hover {
  box-shadow: 0 6px 25px rgba(0,229,204,0.4);
  transform: translateY(-1px);
}

.mp-modal-note {
  margin-top: 1rem;
  font-size: 0.7rem;
  color: var(--text-muted, #4a4a58);
  font-family: 'JetBrains Mono', monospace;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
  .mp-now-playing {
    flex-direction: column;
    text-align: center;
  }

  .mp-track-meta {
    justify-content: center;
  }

  .mp-controls {
    gap: 0.5rem;
  }

  .mp-volume {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .mp-extra-controls {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .mp-download-cta {
    flex-direction: column;
    text-align: center;
  }

  .ml-track {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .ml-track-vibe {
    order: 3;
    width: 100%;
    margin-left: 44px; /* align with num */
  }
}

/* ==================== SECTION HEADER FOR MUSIC ==================== */
.music-section .section-header h2 .music-accent {
  color: var(--accent-primary, #00e5cc);
}

.music-section .section-header h2 .music-accent2 {
  color: var(--accent-secondary, #ff6b35);
}
