/**
 * Crates Zone Styles — Your Personal Sample Collection
 * Warm wood/gold aesthetic like a record collector's den
 */

/* ==================== CRATES ZONE THEME ==================== */

.zone-crates {
  --crate-bg: #1a1410;
  --crate-surface: #2a2018;
  --crate-surface-light: #3a2e24;
  --crate-gold: #d4af37;
  --crate-gold-dim: #b8962f;
  --crate-gold-glow: rgba(212, 175, 55, 0.15);
  --crate-text: #f5f0e8;
  --crate-text-muted: #a89880;
  --crate-wood-dark: #12100c;
  --crate-wood-grain: rgba(212, 175, 55, 0.03);
  
  /* Override zone defaults */
  --zone-primary: #d4af37;
  --zone-secondary: #b8962f;
  --zone-accent: #e8c547;
  --zone-bg: #1a1410;
}

/* Warm wood background */
.zone-crates .dig-space {
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(180, 120, 40, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #1a1410 0%, #14100c 50%, #1a1410 100%);
}

.zone-crates .bg-void {
  background: var(--crate-bg);
}

/* Wood grain texture overlay */
.zone-crates .bg-texture {
  background-image: 
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 4px,
      rgba(212, 175, 55, 0.015) 4px,
      rgba(212, 175, 55, 0.015) 8px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 40px,
      rgba(0, 0, 0, 0.05) 40px,
      rgba(0, 0, 0, 0.05) 80px
    );
  opacity: 0.8;
}

.zone-crates .bg-grid {
  background-image: none;
}

.zone-crates .bg-particles {
  opacity: 0.3;
}

/* Gold ambient glow */
.zone-crates::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(180, 120, 40, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Top bar styling */
.zone-crates .float-top {
  background: linear-gradient(180deg, rgba(26, 20, 16, 0.98) 0%, transparent 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Zone title warm gold */
.zone-crates .float-zone-title {
  color: var(--crate-gold);
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* ==================== CRATES LAYOUT ==================== */

.crates-zone {
  display: flex;
  min-height: calc(100vh - 140px);
  padding: 20px;
  gap: 24px;
  position: relative;
  z-index: 10;
}

/* ==================== SIDEBAR ==================== */

.crates-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crates-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 20px;
}

.crates-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--crate-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.new-folder-btn {
  padding: 8px 14px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  color: var(--crate-gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.new-folder-btn:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--crate-gold);
  transform: translateY(-1px);
}

.new-folder-btn::before {
  content: '+';
  font-size: 14px;
  font-weight: 700;
}

/* Folder sections */
.folder-section {
  margin-bottom: 16px;
}

.folder-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--crate-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0 16px 8px;
}

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Individual folder item */
.folder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.folder-item:hover {
  background: rgba(212, 175, 55, 0.08);
  border-left-color: rgba(212, 175, 55, 0.3);
}

.folder-item.active {
  background: rgba(212, 175, 55, 0.12);
  border-left-color: var(--crate-gold);
}

.folder-item.drag-over {
  background: rgba(212, 175, 55, 0.25);
  border-left-color: var(--crate-gold);
  transform: scale(1.02);
}

.folder-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.folder-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--crate-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-item.active .folder-name {
  color: var(--crate-gold);
}

.folder-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--crate-text-muted);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

.folder-item.active .folder-count {
  background: rgba(212, 175, 55, 0.2);
  color: var(--crate-gold);
}

/* ==================== MAIN CONTENT ==================== */

.crates-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Search bar */
.crates-search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.crates-search-input {
  flex: 1;
  padding: 14px 20px;
  background: var(--crate-surface);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  color: var(--crate-text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.crates-search-input::placeholder {
  color: var(--crate-text-muted);
}

.crates-search-input:focus {
  outline: none;
  border-color: var(--crate-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Current folder header */
.crates-folder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--crate-surface);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 14px;
  margin-bottom: 20px;
}

.current-folder-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.current-folder-icon {
  font-size: 28px;
}

.current-folder-details h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--crate-text);
  margin: 0 0 4px;
}

.current-folder-details .item-count {
  font-size: 13px;
  color: var(--crate-text-muted);
}

.folder-actions {
  display: flex;
  gap: 10px;
}

.folder-action-btn {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--crate-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.folder-action-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.3);
}

