/* ═══ Upload Page ═══ */
.upload-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 24px 60px; }
.upload-hero { text-align: center; margin-bottom: 48px; }
.upload-hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.05; margin-bottom: 14px; background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.upload-hero p { font-size: 1.0625rem; color: var(--text-secondary); max-width: 440px; margin: 0 auto; line-height: 1.6; }

/* Dropzone */
.dropzone { width: 100%; max-width: 520px; border: 1.5px dashed var(--border-light); border-radius: var(--radius-xl); padding: 60px 36px; text-align: center; cursor: pointer; transition: all .3s var(--ease); position: relative; background: transparent; }
.dropzone:hover { border-color: var(--border-focus); background: var(--bg-raised); }
.dropzone.active { border-color: var(--accent); background: var(--accent-subtle); transform: scale(1.01); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon-wrap { position: relative; width: 52px; height: 52px; margin: 0 auto 20px; }
.dz-icon { width: 52px; height: 52px; border-radius: var(--radius-m); background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; transition: all .3s var(--ease); position: relative; z-index: 1; }
.dz-icon-ring { position: absolute; inset: -6px; border-radius: calc(var(--radius-m) + 6px); border: 1.5px solid transparent; transition: all .4s var(--ease); }
.dropzone:hover .dz-icon { background: var(--bg-surface); transform: translateY(-3px); }
.dropzone:hover .dz-icon-ring { border-color: rgba(232,168,73,.15); }
.dz-icon svg { width: 22px; height: 22px; color: var(--text-tertiary); }
.dropzone.active .dz-icon { background: var(--accent-muted); }
.dropzone.active .dz-icon svg { color: var(--accent); }
.dropzone.active .dz-icon-ring { border-color: var(--accent); animation: ring-pulse 1.5s ease-in-out infinite; }
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: .5; }
}
.dz-text { font-size: .9375rem; color: var(--text-secondary); font-weight: 500; }
.dz-text em { font-style: normal; color: var(--accent); border-bottom: 1px solid rgba(232,168,73,.3); }
.dz-sub { font-size: .8125rem; color: var(--text-tertiary); margin-top: 6px; }
.dz-formats { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin-top: 18px; }
.dz-tag { padding: 3px 10px; border-radius: var(--radius-full); font-size: .6875rem; font-weight: 500; letter-spacing: .04em; background: var(--bg-elevated); color: var(--text-tertiary); font-family: var(--mono); }
.dz-tag--video { background: rgba(99,102,241,.1); color: rgba(129,140,248,.8); }

