/* ============================================================
   FFP MUSIC – Main Stylesheet (Updated & Optimized v2.0)
   ============================================================ */

/* --- VARIABLES & RESET --- */
:root {
  /* Palette */
  --bg: #0f161c;
  --bg-soft: #141d26;
  --panel: #18232d;
  --panel-2: #1e2b38;
  --line: #2d3e4d;
  --line-soft: #23323f;
  
  /* Text */
  --text: #f0f6fa;
  --text-muted: #94a8b8;
  
  /* Accents */
  --blue: #259fd9;
  --blue-bright: #6bc9ff;
  --blue-dark: #156a99;
  --danger: #e55c5c;
  --success: #22c55e;
  --warning: #f59e0b;
  
  /* Effects */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.3);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-full: 9999px;
  
  /* Layout */
  --nav-height: 70px;
  --container-width: 1320px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at top center, #1a2b37 0%, var(--bg) 45%, #0b1116 100%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  padding-bottom: 94px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
img { max-width: 100%; display: block; }

/* Focus States for Accessibility */
:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

/* --- TOPBAR --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  border-bottom: 1px solid var(--line);
  background: rgba(15, 22, 28, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-inner {
  width: min(var(--container-width), calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand img { height: 32px; width: 32px; border-radius: 50%; object-fit: cover; }

.navigation { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.navigation a {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.navigation a:hover, .navigation a.active { color: #fff; border-bottom-color: var(--blue); }

.header-search { position: relative; width: min(340px, 26vw); margin-left: auto; }
.header-search input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 159, 217, 0.15); outline: none; }
.search-icon { position: absolute; top: 9px; right: 12px; color: var(--blue-bright); pointer-events: none; }

.upload-top {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--blue);
  min-height: 40px;
  transition: background 0.2s, transform 0.1s;
}
.upload-top:hover { background: var(--blue-bright); color: #0f161c; }
.upload-top:active { transform: scale(0.98); }

.admin-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--blue-bright); }

.cart-badge {
  position: relative;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  border-bottom: 2px solid transparent;
}
.cart-badge:hover { color: #fff; border-bottom-color: var(--blue); }
.cart-badge .count {
  position: absolute;
  top: 4px;
  right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

/* --- LAYOUT & HERO --- */
.layout {
  width: min(var(--container-width), calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  padding: 28px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, rgba(15, 29, 39, 0.98), rgba(28, 75, 99, 0.8)), var(--panel);
  box-shadow: var(--shadow-lg);
}
.hero.has-admin-cover { background: linear-gradient(100deg, rgba(15, 29, 39, 0.7), rgba(28, 75, 99, 0.5)), url('') center/cover no-repeat; }
.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -100px;
  width: 340px;
  height: 340px;
  border: 40px solid rgba(107, 201, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 620px; }
