/* ═══════════════════════════════════════════════════════════ */
/* Audio Upload + Library pages                                */
/* ═══════════════════════════════════════════════════════════ */

/* Upload Page */
.upload-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}
.upload-hero {
  margin-bottom: 28px;
}
.upload-hero h1 {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}
.upload-hero p {
  color: var(--text-secondary);
  font-size: .92rem;
}

/* Dropzone */
.dropzone {
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.dropzone:hover, .dropzone.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dropzone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}

.dz-icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 18px;
}
.dz-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.dz-icon svg { width: 32px; height: 32px; }
.dz-icon-ring {
  position: absolute; inset: -8px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: .2;
  animation: ringPulse 2s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .2; }
  50% { transform: scale(1.1); opacity: .05; }
}

.dz-text {
  font-size: .92rem; font-weight: 500;
  margin-bottom: 6px;
}
.dz-text em {
  color: var(--accent);
  font-style: normal;
  text-decoration: underline;
}
.dz-sub {
  font-size: .8rem;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.dz-formats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
}
.dz-tag {
  padding: 2px 8px;
  font-size: .68rem;
  font-weight: 600;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}
.dz-tag--video { color: var(--blue); background: rgba(99,102,241,.1); }

/* Upload Form */
.upload-form {
  animation: formSlide .4s var(--ease);
}
@keyframes formSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.upload-form-file {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.file-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-icon svg { width: 20px; height: 20px; }
.file-icon--video { background: rgba(99,102,241,.12); color: var(--blue); }
.file-name {
  font-size: .88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-size {
  font-size: .78rem; color: var(--text-tertiary);
}
.file-convert-badge {
  font-size: .68rem;
  color: var(--blue);
  font-weight: 600;
}

/* Progress */
.upload-progress {
  text-align: center;
  padding: 40px 0;
  animation: formSlide .4s var(--ease);
}
.progress-track {
  width: 100%;
  height: 4px;
  background: var(--bg-inset);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s linear;
}
.progress-label {
  font-size: .82rem;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* Converting */
.convert-animation {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-bottom: 20px;
}
.convert-from, .convert-to {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.convert-from { background: rgba(99,102,241,.12); color: var(--blue); }
.convert-to { background: var(--accent-dim); color: var(--accent); }
.convert-from svg, .convert-to svg { width: 24px; height: 24px; }
.convert-arrow {
  width: 40px; position: relative;
}
.convert-wave {
  height: 2px;
  background: var(--text-tertiary);
  border-radius: 1px;
  animation: convertPulse 1s ease-in-out infinite;
}
@keyframes convertPulse {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

/* Done */
.upload-done {
  text-align: center;
  padding: 40px 0;
  animation: donePop .5s var(--ease);
}
@keyframes donePop {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}

.done-check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(34,197,94,.12);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.done-check svg { width: 28px; height: 28px; }

.upload-done h2 {
  font-size: 1.2rem; margin-bottom: 6px;
}
.upload-done p {
  color: var(--text-secondary); margin-bottom: 16px;
}

.share-url-box {
  display: flex; gap: 8px;
  max-width: 400px; margin: 0 auto 20px;
}
.share-url-box input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--mono);
  font-size: .8rem;
}
.share-url-box button {
  padding: 8px 16px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
}

.done-actions {
  display: flex; justify-content: center; gap: 10px;
}
.btn-open {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #000 !important;
  font-weight: 600;
  font-size: .88rem;
  border-radius: var(--radius-sm);
}

/* ── Library Page ── */
.library-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}
.lib-header {
  margin-bottom: 24px;
}
.lib-header h1 {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 4px;
}
.lib-header p {
  color: var(--text-secondary);
  font-size: .88rem;
}

.lib-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.lib-empty-icon { margin-bottom: 12px; }
.lib-empty-icon svg { width: 48px; height: 48px; color: var(--text-tertiary); }

/* Track List */
.track-list {
  display: flex; flex-direction: column; gap: 2px;
}
.track-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--bg-raised);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.track-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.track-slide-in {
  opacity: 0;
  animation: trackSlideIn .35s var(--ease) forwards;
}
@keyframes trackSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.track-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-inset);
  flex-shrink: 0;
}
.track-thumb img { width: 100%; height: 100%; object-fit: cover; }
.track-thumb-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
}
.track-thumb-ph svg { width: 18px; height: 18px; }

.track-info { flex: 1; min-width: 0; }
.track-title {
  font-size: .88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-artist {
  font-size: .78rem; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.track-meta-row {
  display: flex; gap: 8px; align-items: center;
  font-size: .72rem; color: var(--text-tertiary);
  margin-top: 2px;
}
.track-vis-badge {
  font-weight: 600;
}

.track-actions {
  display: flex; gap: 4px;
  flex-shrink: 0;
}
.track-action-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: none; border: none;
  color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.track-action-btn svg { width: 15px; height: 15px; }
.track-action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.track-action-btn.del-btn:hover { color: var(--red); }

/* Settings Page */
.settings-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}
.settings-header {
  margin-bottom: 24px;
}
.settings-header h1 {
  font-size: 1.6rem; font-weight: 800;
}
.settings-body {}
.settings-section {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-size: .95rem; font-weight: 700;
  margin-bottom: 14px;
}
.settings-row {
  display: flex; flex-direction: column; gap: 8px;
}

@media (max-width: 640px) {
  .upload-page, .library-page, .settings-page { padding: 70px 16px 40px; }
}
@media (max-width: 480px) {
  .track-item { gap: 10px; padding: 10px 10px; }
  .track-thumb { width: 40px; height: 40px; }
}