/* Upload form */
.upload-form { width: 100%; max-width: 500px; display: flex; flex-direction: column; gap: 20px; }
.upload-form-file { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--bg-raised); border-radius: var(--radius-m); border: 1px solid var(--border); }
.file-icon { width: 42px; height: 42px; border-radius: var(--radius-s); background: var(--accent-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-icon svg { width: 18px; height: 18px; color: var(--accent); }
.file-icon--video { background: rgba(99,102,241,.12); }
.file-icon--video svg { color: rgba(129,140,248,.9); }
.file-name { font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: .75rem; color: var(--text-tertiary); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.file-convert-badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-full); background: rgba(99,102,241,.12); color: rgba(129,140,248,.9); font-size: .625rem; font-weight: 600; letter-spacing: .02em; }

/* Progress */
.upload-progress { width: 100%; max-width: 500px; text-align: center; }
.progress-track { height: 3px; background: var(--bg-elevated); border-radius: 2px; overflow: hidden; margin: 24px 0 12px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .2s var(--ease); width: 0; position: relative; }
.progress-fill::after { content: ''; position: absolute; right: 0; top: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.progress-label { font-size: .8125rem; color: var(--text-tertiary); font-family: var(--mono); }

/* Video-to-audio conversion animation */
.convert-animation { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 28px; }
.convert-from, .convert-to { width: 56px; height: 56px; border-radius: var(--radius-m); display: flex; align-items: center; justify-content: center; }
.convert-from { background: rgba(99,102,241,.12); color: rgba(129,140,248,.9); animation: convert-pulse-left 2s ease-in-out infinite; }
.convert-to { background: var(--accent-muted); color: var(--accent); animation: convert-pulse-right 2s ease-in-out infinite; }
.convert-from svg, .convert-to svg { width: 24px; height: 24px; }
.convert-arrow { position: relative; width: 48px; height: 32px; overflow: hidden; }
.convert-wave { position: absolute; inset: 0; display: flex; align-items: center; }
.convert-wave::before { content: ''; display: block; width: 100%; height: 2px; background: linear-gradient(90deg, rgba(129,140,248,.6) 0%, var(--accent) 100%); animation: wave-flow 1s linear infinite; }
@keyframes convert-pulse-left { 0%,100% { transform: scale(1); } 50% { transform: scale(.92); opacity: .7; } }
@keyframes convert-pulse-right { 0%,100% { transform: scale(.92); opacity: .7; } 50% { transform: scale(1); } }
@keyframes wave-flow { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }

/* Upload done */
.upload-done { width: 100%; max-width: 500px; text-align: center; }
.done-check { width: 56px; height: 56px; border-radius: 50%; background: rgba(34,197,94,.1); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; color: var(--green); animation: done-pop .5s var(--ease-bounce); }
.done-check svg { width: 28px; height: 28px; }
@keyframes done-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.upload-done h2 { font-size: 1.375rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -.02em; }
.upload-done p { font-size: .875rem; color: var(--text-secondary); margin-bottom: 28px; }
.share-url-box { display: flex; border: 1px solid var(--border); border-radius: var(--radius-s); overflow: hidden; margin-bottom: 16px; }
.share-url-box input { flex: 1; padding: 11px 14px; background: var(--bg-raised); font-family: var(--mono); font-size: .8125rem; }
.share-url-box button { padding: 11px 18px; background: var(--bg-elevated); color: var(--text-secondary); font-weight: 600; font-size: .8125rem; transition: all .15s ease; border-left: 1px solid var(--border); }
.share-url-box button:hover { background: var(--bg-surface); color: var(--text-primary); }
.done-actions { display: flex; gap: 10px; }
.done-actions > * { flex: 1; padding: 12px; border-radius: var(--radius-s); font-weight: 600; font-size: .875rem; text-align: center; transition: all .15s ease; }
.btn-open { background: var(--text-primary); color: var(--bg); display: flex; align-items: center; justify-content: center; }
.btn-open:hover { opacity: .85; }

/* Library */
.library-page { flex: 1; padding: 80px 24px 60px; max-width: 800px; margin: 0 auto; width: 100%; }
.library-page h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 8px; }
.library-sub { color: var(--text-secondary); font-size: .9375rem; margin-bottom: 32px; }
.library-actions { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }
.track-list { display: flex; flex-direction: column; gap: 2px; }
.track-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-s); transition: all .2s ease; cursor: pointer; animation: track-slide-in .4s var(--ease) backwards; }
@keyframes track-slide-in { from { opacity: 0; transform: translateX(-12px); } }
.track-item:hover { background: rgba(255,255,255,.03); }
.track-thumb { width: 48px; height: 48px; border-radius: var(--radius-xs); background: var(--bg-elevated); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: transform .2s var(--ease); }
.track-item:hover .track-thumb { transform: scale(1.05); }
.track-thumb img { width: 100%; height: 100%; object-fit: cover; }
.track-thumb svg { width: 20px; height: 20px; color: var(--text-faint); }
.track-info { flex: 1; min-width: 0; }
.track-title { font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: .75rem; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-badges { display: flex; gap: 6px; align-items: center; }
.track-badge { padding: 2px 8px; border-radius: var(--radius-full); font-size: .625rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.track-badge.private { background: rgba(239,68,68,.1); color: var(--red); }
.track-badge.public { background: rgba(34,197,94,.1); color: var(--green); }
.track-meta { font-size: .6875rem; color: var(--text-faint); font-family: var(--mono); white-space: nowrap; }
.track-actions { display: flex; gap: 4px; }
.track-action-btn { width: 32px; height: 32px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; color: var(--text-faint); transition: all .15s ease; }
.track-action-btn:hover { background: rgba(255,255,255,.06); color: var(--text-secondary); }
.track-action-btn--danger:hover { background: rgba(239,68,68,.08); color: var(--red); }
.track-action-btn svg { width: 14px; height: 14px; }
.library-empty { text-align: center; padding: 60px 20px; color: var(--text-tertiary); }
.library-empty svg { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .3; }
.library-empty-icon { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: var(--radius-m); background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; }
.library-empty-icon svg { width: 28px; height: 28px; opacity: .3; }
.library-empty p { margin-bottom: 20px; }

/* Settings */
.settings-page { flex: 1; padding: 80px 24px 60px; max-width: 600px; margin: 0 auto; width: 100%; }
.settings-page h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: 32px; }
.settings-section { margin-bottom: 32px; }
.settings-section h2 { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-tertiary); margin-bottom: 12px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-s); margin-bottom: 8px; }
.settings-row label { font-size: .9375rem; }
.settings-row select { padding: 8px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: .875rem; color: var(--text-primary); }

@media (max-width: 640px) {
  .upload-page { padding: 72px 16px 40px; }
  .dropzone { padding: 40px 20px; }
  .artwork-picker { flex-direction: column; align-items: flex-start; }
  .done-actions { flex-direction: column; }
  .library-page { padding: 72px 16px 40px; }
  .track-meta { display: none; }
  .settings-page { padding: 72px 16px 40px; }
}
@media (max-width: 480px) {
  .track-item { padding: 10px 12px; gap: 10px; }
  .track-thumb { width: 40px; height: 40px; }
}