.eyebrow { margin-bottom: 8px; color: var(--blue-bright); font-size: 11px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.5px; line-height: 1.2; }
.hero p { max-width: 560px; margin: 10px 0 20px; color: #bfd3df; line-height: 1.6; }

.hero-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.button-primary, .button-secondary {
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.button-primary { border: 1px solid var(--blue); color: #fff; background: var(--blue); }
.button-secondary { border: 1px solid var(--line); color: #dbeaf2; background: rgba(255,255,255,0.03); }
.button-primary:hover { background: var(--blue-bright); border-color: var(--blue-bright); color: #0f161c; }
.button-secondary:hover { border-color: var(--blue-bright); color: #fff; background: rgba(255,255,255,0.06); }

.status-strip { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.status-strip span {
  padding: 6px 12px;
  border: 1px solid rgba(143, 199, 226, 0.2);
  border-radius: var(--radius-full);
  color: #c5dce8;
  background: rgba(4, 15, 22, 0.3);
  font-size: 11px;
  font-weight: 600;
}

/* --- FEED TOOLBAR --- */
.feed-toolbar {
  margin-top: 24px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-button {
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  transition: all 0.2s;
}
.filter-button.active, .filter-button:hover { border-color: var(--blue); color: #fff; background: rgba(37, 159, 217, 0.1); }
.feed-total { color: var(--text-muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- ALERTS & LOGIN --- */
.flash, .error-box, .login-box { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-md); line-height: 1.5; }
.flash { border: 1px solid rgba(37, 159, 217, 0.4); color: #d9f3ff; background: rgba(37, 159, 217, 0.1); }
.error-box { border: 1px solid rgba(229, 92, 92, 0.4); color: #ffd1d1; background: rgba(229, 92, 92, 0.1); }
.error-box ul { margin: 0; padding-left: 18px; }
.login-box { border: 1px solid var(--line); background: var(--panel); text-align: center; }
.login-box form { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.login-box input[type=text], .login-box input[type=password] {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: #fff;
  min-height: 40px;
}
.login-box button {
  padding: 8px 20px;
  background: var(--blue);
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}
.login-box button:hover { background: var(--blue-bright); color: #0f161c; }

/* --- TRACKS LIST --- */
.tracks-list { margin-top: 16px; border-top: 1px solid var(--line-soft); }
.track-card {
  position: relative;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.2s ease;
}
.track-card.is-highlighted {
  margin: 0 -12px;
  padding: 18px 12px;
  border-radius: var(--radius-md);
  background: rgba(37, 159, 217, 0.08);
  box-shadow: inset 3px 0 0 var(--blue);
}
.track-card.is-hidden { display: none; }

.track-main {
  display: grid;
  grid-template-columns: 112px 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.cover, .cover-placeholder { width: 112px; height: 112px; border-radius: var(--radius-sm); object-fit: cover; background: var(--panel-2); }
.cover-placeholder {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #dff4ff;
  text-align: center;
  background: linear-gradient(140deg, rgba(121, 213, 255, 0.2), transparent 60%), var(--panel-2);
}
.cover-placeholder::after {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  border: 12px solid rgba(126, 218, 255, 0.12);
  border-radius: 50%;
}
.cover-placeholder b { font-size: 18px; letter-spacing: 1px; position: relative; z-index: 1; }
.cover-placeholder small { margin-top: 4px; color: var(--text-muted); font-size: 9px; letter-spacing: 1px; position: relative; z-index: 1; text-transform: uppercase; }

.play-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: transparent;
  transition: all 0.2s ease;
}
.play-button:hover, .track-card.is-playing .play-button {
  border-color: var(--blue-bright);
  color: var(--blue-bright);
  background: rgba(37, 159, 217, 0.12);
}
.play-button svg { width: 18px; height: 18px; margin-left: 2px; fill: currentColor; }

.track-info { min-width: 0; }
.track-title {
  display: inline-block;
  max-width: 100%;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.2);
  text-underline-offset: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: text-decoration-color 0.2s;
}
.track-title:hover, .artist:hover { color: var(--blue-bright); text-decoration-color: var(--blue-bright); }
.artist { display: inline-block; margin-top: 4px; color: var(--text-muted); font-size: 13px; }

.track-badges { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: var(--bg-soft);
  font-size: 10px;
  font-weight: 600;
}
.badge.blue { border-color: rgba(37, 159, 217, 0.4); color: var(--blue-bright); background: rgba(37, 159, 217, 0.1); }

.track-meta { min-width: 135px; color: var(--text-muted); text-align: right; font-size: 11px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.track-meta strong { display: block; color: var(--text); font-weight: 600; }

.wave-row { margin: 14px 0 0 126px; display: flex; align-items: flex-end; gap: 10px; }
.waveform {
  position: relative;
  height: 38px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.waveform i {
  position: relative;
  z-index: 1;
  min-width: 2px;
  flex: 1;
  display: block;
  border-radius: 1px 1px 0 0;
  background: var(--text-muted);
  opacity: 0.5;
  transition: background 0.15s ease, opacity 0.15s;
}
.waveform:hover i, .track-card.is-playing .waveform i { background: var(--blue-bright); opacity: 1; }
.wave-progress {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 100%;
  pointer-events: none;
  border-right: 2px solid var(--blue-bright);
  background: linear-gradient(90deg, rgba(37, 159, 217, 0.25), rgba(107, 201, 255, 0.05));
}
.duration {
  min-width: 40px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-align: center;
  font-size: 10px;
  font-weight: 600;
}

.track-actions { margin: 12px 0 0 126px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.track-note { max-width: 55%; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

.small-button {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg-soft);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
}
.small-button:hover { border-color: var(--blue); color: #fff; background: var(--panel-2); }

.buy-button { background: var(--success); border-color: var(--success); color: #fff; }
.buy-button:hover { background: #16a34a; border-color: #16a34a; }
.cart-add-button { background: var(--warning); border-color: var(--warning); color: #000; }
.cart-add-button:hover { background: #d97706; border-color: #d97706; }
.download-button { background: var(--danger); border-color: var(--danger); color: #fff; }
.download-button:hover { background: #dc2626; border-color: #dc2626; }

.empty-state {
  margin-top: 16px;
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
  background: var(--bg-soft);
}
.empty-state h2 { margin: 0 0 8px; color: var(--text); font-size: 18px; }

/* --- SIDEBAR --- */
.sidebar-card {
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}
.sidebar-title {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}
.sidebar-title h2 { margin: 0; font-size: 15px; font-weight: 700; }
.sidebar-title span { color: var(--blue-bright); font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }

.chart-list { margin: 0; padding: 0; list-style: none; }
.chart-list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); transition: background 0.15s; }
.chart-list li:last-child { border-bottom: 0; }
.chart-list li:hover { background: rgba(255,255,255,0.02); }
.chart-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}
.chart-track { min-width: 0; }
.chart-track b, .chart-track small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-track b { color: var(--text); font-size: 12px; font-weight: 600; }
.chart-track small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }

.standards { padding: 16px; }
.standard-row {
  padding: 10px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.standard-row:last-child { border-bottom: 0; }
.standard-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  border-radius: 50%;
  color: var(--blue-bright);
  font-size: 10px;
  background: rgba(37, 159, 217, 0.15);
}

/* --- MODALS --- */
.upload-modal, .share-modal, .admin-modal, .edit-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 9, 13, 0.8);
  backdrop-filter: blur(6px);
}
.upload-modal.open, .share-modal.open, .admin-modal.open, .edit-modal.open { display: flex; }

.modal-panel {
  width: min(670px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--bg-soft); color: #fff; border-color: var(--text-muted); }

.upload-form, .share-content, .admin-content, .edit-content { padding: 20px; }
.admin-content .admin-image-preview { margin: 10px 0; max-width: 100%; border-radius: var(--radius-md); }
.admin-content .admin-image-preview img { max-width: 100%; max-height: 200px; border-radius: var(--radius-md); border: 1px solid var(--line); }

.upload-kind-switch { margin-bottom: 18px; display: flex; gap: 8px; }
.kind-switch {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 700;
  min-height: 40px;
  transition: all 0.2s;
}
.kind-switch.active { border-color: var(--blue); color: #fff; background: rgba(37, 159, 217, 0.15); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { margin-bottom: 6px; display: block; color: var(--text-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input, .field select { height: 40px; padding: 0 12px; }
.field textarea { min-height: 80px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 159, 217, 0.15); outline: none; }

.file-field { padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius-md); background: var(--bg-soft); transition: border-color 0.2s; }
.file-field:hover { border-color: var(--blue); }
.file-field input { height: auto; padding: 0; border: 0; background: transparent; }
.file-hint { margin-top: 8px; color: var(--text-muted); font-size: 11px; line-height: 1.4; }

.rights { margin-top: 18px; display: flex; gap: 10px; color: var(--text-muted); font-size: 12px; line-height: 1.4; align-items: flex-start; }
.rights input { margin-top: 3px; accent-color: var(--blue); min-width: 16px; min-height: 16px; cursor: pointer; }

.form-submit-row { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.share-content p { margin: 0 0 16px; color: var(--text-muted); line-height: 1.5; }
.share-field { margin-bottom: 16px; }
.share-field label { margin-bottom: 6px; display: block; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.copy-row { display: flex; gap: 8px; }
.copy-row input, .copy-row textarea {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--bg);
  font-size: 11px;
  font-family: monospace;
}
.copy-row textarea { min-height: 64px; resize: vertical; }
.copy-button {
  min-width: 70px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 700;
  min-height: 40px;
  transition: background 0.2s;
}
.copy-button:hover { background: var(--blue-bright); color: #0f161c; }
.native-share {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #fff;
  background: var(--blue);
  font-weight: 700;
  transition: background 0.2s;
}
.native-share:hover { background: var(--blue-bright); color: #0f161c; }

/* --- PLAYER BAR --- */
.player-bar {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 78px;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
  background: rgba(15, 22, 28, 0.96);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}
.player-inner {
  width: min(var(--container-width), calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(160px, 260px) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 16px;
}
.player-controls { display: flex; align-items: center; gap: 6px; }
.player-control {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.player-control:hover { border-color: var(--line); color: var(--blue-bright); background: var(--bg-soft); }
.player-main-button { border: 1px solid var(--blue); color: #fff; background: var(--blue); min-height: 44px; min-width: 44px; border-radius: 50%; }
.player-main-button:hover { background: var(--blue-bright); border-color: var(--blue-bright); color: #0f161c; }

.now-playing { min-width: 0; }
.now-playing b, .now-playing span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing b { color: var(--text); font-size: 12px; font-weight: 600; }
.now-playing span { margin-top: 3px; color: var(--text-muted); font-size: 11px; }

.player-progress { height: 4px; overflow: hidden; border-radius: var(--radius-full); background: var(--line-soft); cursor: pointer; }
.player-progress-inner { width: 0%; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-bright)); border-radius: var(--radius-full); }
.player-time { color: var(--text-muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --- CART SIDEBAR --- */
.cart-sidebar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.85rem;
}
.cart-sidebar-item:last-child { border-bottom: 0; }
.cart-sidebar-item .item-info { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cart-sidebar-item .item-qty { color: var(--text-muted); margin: 0 8px; font-size: 0.8rem; }
.cart-sidebar-item .item-price { color: var(--danger); font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.cart-sidebar-item .item-remove {
  color: var(--text-muted);
  margin-left: 6px;
  font-size: 0.8rem;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  background: transparent;
  border: none;
  cursor: pointer;
}
.cart-sidebar-item .item-remove:hover { color: var(--danger); background: rgba(229, 92, 92, 0.1); }

.cart-sidebar-total {
  padding: 12px 0 8px;
  font-weight: 700;
  font-size: 1rem;
  text-align: right;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.cart-sidebar-total span { color: var(--danger); }
.cart-sidebar-empty { color: var(--text-muted); font-size: 0.9rem; padding: 12px 0; text-align: center; }
.cart-sidebar-checkout {
  display: block;
  text-align: center;
  background: var(--danger);
  color: #fff;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  margin-top: 10px;
  transition: background 0.2s, transform 0.1s;
}
.cart-sidebar-checkout:hover { background: #dc2626; }
.cart-sidebar-checkout:active { transform: scale(0.98); }

/* --- DROPDOWN --- */
.dropdown { position: relative; display: inline-block; }
.dropdown > a { cursor: pointer; }
.dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 0;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.dropdown .dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: none;
}
.dropdown .dropdown-menu a:hover { background: rgba(37, 159, 217, 0.1); color: #fff; }
.dropdown .dropdown-menu .divider { height: 1px; background: var(--line-soft); margin: 4px 12px; }
.dropdown:hover .dropdown-menu, .dropdown.show .dropdown-menu { display: block; }

/* --- TOAST --- */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--panel);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.toast svg { width: 20px; height: 20px; color: var(--success); flex-shrink: 0; }
.toast.error { border-color: rgba(229, 92, 92, 0.4); }
.toast.error svg { color: var(--danger); }

/* --- RESPONSIVE --- */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .sidebar-card { margin-bottom: 0; }
  .header-search { width: 250px; }
}

@media (max-width: 820px) {
  .topbar-inner { gap: 14px; flex-wrap: wrap; }
  .navigation a { font-size: 12px; }
  .header-search { width: 200px; }
  .hero { min-height: 140px; padding: 20px; }
  .hero h1 { font-size: 22px; }
  .hero p { margin: 6px 0 14px; }
  .hero-buttons .button-primary, .hero-buttons .button-secondary { font-size: 11px; min-height: 36px; }
  .status-strip span { font-size: 10px; padding: 5px 8px; }
  
  .track-main { grid-template-columns: 76px 42px minmax(0, 1fr); gap: 10px; }
  .cover, .cover-placeholder { width: 76px; height: 76px; }
  .cover-placeholder b { font-size: 14px; }
  .play-button { width: 42px; height: 42px; }
  .track-meta { display: none; }
  .track-title { font-size: 14px; }
  .wave-row, .track-actions { margin-left: 0; }
  .track-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .track-note { max-width: 100%; white-space: normal; overflow: visible; }
  .action-buttons { justify-content: flex-start; gap: 8px; }
  .action-buttons .small-button { flex: 1 1 auto; min-height: 38px; justify-content: center; }
  
  .sidebar { grid-template-columns: 1fr; }
  .feed-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .feed-total { text-align: center; }
  .filters { justify-content: center; }
  .filter-button { font-size: 10px; padding: 6px 8px; }
  
  .dropdown .dropdown-menu { position: static; background: transparent; border: none; box-shadow: none; padding-left: 12px; }
  .dropdown .dropdown-menu a { padding: 6px 12px; font-size: 12px; border-left: 2px solid var(--line); border-radius: 0; }
  .dropdown .dropdown-menu .divider { display: none; }
}

@media (max-width: 600px) {
  body { padding-bottom: 118px; }
  .topbar-inner { width: 100%; padding: 0 12px; gap: 8px; }
  .brand { font-size: 16px; }
  .brand img { height: 26px; width: 26px; }
  .navigation { gap: 8px; flex-wrap: wrap; }
  .navigation a { font-size: 11px; padding: 4px 0; }
  .header-search { display: none; }
  .upload-top { margin-left: auto; padding: 8px 10px; font-size: 10px; min-height: 34px; }
  .admin-avatar { width: 28px; height: 28px; }
  
  .layout { width: 100%; padding: 0 12px; margin-top: 12px; }
  .hero { min-height: 120px; padding: 16px; border-radius: var(--radius-md); }
  .hero h1 { font-size: 18px; }
  .hero p { font-size: 13px; margin: 4px 0 12px; }
  .hero-buttons .button-primary, .hero-buttons .button-secondary { font-size: 10px; padding: 0 10px; min-height: 32px; }
  .status-strip { gap: 4px; margin-top: 10px; }
  .status-strip span { font-size: 9px; padding: 4px 6px; }
  
  .feed-toolbar { padding: 10px 12px; }
  .filter-button { font-size: 9px; padding: 4px 6px; }
  
  .track-card { padding: 12px 0 10px; }
  .track-main { grid-template-columns: 56px 34px minmax(0, 1fr); gap: 8px; }
  .cover, .cover-placeholder { width: 56px; height: 56px; }
  .cover-placeholder b { font-size: 12px; }
  .cover-placeholder small { font-size: 7px; }
  .play-button { width: 34px; height: 34px; }
  .play-button svg { width: 14px; height: 14px; }
  .track-title { font-size: 13px; }
  .artist { font-size: 11px; margin-top: 2px; }
  .track-badges { margin-top: 4px; gap: 4px; }
  .badge { font-size: 8px; padding: 2px 5px; }
  
  .wave-row { margin-top: 8px; height: 28px; }
  .waveform { height: 28px; }
  .duration { font-size: 9px; padding: 3px 4px; min-width: 32px; }
  .track-actions { margin-top: 6px; gap: 6px; }
  .track-note { font-size: 10px; }
  .action-buttons .small-button { font-size: 10px; min-height: 32px; padding: 0 8px; }
  
  .upload-modal, .share-modal, .admin-modal, .edit-modal { padding: 10px; }
  .modal-panel { width: 100%; max-height: calc(100vh - 20px); border-radius: var(--radius-md); }
  .modal-header { padding: 12px 14px; }
  .modal-header h2 { font-size: 16px; }
  .modal-close { width: 28px; height: 28px; font-size: 16px; }
  .upload-form, .share-content, .admin-content, .edit-content { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .form-grid .full { grid-column: auto; }
  .field input, .field select { height: 36px; font-size: 13px; }
  .field textarea { min-height: 60px; }
  .upload-kind-switch { flex-wrap: wrap; }
  .kind-switch { flex: 1 1 auto; text-align: center; font-size: 11px; padding: 8px 10px; }
  .copy-row { flex-wrap: wrap; }
  .copy-button { min-height: 36px; min-width: 56px; font-size: 10px; }
  .rights { font-size: 11px; }
  .form-submit-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .form-submit-row button { width: 100%; min-height: 40px; }
  .login-box form { flex-direction: column; width: 100%; }
  .login-box input, .login-box button { width: 100%; }
  
  .player-inner { width: 100%; padding: 0 10px; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .player-progress { display: none; }
  .player-controls .player-control:not(.player-main-button) { display: none; }
  .player-main-button { min-width: 44px; min-height: 44px; }
  .now-playing b { font-size: 11px; }
  .now-playing span { font-size: 10px; }
  .player-time { font-size: 10px; }
}

@media (max-width: 400px) {
  .track-main { grid-template-columns: 48px 28px minmax(0, 1fr); gap: 6px; }
  .cover, .cover-placeholder { width: 48px; height: 48px; }
  .play-button { width: 28px; height: 28px; }
  .play-button svg { width: 12px; height: 12px; }
  .track-title { font-size: 12px; }
  .artist { font-size: 10px; }
  .badge { font-size: 7px; padding: 1px 4px; }
  .action-buttons .small-button { font-size: 9px; min-height: 28px; padding: 0 6px; }
  .upload-top { font-size: 9px; padding: 6px 8px; }
  .brand { font-size: 14px; }
  .brand img { height: 22px; width: 22px; }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}