/* ============= ACCENT COLOR THEMES ============= */
:root {
  /* Default theme - Red */
  --accent-color: #ff6b6b;
  --accent-color-hover: #ff8a8a;
  --accent-color-light: #cc5555;
  --accent-color-alpha: rgba(255, 107, 107, 0.1);
}

:root[data-accent="cyan"] {
  --accent-color: #00ffff;
  --accent-color-hover: #33ffff;
  --accent-color-light: #0088aa;
  --accent-color-alpha: rgba(0, 255, 255, 0.1);
}

:root[data-accent="red"] {
  --accent-color: #ff6b6b;
  --accent-color-hover: #ff8a8a;
  --accent-color-light: #cc5555;
  --accent-color-alpha: rgba(255, 107, 107, 0.1);
}

:root[data-accent="green"] {
  --accent-color: #4ecdc4;
  --accent-color-hover: #6ed7d0;
  --accent-color-light: #3ea39d;
  --accent-color-alpha: rgba(78, 205, 196, 0.1);
}

:root[data-accent="orange"] {
  --accent-color: #ff9f43;
  --accent-color-hover: #ffb366;
  --accent-color-light: #cc7f36;
  --accent-color-alpha: rgba(255, 159, 67, 0.1);
}

body {
  background-color: #111;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  margin: 32px 0 0 0;
  padding: 40px;
  transition: all 0.3s ease;
  --text-color: #fff;
  --border-color: #555;
  --input-bg: #222;
}

body.light-mode {
  background-color: #f5f5f5;
  color: #333;
  --text-color: #333;
  --border-color: #ccc;
  --input-bg: #fff;
}

.logo-container {
  text-align: center;
  margin: 0 0 20px 0;
  padding: 20px 0;
}

.logo-image {
  width: 100%;
  max-width: 1200px;
  height: 400px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Responsive logo sizing */
@media (max-width: 768px) {
  .logo-image {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .logo-image {
    height: 200px;
  }
}

.top-right-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-selector label {
  font-size: 20px;
  cursor: pointer;
}

#theme-select {
  background: var(--input-bg);
  color: var(--text-color);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

#theme-select:hover {
  border-color: var(--accent-color-hover);
}

#theme-select:focus {
  box-shadow: 0 0 0 2px var(--accent-color-alpha);
}

.accent-color-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accent-color-selector label {
  font-size: 20px;
  cursor: pointer;
}

#accent-color-select {
  background: var(--input-bg);
  color: var(--text-color);
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

#accent-color-select:hover {
  border-color: var(--accent-color-hover);
}

#accent-color-select:focus {
  box-shadow: 0 0 0 2px var(--accent-color-alpha);
}

.theme-toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  cursor: pointer;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333;
  transition: .4s;
  border-radius: 34px;
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 16px;
}

.slider:after {
  content: "🌙";
  position: absolute;
  left: 8px;
  color: #fff;
  transition: opacity .4s;
  opacity: 1;
}

input:checked + .slider:after {
  content: "☀️";
  left: auto;
  right: 8px;
  opacity: 1;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input:checked + .slider {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

body.light-mode .slider {
  background-color: #ccc;
  border-color: #999;
}

body.light-mode .slider:before {
  background-color: #333;
}

body.light-mode .slider:after {
  color: #666;
}

body.light-mode input:checked + .slider {
  background-color: #0088aa;
  border-color: #0088aa;
}

body.light-mode input:checked + .slider:before {
  background-color: #fff;
}

body.light-mode input:checked + .slider:after {
  color: #fff;
}

h1 {
  text-align: center;
  margin: 0;
  font-size: 2rem;
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

body.light-mode h1 {
  color: #0088aa;
  text-shadow: none;
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.app-controls {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 20px;
  padding: 10px 15px;
  border-radius: 12px;
}

.header-container .app-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background-color: var(--button-bg, #333);
  color: var(--button-text, #fff);
  cursor: pointer;
  font-size: 14px;
  height: 37px;
  width: 150px;
  transition: all 0.2s ease;
  text-decoration: none;
  margin: 0;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

label.control-btn {
  box-sizing: border-box;
  padding: 8px 16px;
  height: 37px;
  width: 150px;
}

.control-btn:hover {
  background-color: var(--accent-color);
  color: #000;
  transform: translateY(-1px);
}

.control-btn:focus {
  background-color: var(--accent-color);
  color: #000;
  transform: translateY(-1px);
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body.light-mode .control-btn:focus {
  outline-color: #0088aa;
}

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

body.light-mode .control-btn {
  --button-bg: #ddd;
  --button-text: #333;
}

body.light-mode .control-btn:hover {
  background-color: var(--accent-color) !important;
  color: #fff !important;
}

/* ============= MAIN SEARCH SECTION ============= */
.main-search-section {
  margin: 20px 0 30px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 15px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 600px;
  width: 100%;
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-wrapper:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 4px 16px rgba(0,255,255,0.2);
  transform: translateY(-1px);
}

.light-mode .search-wrapper:focus-within {
  border-color: #0066cc;
  box-shadow: 0 4px 16px rgba(0,102,204,0.15);
}

.search-icon {
  font-size: 18px;
  margin: 0 12px 0 16px;
  color: #666;
  pointer-events: none;
}

.light-mode .search-icon {
  color: #999;
}

.search-wrapper input[type="text"] {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 16px 8px;
  font-size: 16px;
  color: var(--text-color);
  outline: none !important;
  min-height: 20px;
  box-shadow: none !important;
}

.search-wrapper input[type="text"]::placeholder {
  color: #666;
  font-style: italic;
}

.light-mode .search-wrapper input[type="text"]::placeholder {
  color: #999;
}

.clear-search {
  background: none;
  border: none;
  color: #666;
  font-size: 24px;
  line-height: 1;
  padding: 8px 12px;
  margin-right: 8px;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.6;
  pointer-events: auto;
}

.clear-search.visible {
  opacity: 1;
  pointer-events: auto;
}

.clear-search:hover {
  background: rgba(255,255,255,0.1);
  color: #ff4444;
}

.light-mode .clear-search:hover {
  background: rgba(0,0,0,0.1);
  color: #cc0000;
}

/* ============= FUZZY SEARCH TOGGLE ============= */
.fuzzy-search-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
}

.fuzzy-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  user-select: none;
}

.fuzzy-toggle-label:hover {
  border-color: var(--accent-color);
  background: rgba(0,255,255,0.1);
}

.light-mode .fuzzy-toggle-label:hover {
  border-color: #0066cc;
  background: rgba(0,102,204,0.1);
}

.fuzzy-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent-color);
}

.light-mode .fuzzy-toggle-label input[type="checkbox"] {
  accent-color: #0066cc;
}

.fuzzy-toggle-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

.fuzzy-toggle-label:has(input:checked) {
  border-color: var(--accent-color);
  background: rgba(0,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,255,255,0.2);
}

.light-mode .fuzzy-toggle-label:has(input:checked) {
  border-color: #0066cc;
  background: rgba(0,102,204,0.15);
  box-shadow: 0 2px 8px rgba(0,102,204,0.2);
}

/* Search wrapper responsive */
@media (max-width: 768px) {
  .main-search-section {
    margin: 15px 0 20px 0;
    padding: 0 10px;
  }
  
  .search-wrapper {
    max-width: none;
  }
  
  .search-wrapper input[type="text"] {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

.filter-group {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}

.left-filters {
  flex: 1;
  min-width: 300px;
}

.center-filters {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex: 2;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label span {
  font-size: 0.9em;
  font-weight: 500;
  color: var(--text-color);
}

.filter-label select,
.filter-label input {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  min-width: 120px;
  font-size: 0.9em;
}

#sort-select,
#playlist-select {
  min-width: 180px;
}

#search, 
#bpm-filter, 
#key-filter, 
#genre-filter,
#sort-select {
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  outline: none;
  background-color: #222;
  color: #fff;
  transition: all 0.3s ease;
}

body.light-mode #search,
body.light-mode #bpm-filter,
body.light-mode #key-filter,
body.light-mode #genre-filter,
body.light-mode #sort-select {
  background-color: #fff;
  color: #333;
}

#search:focus,
#bpm-filter:focus,
#key-filter:focus,
#genre-filter:focus,
#sort-select:focus {
  box-shadow: 0 0 0 2px var(--accent-color);
}

body.light-mode #search:focus,
body.light-mode #bpm-filter:focus,
body.light-mode #key-filter:focus,
body.light-mode #genre-filter:focus,
body.light-mode #sort-select:focus {
  box-shadow: 0 0 0 2px #0088aa;
}

.playlist-select-container {
  margin: 0;
  min-width: 200px;
}

.playlist-select-container select {
  margin: 0;
}

.playlist-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
  align-items: flex-end;
}

