/* ============================================
   STEMS — AI Vocal Remover
   Design: Dark glassmorphism + warm orange accents
   ============================================ */

:root {
    --bg-primary: #08080c;
    --bg-card: rgba(18, 18, 26, 0.6);
    --bg-card-solid: #12121a;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 138, 60, 0.3);
    --text-primary: #f0f0f2;
    --text-secondary: #8a8a9a;
    --text-tertiary: #55556a;
    --accent-start: #ff6b2c;
    --accent-end: #ff9f43;
    --accent-glow: rgba(255, 107, 44, 0.15);
    --success: #34d399;
    --error: #f87171;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Ambient Background Glows ---- */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 107, 44, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -150px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 159, 67, 0.06) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

/* ---- App Layout ---- */
.app {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-bottom: 2.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 107, 44, 0.1);
    border: 1px solid rgba(255, 107, 44, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-start);
    background: rgba(255, 107, 44, 0.08);
    border: 1px solid rgba(255, 107, 44, 0.12);
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
}

/* ---- Hero ---- */
.hero {
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 440px;
    font-weight: 400;
}

/* ---- Hidden ---- */
.hidden {
    display: none !important;
}

/* ---- Drop Zone ---- */
.drop-zone {
    position: relative;
    border: 1.5px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: radial-gradient(ellipse at 50% 0%, var(--accent-glow) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--border-hover);
    background: rgba(18, 18, 26, 0.8);
}

.drop-zone:hover::before,
.drop-zone.drag-over::before {
    opacity: 1;
}

.drop-zone-content {
    position: relative;
    z-index: 1;
}

.upload-icon-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 107, 44, 0.12), rgba(255, 159, 67, 0.06));
    border: 1px solid rgba(255, 107, 44, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--accent-start);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.drop-zone:hover .upload-icon-ring {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 107, 44, 0.15);
}

.drop-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.drop-sub {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
}

.format-tags {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
}

/* ---- Upload Quality Group (above drop zone) ---- */
.upload-quality-group {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

/* ---- File Ready Card ---- */
.file-ready {
    animation: fadeIn 0.3s ease-out;
    margin-top: 1rem;
}

.file-ready-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 107, 44, 0.1), rgba(255, 159, 67, 0.05));
    border: 1px solid rgba(255, 107, 44, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-start);
    flex-shrink: 0;
}

.file-ready-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.file-ready-size {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

.change-file-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.change-file-btn:hover {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.2);
    color: var(--error);
}

/* ---- Option Tags (shared by quality & format selectors) ---- */
.option-group {
    margin-bottom: 1.25rem;
}

.option-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 0.6rem;
}

.option-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.option-tag {
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-tag:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.1);
}

.option-tag.active {
    background: rgba(255, 107, 44, 0.08);
    border-color: rgba(255, 107, 44, 0.25);
    color: var(--accent-start);
}

.option-hint {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* ---- Convert Button ---- */
.btn-convert {
    width: 100%;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
}

.btn-convert:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ---- Feature Chips ---- */
.features-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: 100px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.feature-chip svg {
    color: var(--accent-start);
    flex-shrink: 0;
}

/* ---- Glass Card ---- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

/* ---- Processing Card ---- */
.processing-card {
    text-align: center;
}

.processing-visual {
    margin-bottom: 1.75rem;
}

.wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 64px;
}

.wave-bar {
    width: 4px;
    border-radius: 100px;
    background: linear-gradient(180deg, var(--accent-start), var(--accent-end));
    animation: waveform 1.2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.08s);
    min-height: 8px;
}

@keyframes waveform {
    0%, 100% { height: 8px; opacity: 0.4; }
    50% { height: 48px; opacity: 1; }
}

.status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-start);
    background: rgba(255, 107, 44, 0.1);
    border: 1px solid rgba(255, 107, 44, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    margin-bottom: 0.75rem;
}

.processing-info h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.file-name {
    color: var(--text-secondary);
    font-size: 0.85rem;
    word-break: break-all;
    font-weight: 500;
}

.processing-hint {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    margin-top: 0.75rem;
    line-height: 1.6;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- ETA Display ---- */
.eta-display {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.45rem 0.85rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}

.eta-display svg {
    color: var(--accent-start);
    flex-shrink: 0;
}

.eta-display span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.quality-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-end);
    background: rgba(255, 159, 67, 0.08);
    border: 1px solid rgba(255, 159, 67, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    margin-top: 0.5rem;
}

.progress-track {
    margin-top: 1.75rem;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    border-radius: 100px;
    animation: indeterminate 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes indeterminate {
    0%   { width: 0%; margin-left: 0%; }
    50%  { width: 50%; margin-left: 25%; }
    100% { width: 0%; margin-left: 100%; }
}

/* ---- Result Card ---- */
.result-card {
    padding: 2rem;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.success-ring {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.08);
    border: 1.5px solid rgba(52, 211, 153, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    flex-shrink: 0;
}

.result-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.result-header .file-name {
    margin-top: 0.2rem;
    font-size: 0.8rem;
}

/* ---- Player ---- */
.player-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.player-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.player-label svg {
    color: var(--accent-start);
}

/* ---- Custom Audio Player ---- */
.custom-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(255, 107, 44, 0.25);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 107, 44, 0.35);
}

.play-btn:active {
    transform: scale(0.97);
}

.player-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.player-track:hover {
    height: 8px;
}

.player-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
    border-radius: 100px;
    transition: width 0.05s linear;
}

.player-time {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: right;
}

/* ---- Pitch Control ---- */
.pitch-control {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.pitch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.pitch-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.pitch-original {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

.pitch-original.pitch-at-original {
    color: var(--success);
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.15);
}

.pitch-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.pitch-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pitch-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.pitch-btn:active {
    transform: scale(0.93);
}

.pitch-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.pitch-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.pitch-unit {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
}

/* ---- Buttons ---- */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: #fff;
    box-shadow: 0 2px 12px rgba(255, 107, 44, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 28px rgba(255, 107, 44, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 44, 0.2);
}

.btn-pitched {
    flex: 1;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.2);
}

.btn-pitched:hover {
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-pitched:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-ghost {
    flex: 0.6;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-ghost:active {
    background: rgba(255, 255, 255, 0.04);
}

/* ---- Footer ---- */
.footer {
    margin-top: auto;
    padding-top: 2.5rem;
    text-align: center;
}

.footer p {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

.footer strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---- Error Toast ---- */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.15);
    color: var(--error);
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Section Transitions ---- */
#upload-section,
#processing-section,
#result-section {
    animation: fadeIn 0.4s ease-out;
}

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

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .app {
        padding: 1rem 1rem 1.5rem;
    }

    .hero h1 {
        font-size: 2.1rem;
    }

    .hero-sub {
        font-size: 0.9rem;
    }

    .drop-zone {
        padding: 2.5rem 1.25rem;
    }

    .features-row {
        gap: 0.4rem;
    }

    .feature-chip {
        font-size: 0.7rem;
        padding: 0.4rem 0.7rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-ghost,
    .btn-pitched {
        flex: 1;
    }

    .player-time {
        min-width: 65px;
        font-size: 0.65rem;
    }

    .glass-card {
        padding: 1.5rem;
    }
}
