/* ============== Music Director - Modern Design ============== */
/* FM34 - move fast and break things... */

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a25;
  --bg-glass: rgba(18, 18, 26, 0.8);
  --text: #ffffff;
  --text-secondary: #b0b8c0;
  --muted: #7a8290;
  --accent: #1DB954;
  --accent-glow: rgba(29, 185, 84, 0.3);
  --baby-blue: #89CFF0;
  --baby-pink: #FFB6C1;
  --baby-blue-glow: rgba(137, 207, 240, 0.3);
  --baby-pink-glow: rgba(255, 182, 193, 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(137, 207, 240, 0.2);
  --gradient-1: linear-gradient(135deg, var(--baby-blue) 0%, var(--baby-pink) 100%);
  --gradient-hero: linear-gradient(135deg, #fff 0%, var(--baby-blue) 50%, var(--baby-pink) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--baby-blue) 100%);
  --shadow-glow: 0 0 40px rgba(137, 207, 240, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(137, 207, 240, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 182, 193, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(137, 207, 240, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.app { max-width: 1400px; margin: 0 auto; padding: 20px 30px; }
.hidden { display: none !important; }

/* ============== Header ============== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 0 10px var(--baby-blue-glow));
}

.logo-divider {
  color: var(--muted);
  font-weight: 300;
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.accent { color: var(--accent); }

.auth { display: flex; gap: 12px; align-items: center; }

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 50px;
  backdrop-filter: blur(10px);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

/* ============== Buttons ============== */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--baby-blue);
  color: #000;
}

.btn-primary:hover {
  background: #7ac4e8;
}

.btn-spotify {
  background: var(--accent);
  color: #fff;
}

.btn-spotify:hover {
  background: #1aa34a;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--baby-blue);
  color: var(--baby-blue);
}

.btn-tidal {
  background: #000;
  color: #fff;
  border: 1px solid #333;
}

.btn-tidal:hover {
  background: #1a1a1a;
}

.btn:active { transform: translateY(0); }

/* ============== Hero - Stripe Style ============== */
.hero {
  text-align: center;
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

/* Animated gradient background */
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 30% 40%, rgba(137, 207, 240, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255, 182, 193, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(29, 185, 84, 0.08) 0%, transparent 50%);
  animation: hero-bg-rotate 20s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes hero-bg-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Floating particles effect */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(137, 207, 240, 0.4), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255, 182, 193, 0.3), transparent),
    radial-gradient(2px 2px at 60% 40%, rgba(29, 185, 84, 0.3), transparent),
    radial-gradient(2px 2px at 80% 60%, rgba(137, 207, 240, 0.3), transparent);
  background-size: 200% 200%;
  animation: particles-float 15s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes particles-float {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
}

.hero h1 {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -3px;
  margin-bottom: 20px;
  line-height: 1;
  background: linear-gradient(
    135deg,
    #fff 0%,
    var(--baby-blue) 25%,
    var(--baby-pink) 50%,
    var(--baby-blue) 75%,
    #fff 100%
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-flow 8s ease-in-out infinite;
}

@keyframes gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.3rem;
  margin-bottom: 20px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-motto {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 1px;
  padding: 12px 28px;
  background: rgba(137, 207, 240, 0.1);
  border: 1px solid rgba(137, 207, 240, 0.2);
  border-radius: 50px;
  display: inline-block;
  color: var(--baby-blue);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.hero-motto:hover {
  background: rgba(137, 207, 240, 0.15);
  border-color: rgba(137, 207, 240, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(137, 207, 240, 0.2);
}

/* ============== Input Section ============== */
.input-section {
  max-width: 600px;
  margin: 100px auto 40px;
  padding: 0 20px;
}

.input-tabs {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.tab {
  padding: 8px 0;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -17px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--baby-blue);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.input-group { display: flex; gap: 12px; }

.input-group input {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}

.input-group input:focus {
  outline: none;
  border-color: var(--muted);
}

.input-group input::placeholder { color: var(--muted); }

.hint { margin-top: 16px; color: var(--muted); font-size: 0.85rem; text-align: center; }

.search-input { text-align: center; }

.search-input textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 20px;
}

.search-input textarea:focus {
  outline: none;
  border-color: var(--muted);
}

/* ============== Upload Area ============== */
.upload-area {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  background: transparent;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--muted);
}

.upload-content { pointer-events: none; }
.upload-content p { color: var(--muted); margin: 8px 0; }
.upload-icon { font-size: 3rem; margin-bottom: 12px; display: block; opacity: 0.5; }

.btn-link {
  background: none;
  border: none;
  color: var(--baby-blue);
  cursor: pointer;
  text-decoration: none;
  font-size: inherit;
  pointer-events: auto;
  font-weight: 500;
}

.btn-link:hover { text-decoration: underline; }

.upload-status {
  margin-top: 20px;
  padding: 12px 16px;
  background: transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.upload-status span { flex: 1; color: var(--muted); }
.upload-status .btn-sm { flex-shrink: 0; }

/* ============== Loading ============== */
.loading { text-align: center; padding: 80px; }

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
  box-shadow: 0 0 20px var(--accent-glow);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading p { color: var(--text-secondary); font-size: 1.1rem; }

/* ============== Results ============== */
.results { animation: fadeIn 0.5s ease; }

.playlist-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
  padding: 24px;
  background: var(--bg-glass);
  border-radius: 16px;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.playlist-cover {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.playlist-info h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.playlist-info p { color: var(--text-secondary); font-size: 1rem; }

/* ============== Stats Grid ============== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-glass);
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============== Actions ============== */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-group label {
  color: var(--muted);
  font-weight: 500;
}

.sort-group select {
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.sort-group select:hover {
  border-color: var(--accent);
}

.export-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============== Selection Actions ============== */
.selection-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--gradient-1);
  border-radius: 12px;
  margin-bottom: 20px;
  color: #000;
  font-weight: 600;
}

.selection-actions .btn { padding: 8px 14px; font-size: 0.85rem; }
.btn-sm { padding: 8px 14px !important; font-size: 0.85rem !important; }
#selected-count { font-weight: 700; }

/* ============== Table ============== */
.table-container {
  overflow-x: auto;
  background: var(--bg-glass);
  border-radius: 16px;
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.tracks-table { width: 100%; border-collapse: collapse; }

.tracks-table th, .tracks-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tracks-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.2);
}

.tracks-table tbody tr {
  transition: all 0.2s ease;
}

.tracks-table tbody tr:hover { background: rgba(29, 185, 84, 0.05); }
.tracks-table tbody tr.selected { background: rgba(29, 185, 84, 0.12); }

.track-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.track-name {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.track-name:hover { color: var(--accent); }

.track-artist {
  color: var(--text-secondary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-col { color: var(--text-secondary); font-size: 0.9rem; }

.genre-col {
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-col {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-sm { font-size: 0.8rem; color: var(--text-secondary); margin-left: 6px; }

.explicit-badge {
  display: inline-block;
  background: var(--accent3);
  color: #fff;
  font-size: 0.6rem;
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: 8px;
  vertical-align: middle;
  font-weight: 700;
}

.no-data { color: var(--muted); }

/* Checkbox styling */
.tracks-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ============== Progress Bar ============== */
.progress-bar {
  width: 60px;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-fill.high { background: var(--gradient-1); }
.progress-fill.medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill.low { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ============== Mood Badge ============== */
.mood-badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.mood-happy {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.2), rgba(0, 212, 255, 0.2));
  color: var(--accent);
}

.mood-neutral {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.mood-sad {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

/* ============== Play Button ============== */
.play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--baby-blue);
  border: none;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.2s;
}

.play-btn:hover:not(:disabled) {
  background: #7ac4e8;
}

.play-btn:disabled {
  background: var(--bg3);
  color: var(--muted);
  cursor: not-allowed;
}

/* ============== Audio Player ============== */
.audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-glass);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 200px;
}

.player-info img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#player-track { font-weight: 600; }
#player-artist { color: var(--text-secondary); font-size: 0.85rem; }
.audio-player audio { flex: 1; max-width: 500px; }

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s ease;
}

.close-btn:hover { color: var(--text); }

/* ============== Footer ============== */
.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

/* ============== Responsive ============== */
@media (max-width: 1200px) {
  .tracks-table .genre-col { display: none; }
}

@media (max-width: 992px) {
  .tracks-table .album-col { display: none; }
}

@media (max-width: 768px) {
  .app { padding: 15px; }
  .hero { padding: 60px 0 40px; }
  .hero h1 { font-size: 2.5rem; letter-spacing: -1px; }
  .hero-subtitle { font-size: 1rem; }
  .hero-motto { font-size: 0.9rem; padding: 10px 20px; }
  .input-group { flex-direction: column; }
  .input-tabs { flex-wrap: wrap; width: 100%; }
  .tab { flex: 1; text-align: center; padding: 10px 16px; }
  .playlist-header { flex-direction: column; text-align: center; }
  .playlist-cover { width: 120px; height: 120px; }
  .actions { flex-direction: column; align-items: stretch; }
  .selection-actions { flex-wrap: wrap; justify-content: center; }
  .tracks-table th:nth-child(n+7), .tracks-table td:nth-child(n+7) { display: none; }
  .track-name { max-width: 140px; }
  .track-artist { max-width: 110px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.8rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .input-section { padding: 20px; }
}