.playlist-btn {
  background: none;
  color: var(--button-text, #333);
  border: none;
  border-radius: 0;
  width: 22px;
  height: 22px;
  font-size: 18px;
  font-family: inherit;
  font-weight: bold;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
  vertical-align: middle;
  padding: 0;
  box-shadow: none;
  position: relative;
  top: 1px;
}

.playlist-btn:hover {
  color: #00aaff;
  transform: scale(1.15);
}

.playlist-btn:focus {
  color: #00aaff;
  transform: scale(1.15);
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body.light-mode .playlist-btn:focus {
  outline-color: #0088aa;
}

body.light-mode .playlist-btn {
  color: #222;
}

body.light-mode .playlist-btn:hover {
  color: #0088aa;
}

/* Legacy button classes - now using unified track-icons-row button styling */

/* ============= PLAY QUEUE CONTROLS ============= */
.play-queue-controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 2px solid var(--accent-color);
  flex-wrap: wrap;
}

body.light-mode .play-queue-controls {
  background: rgba(0, 0, 0, 0.05);
  border: 2px solid var(--accent-color);
}

.queue-playback-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.queue-btn {
  min-width: auto !important;
  padding: 8px 16px !important;
  font-size: 14px;
}

.queue-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  min-width: 200px;
  text-align: center;
}

#queue-status {
  font-weight: 600;
  color: var(--accent-color);
}

#queue-position {
  font-size: 12px;
  opacity: 0.8;
}

.automix-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.automix-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.automix-toggle-label input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.crossfade-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.crossfade-settings label {
  font-weight: 500;
}

#crossfade-duration {
  width: 100px;
  cursor: pointer;
}

#crossfade-value {
  min-width: 30px;
  font-weight: 600;
  color: var(--accent-color);
}

@media (max-width: 1024px) {
  .play-queue-controls {
    flex-direction: column;
    gap: 15px;
  }

  .queue-info {
    min-width: auto;
  }
}

#stats {
  text-align: center;
  margin: 15px 0;
  padding: 12px;
  font-size: 1.15em;
  color: var(--text-color);
  background-color: var(--stats-bg, rgba(0, 0, 0, 0.1));
  border-radius: 20px;
  line-height: 1.4;
  font-weight: 500;
}

body.light-mode #stats {
  --stats-bg: rgba(0, 0, 0, 0.05);
}

.file-format-info {
  margin-top: 6px;
  font-size: 0.92em;
  color: #888;
  opacity: 0.95;
  text-align: center;
}

body.light-mode .file-format-info {
  color: #555;
}

/* Masonry Layout for Better Space Utilization */
.columns {
  /* Modern masonry layout (experimental) */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-template-rows: masonry;
  gap: 35px;
  padding: 20px;

  /* Fallback for browsers that don't support masonry */
  column-count: auto;
  column-width: 320px;
  column-gap: 35px;
  column-fill: balance;
}

/* Support for browsers with masonry */
@supports (grid-template-rows: masonry) {
  .columns {
    column-count: unset;
    column-width: unset;
    column-gap: unset;
    column-fill: unset;
  }

  .column-group {
    display: block;
    width: auto;
  }
}

/* Enhanced fallback for better browser support */
@supports not (grid-template-rows: masonry) {
  .columns {
    /* Use multi-column layout as fallback */
    display: block;
    column-count: auto;
    column-width: 320px;
    column-gap: 20px;
    column-fill: balance;
  }

  .column-group {
    /* Optimize for column layout */
    break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    vertical-align: top;
    margin-bottom: 20px;
  }

  /* Prevent orphaned content */
  .column-group:last-child {
    margin-bottom: 0;
  }
}

.column-group {
  margin: 0 0 35px 0;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 2px solid var(--accent-color);
  padding: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;

  /* Masonry layout optimizations */
  break-inside: avoid;
  page-break-inside: avoid;
  display: inline-block;
  width: 100%;
  vertical-align: top;
  overflow: visible;
}

body.light-mode .column-group {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: var(--accent-color-light);
}

.column-group:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px var(--accent-color-alpha);
  border-color: var(--accent-color-hover);
}

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

.column-group h2 {
  color: var(--accent-color);
  font-size: 1.25rem;
  margin: 0;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
}

body.light-mode .column-group h2 {
  color: #0088aa;
  border-bottom: 1px solid #ddd;
}

.group h2, .artist h2 {
  color: #2196f3;
  font-weight: 600;
  margin-bottom: 0.3em;
}