/* ==================== SAMPLE GRID ==================== */

.crates-sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

/* ==================== SAMPLE CARD ==================== */

.crate-sample-card {
  background: var(--crate-surface);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.crate-sample-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(212, 175, 55, 0.2),
    0 0 30px rgba(212, 175, 55, 0.08);
}

.crate-sample-card:active {
  transform: translateY(-2px);
}

/* Dragging state */
.crate-sample-card.dragging {
  opacity: 0.6;
  transform: scale(0.98);
}

/* Favorite badge */
.crate-sample-card.is-favorite::before {
  content: '⭐';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 14px;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Artwork section */
.sample-card-artwork {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--crate-wood-dark);
}

.sample-card-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.crate-sample-card:hover .sample-card-artwork img {
  transform: scale(1.05);
}

/* Play overlay */
.sample-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.crate-sample-card:hover .sample-play-overlay {
  opacity: 1;
}

.sample-play-btn {
  width: 56px;
  height: 56px;
  background: var(--crate-gold);
  border: none;
  border-radius: 50%;
  color: var(--crate-bg);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.crate-sample-card:hover .sample-play-btn {
  transform: scale(1);
}

.sample-play-btn:hover {
  transform: scale(1.1);
  background: #e8c547;
}

.sample-play-btn.playing {
  animation: pulse-gold 1.5s ease infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(212, 175, 55, 0.7); }
}

/* Waveform mini */
.sample-waveform-mini {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 8px 6px;
  gap: 1px;
}

.waveform-bar {
  width: 3px;
  background: var(--crate-gold);
  opacity: 0.6;
  border-radius: 2px 2px 0 0;
  transition: height 0.1s ease;
}

.sample-waveform-mini.playing .waveform-bar {
  animation: waveform-dance 0.5s ease infinite;
}

@keyframes waveform-dance {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.6); }
}

/* Card info section */
.sample-card-info {
  padding: 14px;
}

.sample-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--crate-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-card-artist {
  font-size: 12px;
  color: var(--crate-text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sample-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--crate-text-muted);
}

.sample-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sample-card-meta .bpm::before {
  content: '♪';
  opacity: 0.6;
}

.sample-card-meta .key::before {
  content: '🎵';
  font-size: 10px;
  opacity: 0.6;
}

.sample-card-meta .duration::before {
  content: '⏱';
  font-size: 10px;
  opacity: 0.6;
}

/* Card action buttons */
.sample-card-actions {
  display: flex;
  justify-content: space-around;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.2s ease;
}

.crate-sample-card:hover .sample-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.sample-action-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 10px;
  color: var(--crate-text-muted);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sample-action-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: var(--crate-gold);
  transform: scale(1.1);
}

.sample-action-btn.favorite.active {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
}

.sample-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ==================== EMPTY STATE ==================== */

.crates-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
  position: relative;
}

/* Warm ambient glow */
.crates-empty::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

.crates-empty-icon {
  font-size: 80px;
  margin-bottom: 28px;
  animation: crate-icon-float 3s ease-in-out infinite;
  filter: drop-shadow(0 10px 30px rgba(212, 175, 55, 0.2));
}

@keyframes crate-icon-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.crates-empty h3 {
  font-size: 26px;
  font-weight: 700;
  color: var(--crate-text);
  margin: 0 0 12px;
  background: linear-gradient(135deg, #f5f0e8 0%, var(--crate-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.crates-empty p {
  font-size: 15px;
  color: var(--crate-text-muted);
  margin: 0 0 36px;
  max-width: 380px;
  line-height: 1.7;
}

.crates-empty-btn {
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--crate-gold) 0%, var(--crate-gold-dim) 100%);
  border: none;
  border-radius: 16px;
  color: var(--crate-bg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
}

