@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --bg: #030508;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-bright: rgba(255, 255, 255, 0.22);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.18);
  --inst-vocals: #38bdf8;
  --inst-bass: #4ade80;
  --inst-guitar: #facc15;
  --inst-drums: #f87171;
  --radius: 22px;
  --radius-sm: 14px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow: hidden;
}

h1, h2, h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 10% 15%, rgba(56, 189, 248, 0.1), transparent 55%),
    radial-gradient(ellipse 65% 45% at 90% 80%, rgba(255, 255, 255, 0.05), transparent 50%),
    radial-gradient(ellipse 50% 35% at 50% 100%, rgba(250, 204, 21, 0.06), transparent 45%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: drift 30s ease-in-out infinite alternate;
}

.orb-1 {
  width: 380px;
  height: 380px;
  background: rgba(56, 189, 248, 0.18);
  top: -100px;
  left: -60px;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: rgba(255, 255, 255, 0.06);
  bottom: -80px;
  right: 8%;
  animation-delay: -10s;
}

.orb-3 {
  width: 260px;
  height: 260px;
  background: rgba(250, 204, 21, 0.08);
  top: 45%;
  right: -40px;
  animation-delay: -18s;
}

@keyframes drift {
  to { transform: translate(24px, 32px) scale(1.06); }
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.glass-strong {
  background: var(--glass-strong);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--glass-border-bright);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.container {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 12px;
}

.app-header {
  position: relative;
  top: 0;
  z-index: 50;
  margin: 12px 0 12px;
  padding: 14px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.04em;
}

.brand h1 {
  font-size: 17px;
}

.brand p {
  font-size: 11px;
  color: var(--muted);
}

.lang-switch {
  display: flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  transition: 0.15s ease;
}

.lang-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
  color: #bae6fd;
  background: var(--accent-soft);
}

.header-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

/* ── Ana düzen: sol mix, sağ kütüphane ── */
.main-split {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.mix-column {
  flex: 0 0 48%;
  width: 48%;
  max-width: 48%;
}

.library-column {
  flex: 1 1 52%;
  width: 52%;
  min-width: 0;
}

.mix-column,
.library-column {
  padding: 20px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.column-head {
  margin-bottom: 14px;
  flex-shrink: 0;
}

.column-head h3 {
  font-size: 20px;
}

.column-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.mix-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mix-toolbar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bpm-range {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}

.bpm-range-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.bpm-range-head strong {
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.bpm-range-sliders {
  display: grid;
  gap: 8px;
}

.bpm-range-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
}

.bpm-range-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bpm-range-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.mix-stats-row,
.library-stats-row {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.library-stats-row {
  flex: 1;
  min-width: 0;
}

.library-stats-row .mini-stat {
  min-width: 0;
}

.mini-stat {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.mini-stat strong {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.btn {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--glass-border-bright);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-primary {
  background: var(--accent-soft);
  border-color: rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.btn-primary:hover {
  background: rgba(56, 189, 248, 0.28);
}

.mix-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  justify-content: flex-start;
}

.mix-export-target {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: auto;
  overflow: visible;
  background: #0c0f14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 14px;
}

.mix-export-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.65);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.btn-download {
  margin-top: 14px;
  flex-shrink: 0;
  width: 100%;
}

.mix-panel.hidden { display: none; }

.mix-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.mix-head h4 {
  font-size: 20px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

.mix-head p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.mix-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.mix-slots {
  display: grid;
  gap: 10px;
  overflow: visible;
  flex: 0 0 auto;
  min-height: auto;
  align-content: start;
}

.mix-slot {
  display: grid;
  grid-template-columns: auto 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.mix-slot-card {
  background: #161b24;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mix-slot .cover {
  width: 48px;
  height: 48px;
}

.inst-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  min-width: 108px;
}

.inst-chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.inst-chip span {
  font-size: 12px;
  font-weight: 600;
}

.inst-chip[data-inst="vocals"] { border-color: color-mix(in srgb, var(--inst-vocals) 35%, var(--glass-border)); }
.inst-chip[data-inst="bass"] { border-color: color-mix(in srgb, var(--inst-bass) 35%, var(--glass-border)); }
.inst-chip[data-inst="guitar"] { border-color: color-mix(in srgb, var(--inst-guitar) 35%, var(--glass-border)); }
.inst-chip[data-inst="drums"] { border-color: color-mix(in srgb, var(--inst-drums) 35%, var(--glass-border)); }

.cover {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
}

.track-meta h4 {
  font-size: 15px;
  margin-bottom: 2px;
}

.track-meta p {
  font-size: 12px;
  color: var(--muted);
}

.track-meta .mini {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  margin-bottom: 6px;
}

.library-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.library-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-shrink: 0;
}

.select-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}

.select-mode-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.library-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

.track-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: auto 52px 1fr;
  gap: 10px;
  align-items: center;
  transition: 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.track-card.selected {
  border-color: rgba(56, 189, 248, 0.28);
}

.track-card:hover {
  border-color: var(--glass-border-bright);
}

.track-card.selected:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.track-card .cover {
  width: 52px;
  height: 52px;
}

.track-check {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.track-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.track-card-body h4 {
  font-size: 13px;
  margin-bottom: 2px;
}

.track-card-body p {
  font-size: 11px;
  color: var(--muted);
}

.search {
  width: min(220px, 100%);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  align-self: center;
  flex-shrink: 0;
}

.hidden { display: none !important; }

@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  .container {
    height: auto;
    min-height: 100vh;
  }

  .main-split {
    flex-direction: column;
    overflow: visible;
  }

  .mix-column,
  .library-column {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    min-height: 360px;
  }

  .track-grid {
    max-height: 420px;
  }
}

.loading-inline,
.error-banner {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.loading-inline {
  color: var(--muted);
  border: 1px dashed var(--glass-border);
}

.error-banner {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
  flex-shrink: 0;
}

.track-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  align-content: start;
}

/* İç kaydırma çubukları */
.track-grid::-webkit-scrollbar,
.mix-slots::-webkit-scrollbar {
  width: 6px;
}

.track-grid::-webkit-scrollbar-track,
.mix-slots::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.track-grid::-webkit-scrollbar-thumb,
.mix-slots::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.track-grid::-webkit-scrollbar-thumb:hover,
.mix-slots::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 820px) {
  .app-header {
    flex-wrap: wrap;
  }

  .header-meta {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }

  .mix-toolbar {
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .btn {
    flex: 1;
  }

  .mix-slot {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .inst-chip {
    width: fit-content;
  }
}