.export-btn {
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.light-mode .export-btn {
  color: #0088aa;
  border-color: #0088aa;
}

.export-btn:hover {
  background-color: rgba(0, 255, 255, 0.1);
}

body.light-mode .export-btn:hover {
  background-color: rgba(0, 136, 170, 0.1);
}

.track {
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  overflow: visible; /* Allow tooltips to show */
  box-sizing: border-box;
  position: relative;
}

.track-main {
  display: block;
  font-size: 1.08em;
  font-weight: 600;
  margin-bottom: 0;
  line-height: 1.2;
  word-break: break-word;
}

.track-details {
  display: block;
  font-size: 0.98em;
  color: #bbb;
  margin-top: 0px;
  margin-bottom: 0px;
  line-height: 1.02;
}

body.light-mode .track-details {
  color: #555;
}

.track-name {
  margin-bottom: 0;
}

.track-icons-row {
  display: flex;
  flex-wrap: nowrap; /* Prevent wrapping */
  gap: 5px; /* Comfortable spacing between buttons */
  width: 100%;
  max-width: 100%; /* Prevent overflow */
  margin-bottom: 8px;
  margin-top: 12px; /* Add space above track buttons */
  justify-content: center; /* Center the buttons */
  align-items: center;
  min-height: 40px; /* Ensure consistent row height */
  overflow: visible; /* Allow tooltips to show */
}

/* Track icon buttons - using higher specificity to avoid !important */
.track .track-icons-row button {
  padding: 0;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  flex-shrink: 0;
  background: #333;
  border: 2px solid var(--accent-color);
  cursor: pointer;
  margin: 0;
  box-shadow: 0 0 8px var(--accent-color-alpha);
  transition: all 0.2s ease;
  position: relative;
}

/* Keep icon images clipped inside button */
.track .track-icons-row button > img {
  border-radius: 3px;
}

/* Enhanced tooltip styling for track icon buttons */
.track .track-icons-row button::before {
  content: attr(data-tooltip);
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10000;
  border: 3px solid var(--accent-color);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-color);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.track .track-icons-row button::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: var(--accent-color);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 9999;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.track .track-icons-row button:hover::before,
.track .track-icons-row button:focus::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.track .track-icons-row button:hover::after,
.track .track-icons-row button:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Light mode tooltip styling */
body.light-mode .track .track-icons-row button::before {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  color: #222;
  border: 3px solid var(--accent-color);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 30px var(--accent-color);
  text-shadow: none;
}

/* Icon images inside track buttons */
.track .track-icons-row button img {
  width: 32px;
  height: 32px;
  filter: brightness(1.3) contrast(1.2);
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* SVG icon specific styling - white icons on dark background */
.track .track-icons-row button img[src$=".svg"] {
  filter: brightness(1.5) contrast(1.3);
  opacity: 0.9;
}

/* Hide images that fail to load */
.track .track-icons-row button img.icon-error {
  display: none;
}

/* Fallback text (hidden by default, shown when icon fails) */
.track .track-icons-row button .icon-fallback {
  font-size: 14px;
  font-weight: bold;
  font-family: monospace;
  color: white;
  display: none;
}

/* Show fallback text when icon load fails */
.track .track-icons-row button.icon-load-failed .icon-fallback {
  display: block;
}

/* Light mode - button background and icons */
body.light-mode .track .track-icons-row button {
  background: #f5f5f5;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color-alpha);
}

body.light-mode .track .track-icons-row button img {
  filter: brightness(0.5) contrast(1.4);
}

/* SVG icons in light mode - slightly darken for contrast but keep visible */
body.light-mode .track .track-icons-row button img[src$=".svg"] {
  filter: brightness(0.6) contrast(1.3);
  opacity: 0.8;
}

body.light-mode .track .track-icons-row button .icon-fallback {
  color: #333;
}

/* Hover and focus effects for track action buttons */
.track .track-icons-row button:hover,
.track .track-icons-row button:focus {
  background: var(--accent-color);
  border-color: var(--accent-color-hover);
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--accent-color), 0 0 40px var(--accent-color-alpha);
  outline: none;
}

/* Focus-visible for keyboard navigation - visible outline for keyboard users */
.track .track-icons-row button:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

.track .track-icons-row button:hover img,
.track .track-icons-row button:focus img {
  filter: brightness(2.5) contrast(1.5) saturate(1.5) drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}

/* SVG hover effects */
.track .track-icons-row button:hover img[src$=".svg"],
.track .track-icons-row button:focus img[src$=".svg"] {
  filter: brightness(3) contrast(1.8) drop-shadow(0 0 5px rgba(255, 255, 255, 1));
  opacity: 1;
}

body.light-mode .track .track-icons-row button:hover,
body.light-mode .track .track-icons-row button:focus {
  background: var(--accent-color);
  border-color: var(--accent-color-hover);
}

body.light-mode .track .track-icons-row button:hover img,
body.light-mode .track .track-icons-row button:focus img {
  filter: brightness(1.8) contrast(1.6) saturate(1.3);
}

/* SVG hover in light mode - brighter/whiter on hover */
body.light-mode .track .track-icons-row button:hover img[src$=".svg"],
body.light-mode .track .track-icons-row button:focus img[src$=".svg"] {
  filter: brightness(1.5) contrast(1.5) drop-shadow(0 0 5px rgba(255, 255, 255, 0.9));
  opacity: 1;
}

/* ============= COVER ART STYLES ============= */
.track-main-container {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.track-cover-art {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.cover-art-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
  border-radius: 5px;
}

.cover-art-image.placeholder {
  opacity: 0.6;
  filter: grayscale(0.3);
}

.cover-art-image:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.track-info-container {
  flex: 1;
  min-width: 0; /* Allows text to truncate properly */
}

/* Light mode cover art adjustments */
body.light-mode .track-cover-art {
  border-color: rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

body.light-mode .cover-art-image.placeholder {
  opacity: 0.7;
  filter: grayscale(0.2);
}

/* Responsive cover art */
@media (max-width: 768px) {
  .track-cover-art {
    width: 56px;
    height: 56px;
  }

  .track-main-container {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .track-cover-art {
    width: 48px;
    height: 48px;
  }

  .track-main-container {
    gap: 8px;
  }
}

.track-tags-row {
  display: block;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 0.98em;
  color: #fff;
  padding-left: 2px;
}

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

.track span {
  flex-grow: 1;
  margin: 0 10px;
}

.play-btn, .copy-btn {
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.play-btn:hover, .copy-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.play-btn:focus, .copy-btn:focus {
  opacity: 1;
  transform: scale(1.1);
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body.light-mode .play-btn:focus,
body.light-mode .copy-btn:focus {
  outline-color: #0088aa;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #888;
  font-style: italic;
}

.playlist-controls .control-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}


.tag-popup {
  background: #222;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 10px 12px;
  z-index: 1000;
  min-width: 210px;
  font-size: 14px;
}

body.light-mode .tag-popup {
  background: #fff;
  color: #222;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

.tag-popup input[type="text"] {
  border-radius: 6px;
  border: 1px solid #aaa;
  padding: 5px 8px;
  margin-right: 6px;
  font-size: 14px;
  width: 120px;
}

.tag-popup button {
  border: none;
  border-radius: 6px;
  background: #00aaff;
  color: #fff;
  padding: 5px 10px;
  font-size: 13px;
  margin-left: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.tag-popup button:hover {
  background: #0088cc;
}

/* Energy Level Popup */
.energy-popup {
  position: absolute;
  background: #222;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 12px;
  z-index: 1000;
  min-width: 220px;
  font-size: 14px;
  border: 1px solid #444;
}

body.light-mode .energy-popup {
  background: #fff;
  color: #222;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  border: 1px solid #ddd;
}

.energy-title {
  font-weight: bold;
  margin-bottom: 8px;
  text-align: center;
}

.energy-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.energy-level-btn, .energy-clear-btn {
  border: none;
  border-radius: 6px;
  background: #444;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

body.light-mode .energy-level-btn,
body.light-mode .energy-clear-btn {
  background: #f0f0f0;
  color: #222;
}

.energy-level-btn:hover, .energy-clear-btn:hover {
  background: #00aaff;
  color: #fff;
}

.energy-level-btn.active {
  background: #00aaff;
  color: #fff;
}

.energy-clear-btn {
  background: #cc4444;
  margin-top: 4px;
}

.energy-clear-btn:hover {
  background: #aa2222;
}

.track-tags {
  margin-left: 6px;
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  vertical-align: middle;
}

.tag-pill {
  background: #00aaff;
  color: #fff;
  border-radius: 8px;
  padding: 1px 7px;
  font-size: 12px;
  display: inline-block;
  margin-right: 2px;
  margin-bottom: 1px;
  line-height: 1.4;
  font-weight: 500;
}

body.light-mode .tag-pill {
  background: #0066aa;
  color: #fff;
}

.tag-pill-container {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-right: 2px;
  margin-bottom: 1px;
}

.tag-remove-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.tag-remove-btn:hover {
  background: rgba(255, 0, 0, 0.7);
  transform: scale(1.1);
}

body.light-mode .tag-remove-btn {
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}

body.light-mode .tag-remove-btn:hover {
  background: rgba(255, 0, 0, 0.7);
  color: #fff;
}

/* ============= MOOD & VIBE TAGS ============= */
.mood-vibe-tags-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.mood-vibe-label {
  font-size: 14px;
  margin-right: 4px;
  opacity: 0.8;
}

.mood-vibe-pill {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: #fff;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  display: inline-block;
  margin-right: 3px;
  margin-bottom: 2px;
  line-height: 1.3;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body.light-mode .mood-vibe-pill {
  background: linear-gradient(135deg, #e91e63, #ff5722);
  color: #fff;
}

.mood-vibe-pill-container {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-right: 3px;
  margin-bottom: 2px;
}

.mood-vibe-remove-btn {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  margin-left: 3px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mood-vibe-remove-btn:hover {
  background: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

body.light-mode .mood-vibe-remove-btn {
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

body.light-mode .mood-vibe-remove-btn:hover {
  background: rgba(255, 0, 0, 0.8);
  color: #fff;
}

/* Mood & Vibe Popup */
.mood-vibe-popup {
  position: absolute;
  background: #222;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 10px 12px;
  z-index: 1000;
  min-width: 280px;
  font-size: 14px;
  border: 1px solid #444;
}

body.light-mode .mood-vibe-popup {
  background: #fff;
  color: #222;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  border: 1px solid #ddd;
}

.mood-vibe-popup input[type="text"] {
  border-radius: 6px;
  border: 1px solid #666;
  background: #333;
  color: #fff;
  padding: 6px 10px;
  margin-right: 6px;
  font-size: 13px;
  width: 200px;
}

body.light-mode .mood-vibe-popup input[type="text"] {
  border: 1px solid #ccc;
  background: #fff;
  color: #222;
}

.mood-vibe-popup button {
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: #fff;
  padding: 6px 12px;
  font-size: 13px;
  margin-left: 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mood-vibe-popup button:hover {
  background: linear-gradient(135deg, #ff5252, #ff7043);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.mood-vibe-input-width {
  width: 200px;
}


#top-audio-visualizer,
#audio-visualizer {
  width: 100%;
  max-width: 1200px;
  height: 60px;
  margin: 40px auto 0 auto;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--accent-color);
  box-sizing: border-box;
  display: block;
  transition: border-color 0.3s ease;
}

body.light-mode #top-audio-visualizer,
body.light-mode #audio-visualizer {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: var(--accent-color-light);
}

/* Waveform Canvas Styling */
#waveform-canvas {
  width: 100%;
  max-width: 1200px;
  height: 100px;
  margin: 10px auto;
  border: 2px solid #0088aa;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 8px rgba(0, 136, 170, 0.3);
  display: block;
}

body.light-mode #waveform-canvas {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: #0088aa;
}

/* Audio Player Waveform Styling */
.audio-player-waveform {
  width: 100%;
  max-width: 560px;
  height: 80px;
  margin: 8px 0;
  border: 1px solid #0088aa;
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.5);
  display: block;
}

body.light-mode .audio-player-waveform {
  background-color: rgba(0, 0, 0, 0.1);
  border-color: #0088aa;
}

/* Waveform style dropdown - inherits from .control-btn */
.waveform-style-dropdown {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 32px;
}

body.light-mode .waveform-style-dropdown {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}


/* Audio Player Zoom Controls */
.audio-player-zoom-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.3);
}

.audio-zoom-btn {
  background: rgba(0, 255, 255, 0.2);
  border: 1px solid rgba(0, 255, 255, 0.5);
  border-radius: 6px;
  color: #00ffff;
  font-size: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.audio-zoom-btn:hover {
  background: rgba(0, 255, 255, 0.3);
  border-color: rgba(0, 255, 255, 0.7);
  transform: translateY(-1px);
}

.audio-zoom-btn:active {
  transform: translateY(0);
  background: rgba(0, 255, 255, 0.4);
}

.audio-zoom-level {
  color: #00ffff;
  font-size: 13px;
  font-weight: bold;
  min-width: 32px;
  text-align: center;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.light-mode .audio-player-zoom-controls {
  background: rgba(0, 123, 191, 0.1);
  border-color: rgba(0, 123, 191, 0.3);
}

body.light-mode .audio-zoom-btn {
  background: rgba(0, 123, 191, 0.2);
  border-color: rgba(0, 123, 191, 0.5);
  color: #007bbf;
}

body.light-mode .audio-zoom-btn:hover {
  background: rgba(0, 123, 191, 0.3);
  border-color: rgba(0, 123, 191, 0.7);
}

body.light-mode .audio-zoom-level {
  color: #007bbf;
}

#az-bar-container {
  margin: 16px 0 8px 0;
  text-align: center;
}

#az-bar {
  display: inline-block;
  background: #111;
  border-radius: 6px;
  padding: 4px 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.az-letter {
  display: inline-block;
  margin: 0 2px;
  padding: 3px 7px;
  font-size: 1.08em;
  font-weight: 600;
  color: #2196f3;
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  outline: none;
}

.az-letter:hover, .az-letter.active {
  background: #2196f3;
  color: #fff;
}

.az-letter:focus {
  background: #2196f3;
  color: #fff;
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body.light-mode .az-letter:focus {
  outline-color: #0088aa;
}

.az-category {
  font-weight: bold;
  border: 1px solid #444;
  background: linear-gradient(135deg, #555, #444);
}

.az-all {
  font-weight: bold;
  border: 1px solid #666;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  margin-right: 8px;
}

.az-category:hover, .az-category.active {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  border-color: #2196f3;
}

body.light-mode .az-category {
  border-color: #ccc;
  background: linear-gradient(135deg, #f8f8f8, #eee);
  color: #333;
}

body.light-mode .az-category:hover, body.light-mode .az-category.active {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  border-color: #2196f3;
  color: white;
}

.az-jump-highlight {
  animation: azJumpHighlight 1.2s ease-out;
}

@keyframes azJumpHighlight {
  0% { 
    background-color: rgba(33, 150, 243, 0.3);
    transform: scale(1.02);
  }
  50% { 
    background-color: rgba(33, 150, 243, 0.1);
  }
  100% { 
    background-color: transparent;
    transform: scale(1);
  }
}

.editable-title {
  /* Title is now static - no interactive styles needed */
}

.favorite-track .track-name {
  color: #ff2222 !important;
}

/* Star button favorited state */
.track-icons-row .star-btn.favorited {
  background: #ff2222 !important;
  border-color: #ff2222 !important;
}

/* Make the favorite icon yellow/gold when favorited */
.track-icons-row .star-btn.favorited img {
  filter: brightness(2) saturate(2) hue-rotate(0deg) drop-shadow(0 0 5px rgba(255, 215, 0, 0.8)) !important;
}

/* SVG favorite icon - bright yellow/gold when favorited */
.track-icons-row .star-btn.favorited img[src$=".svg"] {
  filter: brightness(1.5) contrast(1.2) invert(85%) sepia(100%) saturate(1000%) hue-rotate(0deg) drop-shadow(0 0 8px rgba(255, 215, 0, 1)) !important;
  opacity: 1 !important;
}

body.light-mode .track-icons-row .star-btn.favorited {
  background: #ff2222 !important;
  border-color: #ff2222 !important;
}

/* Light mode favorite icon - also yellow/gold when favorited */
body.light-mode .track-icons-row .star-btn.favorited img[src$=".svg"] {
  filter: brightness(1.3) contrast(1.3) invert(85%) sepia(100%) saturate(1000%) hue-rotate(0deg) drop-shadow(0 0 5px rgba(255, 215, 0, 0.8)) !important;
  opacity: 1 !important;
}

#favorites-toggle-btn {
  transition: background 0.2s, color 0.2s;
}

#favorites-toggle-btn.active {
  background: #ff2222;
  color: #fff;
  border: 1px solid #ff2222;
}

#cover-art-toggle-btn.active {
  background: #2196f3;
  color: #fff;
  border: 1px solid #2196f3;
  transition: background 0.2s, color 0.2s;
}

.top-controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.app-controls label.control-btn[for="tracklist-upload"] {
  background-color: #18c964;
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(24,201,100,0.10);
  font-weight: 600;
}

.app-controls label.control-btn[for="tracklist-upload"]:hover,
.app-controls label.control-btn[for="tracklist-upload"]:focus {
  background-color: #13a452;
  color: #fff;
}

.audio-player-container {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  width: 600px;
  max-width: 99vw;
  border: 2.5px solid var(--accent-color);
  border-radius: 20px;
  background: #181818;
  box-shadow: 0 6px 24px rgba(0,255,255,0.07), 0 1.5px 6px rgba(0,0,0,0.16);
  padding: 0 28px 0 0;
  box-sizing: content-box;
  overflow: visible;
}

.custom-audio-player {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0 0 18px 18px;
  box-shadow: none;
  padding: 0 0 16px 12px;
  margin: 0 auto;
  display: block;
  z-index: 9999;
  box-sizing: border-box;
  filter: brightness(2.5) contrast(1.3) saturate(1.2);
}

.audio-player-container::-webkit-media-controls-panel,
.custom-audio-player::-webkit-media-controls-panel {
  background: #181818;
  border-radius: 0 0 18px 18px;
}

/* Make audio controls more visible */
.audio-player-container::-webkit-media-controls-play-button,
.audio-player-container::-webkit-media-controls-pause-button,
.custom-audio-player::-webkit-media-controls-play-button,
.custom-audio-player::-webkit-media-controls-pause-button {
  filter: brightness(3) contrast(1.2);
  opacity: 1;
}

.audio-player-container::-webkit-media-controls-current-time-display,
.audio-player-container::-webkit-media-controls-time-remaining-display,
.custom-audio-player::-webkit-media-controls-current-time-display,
.custom-audio-player::-webkit-media-controls-time-remaining-display {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  font-weight: 600;
  filter: brightness(1.5);
}

.audio-player-container::-webkit-media-controls-mute-button,
.audio-player-container::-webkit-media-controls-volume-slider,
.audio-player-container::-webkit-media-controls-toggle-closed-captions-button,
.audio-player-container::-webkit-media-controls-fullscreen-button,
.custom-audio-player::-webkit-media-controls-mute-button,
.custom-audio-player::-webkit-media-controls-volume-slider,
.custom-audio-player::-webkit-media-controls-toggle-closed-captions-button,
.custom-audio-player::-webkit-media-controls-fullscreen-button {
  filter: brightness(3) contrast(1.2);
  opacity: 1;
}

.audio-player-container::-webkit-media-controls-timeline,
.custom-audio-player::-webkit-media-controls-timeline {
  filter: brightness(1.5);
}

body.light-mode .audio-player-container {
  background: #f5f5f5;
  border: 2.5px solid #00ccee;
}

body.light-mode .audio-player-label {
  color: #0088aa;
  background: transparent;
}

body.light-mode .custom-audio-player {
  background: transparent;
  border: none;
}

body.light-mode .audio-player-container::-webkit-media-controls-panel,
body.light-mode .custom-audio-player::-webkit-media-controls-panel {
  background: #f5f5f5;
}

body.light-mode .audio-player-container::-webkit-media-controls-current-time-display,
body.light-mode .audio-player-container::-webkit-media-controls-time-remaining-display,
body.light-mode .custom-audio-player::-webkit-media-controls-current-time-display,
body.light-mode .custom-audio-player::-webkit-media-controls-time-remaining-display {
  color: #333;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* Fading audio player (during crossfade) */
.audio-player-container.fading {
  bottom: 420px;
  opacity: 0.8;
  border-color: rgba(255, 107, 107, 0.6);
  z-index: 9998; /* Below the current player */
}

.audio-player-container.fading::before {
  content: "⏳ Fading out...";
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 107, 107, 0.9);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Audio player close button */
.audio-player-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  z-index: 10001;
  transition: all 0.2s ease;
}

.audio-player-close:hover {
  background: var(--accent-color);
  color: #000;
  transform: scale(1.1);
}

body.light-mode .audio-player-close {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-color);
}

body.light-mode .audio-player-close:hover {
  background: var(--accent-color);
  color: #fff;
}

/* Album art styles removed per user request */

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
  }
  
  h1 {
    font-size: 1.6rem;
  }
  
  .columns {
    /* Mobile: single column layout */
    grid-template-columns: 1fr;
    column-count: 1;
    column-width: unset;
    gap: 16px;
    padding: 16px;
  }
  
  #search-container {
    flex-direction: column;
  }
  
  #search, 
  #bpm-filter, 
  #key-filter, 
  #genre-filter,
  #sort-select {
    width: 100%;
  }
  
  .app-controls {
    width: 100%;
    justify-content: space-between;
  }
}

/* Loading animation */
.loader {
  border: 5px solid #333;
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

body.light-mode .loader {
  border-color: #ddd;
  border-top-color: #0088aa;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Transitions and animations */
.track {
  transition: background-color 0.2s ease;
}

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

body.light-mode .track {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .track:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

#tag-search {
  flex: 1 1 auto;
  min-width: 120px;
}

#tag-dropdown {
  min-width: 100px;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .control-btn {
    border: 2px solid currentColor;
  }
  
  .track {
    border: 1px solid currentColor;
  }
  
  .column-group {
    border: 2px solid currentColor;
  }
}

/* Add this for the copy tooltip functionality */
.copy-tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 10000;
  pointer-events: none;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

body.light-mode .copy-tooltip {
  background: #555;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============= NOTIFICATION SYSTEM ============= */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
  pointer-events: none;
}

.notification {
  background: #333;
  color: #fff;
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
  pointer-events: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  border-left: 4px solid #666;
  position: relative;
  max-width: 100%;
  word-wrap: break-word;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification.hide {
  transform: translateX(100%);
  opacity: 0;
}

.notification-success {
  background: #1a472a;
  border-left-color: #22c55e;
}

.notification-error {
  background: #7f1d1d;
  border-left-color: #ef4444;
}

.notification-warning {
  background: #78350f;
  border-left-color: #f59e0b;
}

.notification-info {
  background: #1e3a8a;
  border-left-color: #3b82f6;
}

body.light-mode .notification {
  background: #fff;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-left-color: #ccc;
}

body.light-mode .notification-success {
  background: #f0fdf4;
  color: #166534;
  border-left-color: #22c55e;
}

body.light-mode .notification-error {
  background: #fef2f2;
  color: #991b1b;
  border-left-color: #ef4444;
}

body.light-mode .notification-warning {
  background: #fffbeb;
  color: #92400e;
  border-left-color: #f59e0b;
}

body.light-mode .notification-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-left-color: #3b82f6;
}

.notification-message {
  flex: 1;
  margin: 0;
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  opacity: 0.7;
  padding: 0;
  margin-left: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.notification-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

body.light-mode .notification-close:hover {
  background: rgba(0, 0, 0, 0.1);
}


/* ============= DIALOG SYSTEM ============= */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(2px);
}

.dialog-overlay.show {
  opacity: 1;
}

.dialog-overlay.hide {
  opacity: 0;
}

.dialog {
  background: #222;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

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

body.light-mode .dialog {
  background: #fff;
  color: #333;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #333;
}

body.light-mode .dialog-header {
  border-bottom-color: #e5e5e5;
}

.dialog-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-color);
}

body.light-mode .dialog-title {
  color: #0088aa;
}

.dialog-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  opacity: 0.7;
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.dialog-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

body.light-mode .dialog-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.dialog-content {
  padding: 20px 24px;
}

.dialog-message {
  margin: 0;
  line-height: 1.5;
  font-size: 16px;
}

.dialog-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #333;
  color: #fff;
  font-size: 16px;
  transition: border-color 0.2s ease;
}

.dialog-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.2);
}

