/* ========================================================
   SPOTIFY COLLABORATIVE ANALYZER - DESIGN SYSTEM & STYLES
   ======================================================== */

:root {
  --bg-main: #0c0e12;
  --bg-surface: #14171f;
  --bg-surface-elevated: #1a1e29;
  --bg-glass: rgba(26, 30, 41, 0.7);
  --bg-glass-card: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);

  --spotify-green: #1db954;
  --spotify-green-hover: #1ed760;
  --spotify-green-glow: rgba(29, 185, 84, 0.25);

  --accent-purple: #9d4edd;
  --accent-cyan: #00d2ff;
  --accent-orange: #ff9e00;
  --accent-pink: #ff4d6d;

  --text-main: #ffffff;
  --text-secondary: #a0a6b5;
  --text-muted: #656c7d;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(29, 185, 84, 0.5);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(29, 185, 84, 0.25);
}

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

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(29, 185, 84, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(157, 78, 221, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================
   CONTAINER & LAYOUT
   ======================================================== */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 80px 32px;
}

header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding: 28px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

header.app-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--spotify-green), var(--accent-cyan), var(--accent-purple));
}

.playlist-brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.playlist-cover-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.playlist-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.playlist-cover-wrapper:hover .playlist-cover {
  transform: scale(1.08);
}

.playlist-titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(29, 185, 84, 0.12);
  color: var(--spotify-green);
  border: 1px solid rgba(29, 185, 84, 0.25);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  width: fit-content;
}

.badge-demo {
  background: rgba(255, 158, 0, 0.15);
  color: var(--accent-orange);
  border-color: rgba(255, 158, 0, 0.3);
}

.playlist-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.playlist-meta-text {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.playlist-meta-text span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: var(--spotify-green);
  color: #000;
  box-shadow: 0 4px 16px var(--spotify-green-glow);
}

.btn-primary:hover {
  background: var(--spotify-green-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 185, 84, 0.4);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================================
   COLLABORATOR FILTER BAR & ACTIVE PERIOD BADGE
   ======================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-collab-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 280px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 0;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  flex-shrink: 0;
}

.collab-pills-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.collab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  user-select: none;
}

.collab-pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.collab-pill.active {
  background: rgba(29, 185, 84, 0.15);
  border-color: var(--spotify-green);
  color: #fff;
  box-shadow: 0 2px 12px var(--spotify-green-glow);
}

.collab-avatar-small {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.collab-count-badge {
  font-size: 11px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.collab-pill.active .collab-count-badge {
  background: rgba(29, 185, 84, 0.3);
  color: var(--spotify-green-hover);
}

/* TOP ACTIVE PERIOD INDICATOR BADGE */
.top-active-period {
  display: flex;
  align-items: center;
}

.active-period-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid var(--spotify-green);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 2px 12px var(--spotify-green-glow);
}

.active-period-badge svg {
  color: var(--spotify-green);
}

.btn-clear-period-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  font-size: 10px;
  cursor: pointer;
  transition: var(--transition-normal);
  padding: 0;
  line-height: 1;
}

.btn-clear-period-pill:hover {
  background: var(--accent-pink);
  transform: scale(1.1);
}

/* ========================================================
   TIMELINE CARD DRILLDOWN CONTROLS (IN-CHART BREADCRUMBS)
   ======================================================== */
.timeline-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timeline-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
}

.breadcrumb-node {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  transition: var(--transition-normal);
  white-space: nowrap;
}

.breadcrumb-node.interactive {
  cursor: pointer;
  color: var(--text-secondary);
}

.breadcrumb-node.interactive:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.breadcrumb-node.active {
  color: var(--spotify-green-hover);
  background: rgba(29, 185, 84, 0.15);
  font-weight: 700;
}

.breadcrumb-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
}

.btn-timeline-reset {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(255, 77, 109, 0.14);
  border: 1px solid rgba(255, 77, 109, 0.35);
  border-radius: var(--radius-full);
  color: #ff758f;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  white-space: nowrap;
}

.btn-timeline-reset:hover {
  background: rgba(255, 77, 109, 0.28);
  color: #fff;
  border-color: var(--accent-pink);
  transform: translateY(-1px);
}

