/* ==========================================================================
   Minimal Black & White Sound Effects Vault
   Featuring Plus Jakarta Sans & Aesthetic Category Cards
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #09090b;
  --bg-card: #121215;
  --bg-hover: #1c1c21;
  --bg-input: #151518;
  --border: #27272a;
  --border-subtle: #1e1e24;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #ffffff;
  --accent-contrast: #000000;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-card: #f9fafb;
  --bg-hover: #f3f4f6;
  --bg-input: #f3f4f6;
  --border: #e5e7eb;
  --border-subtle: #f0f1f3;
  --text: #09090b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #09090b;
  --accent-contrast: #ffffff;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 96px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

input, select {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* Container */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   TOP NAVIGATION & PRIMARY SEARCH BAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.navbar .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.03em;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumbs .sep {
  color: var(--text-dim);
}

.breadcrumbs .current {
  color: var(--text);
  font-weight: 600;
}

/* Unified Top Search Bar */
.nav-search {
  flex: 1;
  max-width: 520px;
  margin: 0 16px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  transition: all 0.15s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.search-input-wrap svg.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  margin-right: 10px;
  flex-shrink: 0;
}

.search-input-wrap input {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
}

.search-input-wrap input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.clear-search-btn {
  color: var(--text-dim);
  font-size: 12px;
  padding: 2px 6px;
  cursor: pointer;
  display: none;
}

.clear-search-btn.show {
  display: block;
}

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

.kbd {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg);
  transition: all 0.15s ease;
}

.btn-pill:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-pill.primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  font-weight: 700;
}

.btn-pill.primary:hover {
  opacity: 0.9;
}

/* ==========================================================================
   HEADER & TABS
   ========================================================================== */
.header-section {
  padding: 28px 0 16px;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-top: 20px;
  padding-bottom: 12px;
}

.tabs-left {
  display: flex;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

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

.tab.active {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
}

.tab-count {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

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

/* ==========================================================================
   AESTHETIC CATEGORY CAROUSEL (IMAGE CARDS)
   ========================================================================== */
.carousel-wrap {
  position: relative;
  margin-top: 18px;
}

.carousel-bar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 2px 14px;
}

.carousel-bar::-webkit-scrollbar {
  display: none;
}

.cat-card {
  flex: 0 0 156px;
  height: 114px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  background: var(--bg-card);
}

.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--text-muted);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.cat-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.cat-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  filter: brightness(0.88) contrast(1.05);
}

.cat-card:hover .cat-card-img {
  transform: scale(1.06);
}

.cat-card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.88) 100%);
  pointer-events: none;
}

.cat-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-card-icon {
  width: 18px;
  height: 18px;
  color: #ffffff;
  display: grid;
  place-items: center;
}

.cat-card-icon svg {
  width: 15px;
  height: 15px;
}

.cat-card-count {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.cat-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   FILTER CHIPS & SORTING ROW (NO SECOND SEARCH BAR)
   ========================================================================== */
.filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 20px;
  flex-wrap: wrap;
}

.filters-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.filter-chip.active {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.filters-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-clean {
  height: 36px;
  padding: 0 32px 0 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-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='%23888888' 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: 14px;
}

.select-clean option {
  background: var(--bg-card);
  color: var(--text);
}

.active-filter-indicator {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-filter-indicator strong {
  color: var(--text);
}

/* ==========================================================================
   SFX TABLE
   ========================================================================== */
.table-header {
  display: grid;
  grid-template-columns: 1fr 100px 100px 120px;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.table-header .align-right {
  text-align: right;
}

.sfx-list {
  display: flex;
  flex-direction: column;
}

.sfx-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 120px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}

.sfx-row:hover {
  background: var(--bg-hover);
}

.sfx-row.playing {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent);
}

/* Description Column */
.desc-col {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-right: 18px;
}

.play-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.play-btn:hover {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  transform: scale(1.05);
}

.sfx-row.playing .play-btn {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.play-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

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

.title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.title-text:hover {
  text-decoration: underline;
}

.loop-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.meta-line {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Waveform Canvas */
.waveform-box {
  margin-top: 6px;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  max-width: 460px;
}

.wave-bar {
  flex: 1;
  min-width: 2px;
  max-width: 4px;
  background: var(--border);
  border-radius: 1px;
  transition: background 0.1s ease;
}

.sfx-row:hover .wave-bar {
  background: var(--text-dim);
}

.wave-bar.passed {
  background: var(--text);
}

.col-duration, .col-downloads {
  text-align: right;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  transition: all 0.12s ease;
}

.action-btn:hover {
  color: var(--text);
  background: var(--border);
}

.action-btn.active {
  color: var(--accent);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.key-tag {
  font-size: 10px;
  font-family: inherit;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* Empty State */
.empty-box {
  text-align: center;
  padding: 56px 16px;
  color: var(--text-muted);
}

/* ==========================================================================
   SOUNDBOARD GRID
   ========================================================================== */
.soundboard-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding: 20px 0;
}

.soundboard-grid.active {
  display: grid;
}

.pad {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.pad:hover {
  border-color: var(--text-muted);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.pad:active, .pad.hit {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
  transform: scale(0.97);
}

.pad-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pad-hotkey {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.pad.hit .pad-hotkey {
  border-color: var(--accent-contrast);
}

.pad-cat {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.pad.hit .pad-cat {
  color: var(--accent-contrast);
}

.pad-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pad-dur {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.pad.hit .pad-dur {
  color: var(--accent-contrast);
}

/* ==========================================================================
   STICKY BOTTOM AUDIO PLAYER
   ========================================================================== */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.player-bar.active {
  transform: translateY(0);
}

.player-track {
  min-width: 200px;
  max-width: 300px;
}

.player-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-cat {
  font-size: 12px;
  color: var(--text-dim);
}

.player-controls {
  flex: 1;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.player-btns {
  display: flex;
  align-items: center;
  gap: 16px;
}

.player-btn {
  color: var(--text-muted);
  transition: color 0.12s ease;
}

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

.main-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  display: grid;
  place-items: center;
  transition: transform 0.12s ease;
}

.main-play-btn:hover {
  transform: scale(1.08);
}

.main-play-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.scrub-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-num {
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 600;
  min-width: 32px;
}

.time-num.cur {
  text-align: right;
}

.progress-track {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
}

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

.vol-slider {
  width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
  height: 4px;
}

/* ==========================================================================
   UPLOAD MODAL & TOAST
   ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-mask.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
}

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

.drop-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.drop-area:hover, .drop-area.dragover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.toast-box {
  position: fixed;
  top: 68px;
  right: 24px;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: fadeIn 0.2s ease;
}

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

@media (max-width: 768px) {
  .nav-search { display: none; }
  .table-header { grid-template-columns: 1fr 60px 40px; }
  .table-header .col-downloads { display: none; }
  .sfx-row { grid-template-columns: 1fr 60px 40px; }
  .col-downloads { display: none; }
  .player-bar { padding: 10px 16px; flex-direction: column; gap: 8px; }
  .player-track { max-width: 100%; width: 100%; }
  .player-extra { display: none; }
}