body.light-mode .dialog-input {
  background: #fff;
  color: #333;
  border-color: #ccc;
}

body.light-mode .dialog-input:focus {
  border-color: #0088aa;
  box-shadow: 0 0 0 2px rgba(0, 136, 170, 0.2);
}

.dialog-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  border-top: 1px solid #333;
}

body.light-mode .dialog-footer {
  border-top-color: #e5e5e5;
}

.dialog-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.dialog-btn-cancel {
  background: #444;
  color: #fff;
}

.dialog-btn-cancel:hover {
  background: #555;
}

.dialog-btn-confirm {
  background: var(--accent-color);
  color: #000;
}

.dialog-btn-confirm:hover {
  background: #00cccc;
}

body.light-mode .dialog-btn-cancel {
  background: #e5e5e5;
  color: #333;
}

body.light-mode .dialog-btn-cancel:hover {
  background: #d5d5d5;
}

body.light-mode .dialog-btn-confirm {
  background: #0088aa;
  color: #fff;
}

body.light-mode .dialog-btn-confirm:hover {
  background: #006688;
}

/* Responsive adjustments for notifications and dialogs */
@media (max-width: 480px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .notification {
    margin-bottom: 8px;
    padding: 14px 16px;
  }
  
  .dialog {
    width: 95%;
    margin: 0 10px;
  }
  
  .dialog-header,
  .dialog-content,
  .dialog-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ============= LIBRARY STATS STYLES ============= */
.library-stats {
  background: #222;
  border-radius: 12px;
  margin: 20px 0;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.light-mode .library-stats {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stats-container {
  padding: 24px;
}

.stats-container h2 {
  margin: 0 0 24px 0;
  color: var(--accent-color);
  text-align: center;
  font-size: 24px;
}

.light-mode .stats-container h2 {
  color: #0066cc;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.stat-section {
  background: #181818;
  border-radius: 8px;
  padding: 24px;
  border: 1px solid #333;
  min-height: 480px;
}

/* Make keys section span full width with Camelot Wheel */
.keys-section-full-width {
  grid-column: 1 / -1;
}

.keys-content-wrapper {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
}

.keys-chart-container {
  flex: 1;
  min-width: 0; /* Prevent overflow */
}

.camelot-wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid #333;
}

.camelot-wheel-image {
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.light-mode .camelot-wheel-container {
  background: rgba(0, 0, 0, 0.03);
  border-color: #e9ecef;
}

/* Make years section span full width */
.years-section {
  grid-column: 1 / -1;
  min-height: 400px;
}

/* Make record labels section span full width */
.record-labels-section {
  grid-column: 1 / -1;
  min-height: 400px;
}

.light-mode .stat-section {
  background: #f8f9fa;
  border-color: #e9ecef;
}

.stat-section h3 {
  margin: 0 0 12px 0;
  color: var(--accent-color);
  font-size: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

.light-mode .stat-section h3 {
  color: #0066cc;
  border-bottom-color: #e9ecef;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2a;
}

.stat-item:last-child {
  border-bottom: none;
}

.light-mode .stat-item {
  border-bottom-color: #f0f0f0;
}

.stat-label {
  font-weight: 500;
  color: #ccc;
}

.light-mode .stat-label {
  color: #666;
}

.stat-value {
  font-weight: 600;
  color: var(--accent-color);
  min-width: 40px;
  text-align: right;
}

.light-mode .stat-value {
  color: #0066cc;
}

.stat-list {
  max-height: 200px;
  overflow-y: auto;
}

/* Chart Container Styling */
.chart-container {
  position: relative;
  height: 380px;
  width: 100%;
  margin: 16px 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 20px;
}

/* Larger height for genre chart to accommodate 20 horizontal bars */
.stat-section:has(#genre-chart) .chart-container {
  height: 900px;
  min-height: 900px;
}

/* Larger height for top artists chart to accommodate 20 horizontal bars */
.stat-section:has(#top-artists-chart) .chart-container {
  height: 900px;
  min-height: 900px;
}

/* Larger height for key chart to accommodate 24 horizontal bars */
.stat-section:has(#key-chart) .chart-container {
  height: 1000px;
  min-height: 1000px;
}

/* Larger height for labels chart to accommodate 25 horizontal bars */
.stat-section:has(#label-chart) .chart-container {
  height: 1100px;
  min-height: 1100px;
}

/* Larger height for year chart to accommodate 30 horizontal bars */
.stat-section:has(#year-chart) .chart-container {
  height: 1200px;
  min-height: 1200px;
}

body.light-mode .chart-container {
  background: rgba(0, 0, 0, 0.02);
}

.chart-container canvas {
  max-height: 100%;
  max-width: 100%;
}

/* Show stat lists by default, charts will overlay if available */
.stat-list {
  display: block;
}

.stat-list::-webkit-scrollbar {
  width: 4px;
}

.stat-list::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.stat-list::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 2px;
}

.light-mode .stat-list::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.light-mode .stat-list::-webkit-scrollbar-thumb {
  background: #ccc;
}

/* Responsive stats layout */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-container {
    padding: 16px;
  }

  /* Stack Keys chart and Camelot Wheel vertically on mobile */
  .keys-content-wrapper {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .camelot-wheel-image {
    max-width: 300px;
  }
}

/* ============= DUPLICATE TRACKS OVERLAY ============= */
.duplicate-tracks {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

.duplicate-container {
  max-width: 800px;
  max-height: 80vh;
  margin: 10vh auto;
  background: #1a1a1a;
  border-radius: 8px;
  border: 1px solid #333;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.light-mode .duplicate-container {
  background: #fff;
  border-color: #e9ecef;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.duplicate-container h2 {
  margin: 0 0 24px 0;
  color: var(--accent-color);
  text-align: center;
  font-size: 24px;
  padding: 24px 24px 0 24px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #ff6b6b;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.close-btn:hover {
  background-color: rgba(255, 107, 107, 0.1);
}

.light-mode .close-btn {
  color: #dc3545;
}

.light-mode .close-btn:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

.light-mode .duplicate-container h2 {
  color: #0066cc;
}

#duplicate-content {
  padding: 0 24px 24px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.duplicate-group {
  background: #181818;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #333;
}

.light-mode .duplicate-group {
  background: #f8f9fa;
  border-color: #e9ecef;
}

.duplicate-group h3 {
  margin: 0 0 12px 0;
  color: #ff6b6b;
  font-size: 16px;
  border-bottom: 1px solid #333;
  padding-bottom: 8px;
}

.light-mode .duplicate-group h3 {
  color: #dc3545;
  border-bottom-color: #e9ecef;
}

.duplicate-track {
  background: #222;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 8px;
  border-left: 3px solid #ff6b6b;
}

.light-mode .duplicate-track {
  background: #ffffff;
  border-left-color: #dc3545;
}

.duplicate-track:last-child {
  margin-bottom: 0;
}

.duplicate-track-info {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
}

.duplicate-summary {
  background: #0a4d4d;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  border-left: 4px solid var(--accent-color);
  text-align: center;
}

.light-mode .duplicate-summary {
  background: #e7f3ff;
  border-left-color: #0066cc;
}

.duplicate-summary-text {
  color: var(--accent-color);
  font-weight: bold;
  font-size: 18px;
}

.light-mode .duplicate-summary-text {
  color: #0066cc;
}

/* Responsive duplicate tracks layout */
@media (max-width: 768px) {
  .duplicate-tracks {
    padding: 10px;
  }

  .duplicate-container {
    max-height: 90vh;
    margin: 5vh auto;
  }

  .duplicate-container h2 {
    padding: 16px 16px 0 16px;
    font-size: 20px;
  }

  #duplicate-content {
    padding: 0 16px 16px 16px;
  }
}

/* ============= PAGINATION CONTROLS ============= */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid var(--accent-color);
  flex-wrap: wrap;
  gap: 16px;
}

body.light-mode .pagination-controls {
  background: rgba(0, 0, 0, 0.03);
}

.pagination-info {
  color: var(--accent-color);
  font-weight: 500;
  font-size: 14px;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-buttons button {
  min-width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.pagination-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#page-info {
  color: var(--text-color);
  font-weight: 500;
  margin: 0 8px;
  font-size: 14px;
}

.tracks-per-page {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.tracks-per-page label {
  color: var(--text-color);
  font-weight: 500;
}

#tracks-per-page-select {
  background: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

#tracks-per-page-select:hover {
  border-color: var(--accent-color-hover);
}

#tracks-per-page-select:focus {
  box-shadow: 0 0 0 2px var(--accent-color-alpha);
}

/* Bottom pagination controls styling */
.pagination-bottom {
  margin-top: 30px;
  margin-bottom: 20px;
  border-color: var(--accent-color);
}

/* Add a subtle visual distinction for bottom controls */
.pagination-bottom .pagination-info {
  opacity: 0.9;
}

/* Responsive pagination */
@media (max-width: 768px) {
  .pagination-controls {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .pagination-buttons {
    justify-content: center;
  }

  .pagination-buttons button {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ============= LIBRARY SUMMARY STATS ============= */
.library-summary-stats {
  text-align: center;
  margin: 16px 0 24px 0;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: 500;
  color: var(--accent-color);
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  border: 1px solid var(--accent-color);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

body.light-mode .library-summary-stats {
  background: rgba(0, 0, 0, 0.03);
}

/* Responsive stats */
@media (max-width: 768px) {
  .library-summary-stats {
    font-size: 16px;
    margin: 12px 0 20px 0;
    padding: 6px 12px;
  }
}

/* ============= SMART PLAYLIST MODAL ============= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-color, #181818);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--accent-color);
}

.modal-header h2 {
  margin: 0;
  color: var(--accent-color);
}

.modal-close {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--accent-color);
  color: #000;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid var(--accent-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.smart-playlist-name {
  margin-bottom: 24px;
}

.smart-playlist-name label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: 500;
}

.smart-playlist-name input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  background: var(--input-bg, #2a2a2a);
  color: var(--text-color);
  font-size: 14px;
}

.smart-playlist-rules h3 {
  color: var(--text-color);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rule-logic-selector {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: normal;
}

.rule-logic-selector label {
  color: var(--text-color);
  cursor: pointer;
}

.smart-rule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.smart-rule-item select,
.smart-rule-item input {
  padding: 6px 8px;
  border: 1px solid var(--accent-color);
  border-radius: 4px;
  background: var(--input-bg, #2a2a2a);
  color: var(--text-color);
  font-size: 14px;
}

.smart-rule-item .rule-field {
  min-width: 120px;
}

.smart-rule-item .rule-operator {
  min-width: 100px;
}

.smart-rule-item .rule-value {
  flex: 1;
  min-width: 150px;
}

.remove-rule-btn {
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-rule-btn:hover {
  background: #ff6666;
}

.smart-playlist-preview {
  margin-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.smart-playlist-preview h3 {
  color: var(--text-color);
  margin-bottom: 12px;
}

.preview-tracks-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.1);
}

.preview-track-item {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  font-size: 14px;
}

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

/* Light mode */
body.light-mode .modal-content {
  --bg-color: #f5f5f5;
  --input-bg: #fff;
}

body.light-mode .smart-rule-item {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .preview-tracks-list {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-close:hover {
  color: #fff;
}

/* ============= PLAYLIST EDITOR MODAL ============= */
.playlist-editor-content {
  max-width: 700px;
  max-height: 80vh;
}

.playlist-editor-info {
  padding: 12px;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 16px;
}

.smart-playlist-notice {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 165, 0, 0.15);
  border-left: 3px solid #ffa500;
  border-radius: 6px;
}

.smart-playlist-notice p {
  margin: 6px 0;
  font-size: 13px;
  color: #ffa500;
}

body.light-mode .smart-playlist-notice {
  background: rgba(255, 165, 0, 0.1);
  border-left-color: #ff8c00;
}

body.light-mode .smart-playlist-notice p {
  color: #ff8c00;
}

.playlist-editor-tracks {
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .playlist-editor-tracks {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.1);
}

.playlist-editor-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

body.light-mode .playlist-editor-track {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

.playlist-editor-track:hover {
  background: rgba(0, 255, 255, 0.05);
}

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

.playlist-track-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.playlist-track-name {
  font-weight: 600;
  color: var(--accent-color);
}

.playlist-track-meta {
  font-size: 12px;
  color: #999;
  display: flex;
  gap: 12px;
}

body.light-mode .playlist-track-meta {
  color: #666;
}

.playlist-track-remove {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ff6b6b;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
}

.playlist-track-remove:hover {
  background: rgba(255, 107, 107, 0.3);
  border-color: rgba(255, 107, 107, 0.6);
}

.convert-btn {
  white-space: nowrap;
  min-width: auto;
  padding: 8px 16px;
}

/* ============= EXPORT FORMAT MODAL ============= */
.export-format-content {
  max-width: 600px;
}

.export-format-options {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.format-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.format-option:hover {
  border-color: var(--accent-color);
  background: rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.format-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: rgba(0, 255, 255, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

.format-info h3 {
  margin: 0 0 8px 0;
  color: var(--accent-color);
  font-size: 18px;
  font-weight: 600;
}

.format-info p {
  margin: 0;
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.8;
}

/* Light mode adjustments */
body.light-mode .format-option {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .format-option:hover {
  background: rgba(0, 0, 0, 0.1);
}

body.light-mode .format-icon {
  background: rgba(0, 255, 255, 0.1);
}

/* ============= UTILITY CLASSES FOR INLINE STYLES ============= */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-text-decoration {
  text-decoration: none !important;
}

.cursor-pointer {
  cursor: pointer;
}

.float-right {
  float: right;
}

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

.margin-top-small {
  margin-top: 4px;
}

.margin-top-large {
  margin-top: 40px;
}

.margin-left-small {
  margin-left: 6px;
}

.text-error {
  color: #ff2222;
}

.font-weight-bold {
  font-weight: bold;
}

.margin-bottom-medium {
  margin-bottom: 15px;
}

.footer-border {
  padding: 10px 0;
  border-top: 1px solid #333;
}

body.light-mode .footer-border {
  border-top-color: #e5e5e5;
}

.footer-link {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: #fff;
  text-decoration: underline;
}

body.light-mode .footer-link {
  color: #0066aa;
}

body.light-mode .footer-link:hover {
  color: #004488;
  text-decoration: underline;
}

/* ============= DYNAMIC STYLE CLASSES ============= */
.duplicate-list-header {
  color: #ffb300;
  font-weight: bold;
  margin-bottom: 6px;
}

.duplicate-list-container {
  max-height: 200px;
  overflow: auto;
  background: #181818;
  padding: 10px 16px 10px 22px;
  border-radius: 8px;
}

body.light-mode .duplicate-list-container {
  background: #f5f5f5;
}

.tag-popup {
  position: absolute;
  z-index: 1000;
}

.tag-input-width {
  width: 180px;
}

/* ===== MODERN CARD-BASED SEARCH INTERFACE ===== */

/* Search Container */
#search-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Main Search Card */
.search-section-card {
  background: var(--card-bg);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-section-card:hover {
  box-shadow: 0 4px 16px var(--accent-color-alpha);
  transform: translateY(-2px);
  border-color: var(--accent-color);
  border-width: 3px;
}

.search-section-card .filter-card-icon {
  color: var(--accent-color);
}

/* Search Content */
.search-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 300px;
  max-width: 600px;
}

.search-wrapper input {
  flex: 1;
  padding: 16px 40px 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 1.2em;
  transition: all 0.2s ease;
  width: 100%;
}

.search-wrapper input:focus {
  outline: none;
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.clear-search {
  position: absolute;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.3em;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.clear-search:hover {
  opacity: 1;
}

/* Fuzzy Search Toggle */
.fuzzy-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fuzzy-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-color);
  font-size: 0.95em;
  opacity: 0.9;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.fuzzy-toggle-label:hover {
  opacity: 1;
}

.fuzzy-toggle-label input[type="checkbox"] {
  margin: 0;
}

/* Filters Container */
.filters-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Filter Cards */
.filter-card {
  background: var(--card-bg);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.filter-card:hover {
  box-shadow: 0 4px 16px var(--accent-color-alpha);
  transform: translateY(-2px);
  border-color: var(--accent-color);
  border-width: 3px;
}

/* Filter Card Headers */
.filter-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.filter-card-icon {
  font-size: 1.2em;
  opacity: 0.8;
}

.filter-card-title {
  margin: 0;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-color);
}

/* Filter Grid */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Filter Items */
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item label {
  font-size: 0.9em;
  font-weight: 500;
  color: var(--text-color);
  opacity: 0.9;
}

.filter-item select,
.filter-item input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 0.9em;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.filter-item select:focus,
.filter-item input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.1);
  transform: translateY(-1px);
}

.filter-item select:hover,
.filter-item input:hover {
  border-color: var(--accent-color);
}

/* Core Filters Styling */
.core-filters {
  border: 2px solid var(--accent-color);
}

.core-filters .filter-card-icon {
  color: var(--accent-color);
}

/* Advanced Filters Styling */
.advanced-filters {
  border: 2px solid var(--accent-color);
}

.advanced-filters .filter-card-icon {
  color: var(--accent-color);
}

/* ============= COLLAPSIBLE FILTER DRAWER ============= */
.filter-drawer-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  color: #fff;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.filter-toggle-btn:hover {
  background: var(--accent-color-alpha);
  transform: translateY(-2px);
}

.filter-toggle-icon {
  font-size: 1.2em;
}

.filter-toggle-arrow {
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

.filter-toggle-btn.collapsed .filter-toggle-arrow {
  transform: rotate(-90deg);
}

body.light-mode .filter-toggle-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  border-color: var(--accent-color);
}

body.light-mode .filter-toggle-btn:hover {
  background: var(--accent-color-alpha);
}

.filter-drawer {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
  opacity: 1;
}

.filter-drawer.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

/* Hide old filter layout */
.filter-group.left-filters {
  display: none;
}

/* Masonry Layout Responsive Breakpoints */
@media (min-width: 1200px) {
  .columns {
    column-width: 350px;
    gap: 40px;
    padding: 24px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .columns {
    column-width: 320px;
    gap: 35px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .columns {
    column-width: 300px;
    gap: 30px;
    padding: 18px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .filters-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #search-container {
    padding: 0 16px;
    gap: 16px;
  }

  .search-section-card,
  .filter-card {
    padding: 16px;
  }

  .filter-card-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .filter-card-title {
    font-size: 1em;
  }

  .search-content {
    flex-direction: column;
    gap: 16px;
  }

  .search-wrapper {
    max-width: 100%;
    min-width: unset;
  }

  .search-wrapper input {
    padding: 14px 36px 14px 16px;
    font-size: 1.1em;
  }

  .fuzzy-search-toggle {
    justify-content: center;
  }

  .fuzzy-toggle-label {
    font-size: 0.9em;
  }

  /* Library Stats responsive design */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .stat-section {
    min-height: 380px;
    padding: 20px;
  }

  .chart-container {
    height: 320px;
    padding: 16px;
  }

  .years-section {
    grid-column: 1 / -1;
    min-height: 320px;
  }

  .record-labels-section {
    grid-column: 1 / -1;
    min-height: 320px;
  }
}

/* Medium screens - maintain 2 columns but adjust sizing */
@media (min-width: 769px) and (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .stat-section {
    min-height: 420px;
    padding: 20px;
  }

  .chart-container {
    height: 340px;
    padding: 16px;
  }

  .years-section {
    grid-column: 1 / -1;
    min-height: 360px;
  }

  .record-labels-section {
    grid-column: 1 / -1;
    min-height: 360px;
  }
}

/* ============= OVERLAY SECTIONS ============= */
.overlay-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

.overlay-content {
  background: var(--bg-color, #181818);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  width: 90%;
  max-width: 1200px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin: 20px;
  position: relative;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--accent-color);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
}

.overlay-header h2 {
  margin: 0;
  color: var(--accent-color);
  font-size: 1.4em;
  flex: 1;
}

.overlay-header .close-btn {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.overlay-header .close-btn:hover,
.close-btn:hover {
  background: var(--accent-color);
  color: #000;
}

.overlay-section .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px;
}

.stats-category {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 300px;
}

.stats-category h3 {
  margin: 0 0 12px 0;
  color: var(--accent-color);
  font-size: 1.1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

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

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.9em;
}

.stats-label {
  color: var(--text-color);
  opacity: 0.9;
}

.stats-value {
  color: var(--accent-color);
  font-weight: 600;
}

.duplicates-container {
  padding: 20px;
}

.stats-category .chart-container {
  flex: 1;
  position: relative;
  height: 300px;
  width: 100%;
  display: block;
}

.chart-container {
  flex: 1;
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container canvas {
  max-width: 100%;
  max-height: 100%;
}

.stats-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}

.overview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.overview-label {
  font-size: 0.9em;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 8px;
}

.overview-value {
  font-size: 1.5em;
  font-weight: 600;
  color: var(--accent-color);
}

/* Smart Playlist Preview Styles */
.preview-track-item {
  padding: 8px 12px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  border-left: 3px solid var(--accent-color);
  font-size: 0.9em;
}

.preview-artist {
  font-weight: 600;
  color: var(--accent-color);
}

.preview-title {
  color: var(--text-color);
}

.preview-details {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 0.85em;
}

.preview-more {
  text-align: center;
  font-style: italic;
  color: var(--text-color);
  opacity: 0.7;
  margin-top: 12px;
  padding: 8px;
}

/* Light mode adjustments */
body.light-mode .overlay-content {
  --bg-color: #f5f5f5;
}

body.light-mode .stats-category {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .close-btn:hover {
  color: #fff;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .overlay-content {
    width: 95%;
    max-width: calc(100vw - 20px);
    max-height: 90vh;
    margin: 10px;
  }

  .overlay-header {
    padding: 16px;
  }

  .overlay-header h2 {
    font-size: 1.2em;
  }
}

/* Additional centering improvements for very small screens */
@media (max-width: 480px) {
  .overlay-content {
    width: 98%;
    max-width: calc(100vw - 10px);
    max-height: 95vh;
    margin: 5px;
  }

  .overlay-header {
    padding: 12px;
  }

  .stats-grid {
    padding: 12px;
    gap: 12px;
  }

  .duplicates-container {
    padding: 12px;
  }
}

/* ============= TRACKLIST COMPARISON MODAL ============= */
.tracklist-compare-content {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
}

.compare-upload-section {
  margin: 20px 0;
}

.upload-dropzone {
  border: 2px dashed var(--accent-color);
  border-radius: 8px;
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--accent-color-alpha);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent-color-hover);
  background: var(--accent-color);
  background: rgba(var(--accent-color), 0.2);
}

.dropzone-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-color);
  margin: 0 0 10px 0;
}

.dropzone-hint {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.7;
  margin: 0;
}

.compare-results-section {
  margin-top: 20px;
}

.compare-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.compare-stat-card {
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.compare-stat-card.matched {
  border-color: #4ecdc4;
  background: rgba(78, 205, 196, 0.1);
}

.compare-stat-card.missing {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.compare-stat-card.percentage {
  border-color: var(--accent-color);
  background: var(--accent-color-alpha);
}

.compare-stat-card .stat-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.compare-stat-card.matched .stat-number {
  color: #4ecdc4;
}

.compare-stat-card.missing .stat-number {
  color: #ff6b6b;
}

.compare-stat-card .stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
}

.compare-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.compare-tab {
  background: transparent;
  border: none;
  color: var(--text-color);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px 6px 0 0;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.compare-tab:hover {
  opacity: 0.9;
  background: var(--accent-color-alpha);
}

.compare-tab.active {
  opacity: 1;
  color: var(--accent-color);
  background: var(--accent-color-alpha);
  border-bottom: 3px solid var(--accent-color);
}

.compare-tracks-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  background: var(--input-bg);
}

.compare-track-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: var(--bg-color, #222);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.compare-track-item:hover {
  border-color: var(--accent-color);
  transform: translateX(5px);
}

.compare-track-item.matched {
  border-left: 4px solid #4ecdc4;
  background: rgba(78, 205, 196, 0.05);
}

.compare-track-item.missing {
  border-left: 4px solid #ff6b6b;
  background: rgba(255, 107, 107, 0.05);
}

.compare-track-item .track-status {
  font-size: 1.5rem;
  line-height: 1;
}

.compare-track-item .track-details {
  flex: 1;
}

.compare-track-item .track-main {
  font-size: 1rem;
  margin-bottom: 8px;
}

.compare-track-item .track-artist {
  font-weight: 600;
  color: var(--accent-color);
}

.compare-track-item .track-separator {
  margin: 0 8px;
  opacity: 0.5;
}

.compare-track-item .track-title {
  color: var(--text-color);
}

.compare-track-item .track-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 8px;
}

.compare-track-item .track-bpm,
.compare-track-item .track-key,
.compare-track-item .track-label {
  padding: 2px 8px;
  background: var(--input-bg);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.compare-track-item .match-info {
  margin-top: 10px;
  padding: 10px;
  background: rgba(78, 205, 196, 0.1);
  border-left: 3px solid #4ecdc4;
  border-radius: 4px;
  font-size: 0.9rem;
}

.compare-track-item .match-info.low-confidence {
  background: rgba(255, 159, 67, 0.1);
  border-left-color: #ff9f43;
}

.compare-track-item .match-label {
  font-weight: 600;
  margin-right: 8px;
  color: var(--text-color);
  opacity: 0.8;
}

.compare-track-item .match-track {
  color: var(--text-color);
}

.compare-track-item .match-confidence {
  margin-left: 10px;
  padding: 2px 8px;
  background: #4ecdc4;
  color: #000;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

.compare-export-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.compare-export-buttons .control-btn {
  flex: 1;
  min-width: 200px;
}

.no-tracks {
  text-align: center;
  padding: 40px;
  color: var(--text-color);
  opacity: 0.5;
  font-style: italic;
}

/* Light mode adjustments */
body.light-mode .compare-track-item {
  background: #fff;
}

body.light-mode .compare-stat-card {
  background: #fff;
}

body.light-mode .upload-dropzone {
  background: rgba(var(--accent-color), 0.05);
}

/* Scrollbar styling for compare tracks list */
.compare-tracks-list::-webkit-scrollbar {
  width: 10px;
}

.compare-tracks-list::-webkit-scrollbar-track {
  background: var(--input-bg);
  border-radius: 8px;
}

.compare-tracks-list::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 8px;
}

.compare-tracks-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color-hover);
}

/* Responsive design */
@media (max-width: 768px) {
  .compare-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .compare-tabs {
    flex-direction: column;
    gap: 5px;
  }

  .compare-export-buttons {
    flex-direction: column;
  }

  .compare-export-buttons .control-btn {
    min-width: 100%;
  }
}