/* ========================================================
   KPI CARDS GRID (EXACT SINGLE ROW 6 COLUMNS)
   ======================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
  width: 100%;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  min-width: 0;
  transition: var(--transition-normal);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-card);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--spotify-green);
  opacity: 0.6;
}

.kpi-card.purple::before { background: var(--accent-purple); }
.kpi-card.cyan::before { background: var(--accent-cyan); }
.kpi-card.orange::before { background: var(--accent-orange); }
.kpi-card.pink::before { background: var(--accent-pink); }

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 4px;
  min-width: 0;
}

.kpi-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  line-height: 1.25;
  min-width: 0;
  word-break: normal;
}

.kpi-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.kpi-value.kpi-value-sm {
  font-size: 12.5px;
  line-height: 1.25;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
}

.kpi-subtitle {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ========================================================
   SECTION & CARD LAYOUTS
   ======================================================== */
.section-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.section-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
  flex: 1;
}

/* ========================================================
   TOP ARTIST PODIUM
   ======================================================== */
.podium-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.12), rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(29, 185, 84, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.podium-artist-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--spotify-green);
  box-shadow: 0 4px 16px var(--spotify-green-glow);
}

.podium-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.podium-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--spotify-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.podium-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.podium-stats {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================================
   COLLABORATORS GRID
   ======================================================== */
.collab-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.collab-profile-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition-normal);
}

.collab-profile-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.collab-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.collab-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.collab-profile-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.collab-vibe-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(157, 78, 221, 0.15);
  color: #c77dff;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: inline-block;
}

.collab-stat-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.collab-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collab-stat-label {
  color: var(--text-muted);
}

.collab-stat-val {
  font-weight: 600;
  color: #fff;
}

/* ========================================================
   SUPERLATIVES / TRIVIA CARDS
   ======================================================== */