.crates-empty-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 40px rgba(212, 175, 55, 0.35);
}

.crates-empty-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ==================== NEW FOLDER MODAL ==================== */

.folder-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.folder-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.folder-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.folder-modal-content {
  position: relative;
  background: var(--crate-surface);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 420px;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.folder-modal.visible .folder-modal-content {
  transform: scale(1) translateY(0);
}

.folder-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--crate-text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.folder-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.folder-modal h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--crate-text);
  margin: 0 0 24px;
}

.folder-form-group {
  margin-bottom: 20px;
}

.folder-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--crate-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.folder-form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--crate-bg);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  color: var(--crate-text);
  font-size: 15px;
  transition: all 0.2s ease;
}

.folder-form-group input:focus {
  outline: none;
  border-color: var(--crate-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* Icon picker grid */
.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.icon-option {
  width: 44px;
  height: 44px;
  background: var(--crate-bg);
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-option:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
  transform: scale(1.08);
}

.icon-option.selected {
  border-color: var(--crate-gold);
  background: rgba(212, 175, 55, 0.2);
}

.folder-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.folder-modal-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.folder-modal-btn.cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--crate-text-muted);
}

.folder-modal-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--crate-text);
}

.folder-modal-btn.create {
  background: linear-gradient(135deg, var(--crate-gold) 0%, var(--crate-gold-dim) 100%);
  color: var(--crate-bg);
}

.folder-modal-btn.create:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

/* ==================== MOVE TO FOLDER PICKER ==================== */

.folder-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--crate-surface);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.folder-picker-dropdown.visible {
  opacity: 1;
  pointer-events: auto;
}

.folder-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-picker-item:hover {
  background: rgba(212, 175, 55, 0.15);
}

.folder-picker-item .picker-icon {
  font-size: 16px;
}

.folder-picker-item .picker-name {
  font-size: 13px;
  color: var(--crate-text);
}

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

@media (max-width: 900px) {
  .crates-zone {
    flex-direction: column;
    padding: 16px;
  }
  
  .crates-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    margin-bottom: 16px;
  }
  
  .crates-sidebar-header {
    display: none;
  }
  
  .folder-section {
    display: flex;
    margin-bottom: 0;
  }
  
  .folder-section-label {
    display: none;
  }
  
  .folder-list {
    flex-direction: row;
    gap: 0;
  }
  
  .folder-item {
    padding: 10px 16px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  
  .folder-item.active {
    border-bottom-color: var(--crate-gold);
    border-left-color: transparent;
  }
  
  .crates-sample-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .crates-sample-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .sample-card-info {
    padding: 10px;
  }
  
  .sample-card-title {
    font-size: 13px;
  }
  
  .sample-card-actions {
    padding: 8px 10px 10px;
  }
  
  .sample-action-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}

/* ==================== DJ SETS VIEW ==================== */

.dj-set-view {
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.set-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: rgba(30, 27, 24, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 16px;
  margin-bottom: 20px;
}

.set-back-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #f5f0e8;
  cursor: pointer;
  transition: background 0.2s;
}

.set-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.set-info {
  flex: 1;
}

.set-title {
  font-size: 24px;
  font-weight: 700;
  color: #f5f0e8;
  margin: 0 0 4px 0;
}