.superlative-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.superlative-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(29, 185, 84, 0.1);
  color: var(--spotify-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.superlative-icon.purple {
  background: rgba(157, 78, 221, 0.15);
  color: var(--accent-purple);
}

.superlative-icon.orange {
  background: rgba(255, 158, 0, 0.15);
  color: var(--accent-orange);
}

.superlative-icon.cyan {
  background: rgba(0, 210, 255, 0.15);
  color: var(--accent-cyan);
}

.superlative-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.superlative-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.superlative-song {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.superlative-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========================================================
   TRACKS TABLE
   ======================================================== */
.tracks-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.tracks-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  max-width: 380px;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  transition: var(--transition-normal);
}

.search-input:focus {
  outline: none;
  border-color: var(--spotify-green);
  box-shadow: 0 0 10px var(--spotify-green-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.tracks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.tracks-table th {
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.tracks-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.tracks-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.track-col-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.track-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.track-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.track-title {
  font-weight: 700;
  color: #fff;
}

.track-artists {
  font-size: 12px;
  color: var(--text-secondary);
}

.track-collab-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
}

.popularity-bar-container {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.popularity-bar-fill {
  height: 100%;
  background: var(--spotify-green);
  border-radius: var(--radius-full);
}

.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================================
   MODAL / SETTINGS DRAWER
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  transition: var(--transition-normal);
}

.form-input:focus {
  outline: none;
  border-color: var(--spotify-green);
  box-shadow: 0 0 10px var(--spotify-green-glow);
}

.form-help {
  font-size: 11.5px;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

/* ========================================================
   TOAST NOTIFICATIONS
   ======================================================== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--spotify-green);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-smooth);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-left-color: var(--accent-pink);
}

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
@media (max-width: 860px) {
  .section-grid-2, .section-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 16px;
  }
  
  header.app-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .playlist-brand {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================================
   FLOATING SPOTIFY MINI-PLAYER (STEP 1)
   ======================================================== */
.mini-player {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 980px;
  background: rgba(18, 21, 30, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(29, 185, 84, 0.45);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 30px rgba(29, 185, 84, 0.2);
  border-radius: var(--radius-lg);
  z-index: 1000;
  padding: 10px 18px;
  animation: slideUpPlayer 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpPlayer {
  from {
    opacity: 0;
    transform: translate(-50%, 40px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.mini-player-container {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.mini-player-track-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  max-width: 270px;
  flex-shrink: 0;
}

.player-album-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-titles {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-song-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist-name {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-collab-pill {
  display: none;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(29, 185, 84, 0.15);
  color: var(--spotify-green-hover);
  border: 1px solid rgba(29, 185, 84, 0.3);
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .player-collab-pill {
    display: inline-block;
  }
}

.mini-player-iframe-wrap {
  flex: 1;
  height: 80px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.mini-player-iframe-wrap iframe {
  border: none;
  display: block;
  width: 100%;
  height: 80px;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-player-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-player-circle:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.btn-player-circle.btn-close-player:hover {
  background: rgba(255, 77, 109, 0.2);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

/* Play button in table */
.btn-play-table {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--spotify-green);
  color: #000;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--spotify-green-glow);
  transition: var(--transition-fast);
}

.btn-play-table:hover {
  background: var(--spotify-green-hover);
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(29, 185, 84, 0.4);
}

/* Clickable superlatives */
.superlative-item.clickable-play {
  cursor: pointer;
  position: relative;
  transition: var(--transition-normal);
}

.superlative-item.clickable-play:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 185, 84, 0.4);
  box-shadow: 0 4px 16px rgba(29, 185, 84, 0.15);
}

.superlative-play-btn {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(29, 185, 84, 0.15);
  border: 1px solid rgba(29, 185, 84, 0.4);
  color: var(--spotify-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.superlative-item.clickable-play:hover .superlative-play-btn {
  background: var(--spotify-green);
  color: #000;
  transform: scale(1.1);
}

/* ========================================================
   COLLABORATOR CARDS ENHANCEMENTS (PASO 2)
   ======================================================== */
.collab-badges-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.collab-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: var(--transition-fast);
}

.collab-badge-chip.rarity-diamond {
  border-color: rgba(0, 210, 255, 0.5);
  background: rgba(0, 210, 255, 0.12);
  color: #00d2ff;
}

.collab-badge-chip.rarity-gold {
  border-color: rgba(255, 190, 11, 0.5);
  background: rgba(255, 190, 11, 0.12);
  color: #ffbe0b;
}

.collab-badge-chip.rarity-emerald {
  border-color: rgba(29, 185, 84, 0.5);
  background: rgba(29, 185, 84, 0.12);
  color: var(--spotify-green);
}

.collab-badge-chip.rarity-cyan {
  border-color: rgba(0, 210, 255, 0.4);
  background: rgba(0, 210, 255, 0.1);
  color: #80e5ff;
}

.collab-badge-chip.rarity-purple {
  border-color: rgba(157, 78, 221, 0.5);
  background: rgba(157, 78, 221, 0.12);
  color: #c77dff;
}

.collab-badge-chip.rarity-amber {
  border-color: rgba(255, 158, 0, 0.5);
  background: rgba(255, 158, 0, 0.12);
  color: #ffa200;
}

.collab-badge-chip.rarity-pink {
  border-color: rgba(255, 77, 109, 0.5);
  background: rgba(255, 77, 109, 0.12);
  color: #ff6b8b;
}

.collab-badge-chip.rarity-blue {
  border-color: rgba(77, 144, 255, 0.5);
  background: rgba(77, 144, 255, 0.12);
  color: #70a9ff;
}

.btn-open-wrapped {
  width: 100%;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.18), rgba(157, 78, 221, 0.22));
  border: 1px solid rgba(29, 185, 84, 0.4);
  color: #fff;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-open-wrapped:hover {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.35), rgba(157, 78, 221, 0.4));
  border-color: var(--spotify-green);
  box-shadow: 0 4px 14px rgba(29, 185, 84, 0.25);
  transform: translateY(-1px);
}

/* ========================================================
   WRAPPED MODAL (PASO 2)
   ======================================================== */
.wrapped-modal-dialog {
  max-width: 660px;
  width: 94%;
  border-radius: 24px;
  background: linear-gradient(170deg, #161724 0%, #0d0e15 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(29, 185, 84, 0.15);
  overflow: hidden;
  position: relative;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.wrapped-glow-bg {
  position: absolute;
  top: -80px;
  left: 30%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29, 185, 84, 0.22) 0%, rgba(157, 78, 221, 0.2) 50%, transparent 70%);
  pointer-events: none;
  filter: blur(45px);
  z-index: 0;
}

.wrapped-modal-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wrapped-badge-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--spotify-green);
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.3);
  padding: 4px 12px;
  border-radius: 9999px;
}

.wrapped-modal-body {
  position: relative;
  z-index: 1;
  padding: 20px 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wrapped-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wrapped-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.wrapped-hero-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--spotify-green);
  box-shadow: 0 0 16px var(--spotify-green-glow);
}

.wrapped-rank-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #000;
  color: #ffbe0b;
  font-weight: 900;
  font-size: 11px;
  border-radius: 9999px;
  padding: 2px 7px;
  border: 1px solid #ffbe0b;
}

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

.wrapped-hero-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.wrapped-hero-vibe {
  font-size: 12px;
  color: #c77dff;
  font-weight: 600;
  margin-bottom: 6px;
}

.wrapped-hero-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

.wrapped-hero-meta b {
  color: #fff;
}

.wrapped-section-title {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.trophies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.trophy-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trophy-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.trophy-meta {
  flex: 1;
  min-width: 0;
}

.trophy-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.trophy-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.sound-dna-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 600px) {
  .sound-dna-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sound-dna-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}

.sound-dna-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.sound-dna-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standout-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.standout-track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: var(--transition-fast);
}

.standout-track-row:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(29, 185, 84, 0.3);
}

.standout-track-img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.standout-track-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standout-track-artist {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standout-track-pop {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(29, 185, 84, 0.15);
  color: var(--spotify-green);
  font-weight: 700;
  flex-shrink: 0;
}

.btn-play-standout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  background: var(--spotify-green);
  color: #000;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.btn-play-standout:hover {
  background: var(--spotify-green-hover);
  transform: scale(1.06);
}

/* ========================================================
   AFINIDAD MUSICAL & ARTISTAS EN DISPUTA (PASO 3)
   ======================================================== */
.affinity-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.affinity-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition-normal);
}

.affinity-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.affinity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.affinity-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.affinity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.affinity-names {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.affinity-score {
  font-size: 16px;
  font-weight: 800;
  color: var(--spotify-green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.affinity-bar-wrap {
  width: 100%;
  height: 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}

.affinity-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--spotify-green) 0%, #a855f7 100%);
  border-radius: 9999px;
}

.affinity-shared-summary {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.affinity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.affinity-chip {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 3px 8px;
  border-radius: 9999px;
  color: var(--text-secondary);
}

.affinity-chip b {
  color: #fff;
}

.disputed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.disputed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 12px;
}

.disputed-artist-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.disputed-total-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.disputed-contributors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.disputed-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(29, 185, 84, 0.1);
  border: 1px solid rgba(29, 185, 84, 0.25);
  color: var(--spotify-green);
}

/* ========================================================
   TABLE SORTING & USABILITY (PASO 4)
   ======================================================== */
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.sortable-th:hover {
  color: #fff;
}

.sort-icon {
  font-size: 11px;
  margin-left: 4px;
  color: var(--text-muted);
}

.sortable-th.sorted-asc .sort-icon {
  color: var(--spotify-green);
}

.sortable-th.sorted-desc .sort-icon {
  color: var(--spotify-green);
}

.btn-quick-filter {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: rgba(29, 185, 84, 0.12);
  border: 1px solid rgba(29, 185, 84, 0.35);
  color: var(--spotify-green);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-quick-filter:hover {
  background: rgba(29, 185, 84, 0.22);
  border-color: var(--spotify-green);
}

.btn-quick-filter.active {
  background: var(--spotify-green);
  color: #000;
  box-shadow: 0 0 12px var(--spotify-green-glow);
}

/* ========================================================
   SHARE MODAL (PASO 5)
   ======================================================== */
.share-modal-dialog {
  max-width: 520px;
  width: 90%;
}

.share-text-box {
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: #e0e0e0;
  max-height: 260px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-bottom: 16px;
  user-select: all;
}

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