.set-stats {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.set-export-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #d4af37 0%, #b8942e 100%);
  border: none;
  border-radius: 10px;
  color: #1a1410;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.set-export-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.set-track-list {
  background: rgba(30, 27, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.set-track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: grab;
  transition: background 0.2s;
}

.set-track:hover {
  background: rgba(255, 255, 255, 0.05);
}

.set-track.dragging {
  opacity: 0.5;
  background: rgba(212, 175, 55, 0.1);
}

.set-track:last-child {
  border-bottom: none;
}

.track-position {
  width: 30px;
  text-align: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.track-artwork {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

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

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

.track-title {
  font-weight: 600;
  color: #f5f0e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.track-bpm, .track-key {
  width: 50px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.track-flow {
  width: 60px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.track-flow.up {
  color: #4ade80;
}

.track-flow.down {
  color: #f87171;
}

.track-flow.stable {
  color: rgba(255, 255, 255, 0.5);
}

.track-flow.neutral {
  color: rgba(255, 255, 255, 0.3);
}

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

.track-play-btn, .track-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.track-play-btn {
  background: rgba(212, 175, 55, 0.2);
  color: #d4af37;
}

.track-play-btn:hover {
  background: rgba(212, 175, 55, 0.4);
}

.track-remove-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

.track-remove-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.set-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.5);
}

.set-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.set-empty h3 {
  color: #f5f0e8;
  margin: 0 0 8px 0;
}

.set-footer {
  padding: 16px;
  text-align: right;
}

.set-duration {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* Export Modal */
.export-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.export-modal.visible {
  opacity: 1;
}

.export-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.export-modal-content {
  position: relative;
  background: #2a2018;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 24px;
  min-width: 360px;
  max-width: 90vw;
}

.export-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f0e8;
  cursor: pointer;
}

.export-modal-content h3 {
  margin: 0 0 4px 0;
  color: #f5f0e8;
}

.export-modal-subtitle {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 20px 0;
}

.export-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.export-option:hover:not(.disabled) {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.3);
}

.export-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.export-icon {
  font-size: 24px;
}

.export-name {
  font-weight: 600;
  color: #f5f0e8;
  display: block;
}

.export-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Sets Section in Sidebar */
.sets-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sets-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  margin-bottom: 8px;
}

.sets-section-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.new-set-btn {
  padding: 4px 8px;
  background: rgba(212, 175, 55, 0.2);
  border: none;
  border-radius: 4px;
  color: #d4af37;
  font-size: 11px;
  cursor: pointer;
}

.new-set-btn:hover {
  background: rgba(212, 175, 55, 0.3);
}

.folder-item.set-folder {
  border-left: 2px solid #d4af37;
}

/* Mobile */
@media (max-width: 768px) {
  .set-track {
    flex-wrap: wrap;
    padding: 12px;
  }
  
  .track-bpm, .track-key, .track-flow {
    width: auto;
    font-size: 11px;
  }
  
  .track-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
}

/* Empty sets hint */
.empty-sets-hint {
  padding: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-style: italic;
}

/* ==================== ADD TO SET PICKER ==================== */

.add-to-set-picker {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.add-to-set-picker.visible {
  opacity: 1;
}

.set-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.set-picker-content {
  position: relative;
  background: #2a2018;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  padding: 16px;
  min-width: 300px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.set-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  color: #f5f0e8;
}

.set-picker-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #f5f0e8;
  cursor: pointer;
}

.set-picker-item-preview {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 12px;
}

.preview-title {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.set-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.set-picker-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.set-picker-option:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.3);
}

.set-picker-option.already-added {
  opacity: 0.5;
  cursor: not-allowed;
}

.set-option-icon {
  font-size: 20px;
}

.set-option-name {
  flex: 1;
  font-weight: 500;
  color: #f5f0e8;
}

.set-option-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.already-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-radius: 4px;
  font-weight: 600;
}

.set-picker-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  color: #d4af37;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.set-picker-new:hover {
  background: rgba(212, 175, 55, 0.25);
}

/* Add to Set button style */
.sample-action-btn.add-to-set {
  background: rgba(212, 175, 55, 0.15);
  color: #d4af37;
}

.sample-action-btn.add-to-set:hover {
  background: rgba(212, 175, 55, 0.3);
}

/* ==================== BPM ANALYZE BUTTON ==================== */

.analyze-bpm-btn {
  padding: 2px 8px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 4px;
  color: #60a5fa;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.analyze-bpm-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
}

.sample-card-meta .bpm {
  cursor: pointer;
  transition: color 0.2s;
}

.sample-card-meta .bpm:hover {
  color: #60a5fa;
}
