/* Soniq8 - Modern CSS Styles */
:root {
    --primary-color: #1db954;
    --secondary-color: #1ed760;
    --dark-bg: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #ff6b6b;
    --warning-color: #ffa726;
    --success-color: #4caf50;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: #0a0a0a;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Animated background (borrowed from login) */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.bg-layer.hidden {
    opacity: 0;
}

.vinyl {
    position: absolute;
    width: 800px;
    height: 800px;
    right: -280px;
    top: -280px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #0a0a0a 18%, transparent 18.5%),
        radial-gradient(circle at center, rgba(255,255,255,.03) 30%, transparent 30.5%),
        radial-gradient(circle at center, rgba(255,255,255,.02) 45%, transparent 45.5%),
        radial-gradient(circle at center, rgba(255,255,255,.01) 60%, transparent 60.5%),
        conic-gradient(from 0deg, #111 0deg, #1a1a1a 30deg, #111 60deg, #1a1a1a 90deg,
                        #111 120deg, #1a1a1a 150deg, #111 180deg, #1a1a1a 210deg,
                        #111 240deg, #1a1a1a 270deg, #111 300deg, #1a1a1a 330deg, #111 360deg);
    border: 1px solid rgba(255,255,255,.04);
    animation: vinyl-spin 50s linear infinite;
    opacity: .35;
}

@keyframes vinyl-spin { to { transform: rotate(360deg) } }

.waveform {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    opacity: .1;
}

.waveform svg {
    width: 100%;
    height: 100%;
    display: block;
}

.wave {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 1.5px;
}

.wave-1 {
    animation: wave-drift 8s ease-in-out infinite alternate;
    opacity: .6;
}

.wave-2 {
    animation: wave-drift 12s ease-in-out infinite alternate-reverse;
    opacity: .35;
    stroke-dasharray: 8 4;
}

@keyframes wave-drift {
    0%   { d: path("M0,160 C180,260 360,60 540,160 C720,260 900,60 1080,160 C1200,220 1320,100 1440,160 L1440,320 L0,320 Z") }
    100% { d: path("M0,180 C200,80 380,280 560,140 C740,20 920,280 1100,140 C1220,80 1340,240 1440,180 L1440,320 L0,320 Z") }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
    background-size: 60px 60px;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Unified Site Header */
.site-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 24px;
}

.site-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.site-header-logo span {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Brand accent on the "8" */
.brand-8 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), #15803d);
    font-size: 1.05rem;
    color: #fff;
    box-shadow: 0 3px 12px rgba(29, 185, 84, .25);
    flex-shrink: 0;
}

.site-header-nav {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: auto;
    margin-right: auto;
}

.site-header-nav:empty {
    background: none;
    border: none;
    padding: 0;
}

.site-header-nav .nav-tab {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.site-header-nav .nav-tab i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.site-header-nav .nav-tab.active {
    background: rgba(29, 185, 84, 0.12);
    color: var(--primary-color);
}

.site-header-nav .nav-tab.active i {
    opacity: 1;
}

.site-header-nav .nav-tab:hover:not(.active) {
    color: #ddd;
    background: rgba(255, 255, 255, 0.04);
}

/* Legacy: keep tagline styles for any remaining usage */
.tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Landing Section Spacing */
#landingSection {
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 20px 20px 0;
    margin-bottom: 20px;
}

/* Input Section */
.input-section {
    margin-bottom: 40px;
}

/* How It Works */
.how-it-works {
    margin-bottom: 32px;
}

/* Features Section */
.features-section {
    margin-bottom: 32px;
}

.hero-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 2.8rem;
    letter-spacing: -1.5px;
    line-height: 1.1;
    background: linear-gradient(135deg, #fff 40%, var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.hero-phonetic {
    display: block;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 2px;
    -webkit-text-fill-color: var(--text-secondary);
    background: none;
    margin-top: 8px;
    opacity: 0.6;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* How It Works - Flowchart */
.flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 820px;
    margin: 0 auto;
}

.flow-node {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: var(--transition);
    flex: 1;
    min-width: 0;
}

.flow-node:hover {
    border-color: rgba(29, 185, 84, 0.25);
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.06);
}

.flow-node-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(29, 185, 84, 0.1);
    color: var(--primary-color);
    font-size: 1rem;
    flex-shrink: 0;
    border: 2px solid rgba(29, 185, 84, 0.2);
}

.flow-node-body {
    min-width: 0;
}

.flow-node-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.flow-node-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.flow-edge {
    width: 48px;
    flex-shrink: 0;
    color: rgba(29, 185, 84, 0.3);
    display: flex;
    align-items: center;
}

.flow-edge svg {
    width: 100%;
    height: 24px;
}

/* Feature Cards */

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius);
    padding: 24px 20px;
    transition: var(--transition);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(29, 185, 84, 0.1);
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 14px;
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Recent Analyses */

.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.recent-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.recent-header h3 i {
    color: var(--primary-color);
    font-size: 0.95rem;
}

.recent-view-all {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.recent-view-all:hover {
    color: var(--primary-color);
}

.recent-view-all i {
    font-size: 0.7rem;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.recent-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    cursor: pointer;
}

.recent-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.recent-thumb {
    width: 64px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.recent-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.recent-meta i {
    font-size: 0.65rem;
}

/* Card Styles */
.processing-card, .error-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-card {
    background: #141414;
    border-radius: 16px;
    padding: 32px 36px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 0 1px rgba(29, 185, 84, 0.04),
        0 16px 48px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2);
}

.input-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.input-card h2 i {
    color: #ff0000;
}

/* Form Styles */
.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

/* URL field (login-style icon-inside input) */
.url-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-field:focus-within {
    border-color: rgba(29, 185, 84, 0.4);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.08);
}

.url-field-icon {
    color: #ff0000;
    font-size: 1.1rem;
    flex-shrink: 0;
    opacity: 0.6;
}

.url-field:focus-within .url-field-icon {
    opacity: 1;
}

.url-input {
    flex: 1;
    padding: 15px 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
}

.url-input::placeholder {
    color: #555;
}

/* Paste Button (inside url-field) */
.paste-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.paste-btn:hover {
    border-color: rgba(29, 185, 84, 0.4);
    color: var(--primary-color);
    background: rgba(29, 185, 84, 0.06);
}

.paste-btn.paste-success {
    border-color: var(--success-color);
    color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

/* Analyze Button */
.analyze-btn {
    padding: 15px 28px;
    background: linear-gradient(135deg, var(--primary-color), #15803d);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-family: inherit;
}

.analyze-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(29, 185, 84, 0.3);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.analyze-btn.loading span {
    display: none;
}

.analyze-btn.loading i {
    animation: none;
}

.analyze-btn.loading::after {
    content: 'Analyzing...';
}

@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0.4); }
    50%      { box-shadow: 0 0 0 10px rgba(29, 185, 84, 0); }
}

.analyze-btn.loading {
    animation: btn-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.url-help {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Processing Styles */
.processing-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.processing-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: var(--transition);
}

.step.active {
    background: rgba(29, 185, 84, 0.2);
    border: 1px solid var(--primary-color);
}

.step.completed {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid var(--success-color);
}

.step i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.processing-info {
    text-align: center;
}

.processing-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Results Styles */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
}

.share-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.share-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(29, 185, 84, 0.1);
}

.results-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat i {
    color: var(--primary-color);
}

/* Video Info */
.video-info {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tracklist */
.tracklist {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.song-item {
    display: grid;
    grid-template-columns: 40px 48px 1fr auto auto auto;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    align-items: center;
}

.album-art {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.album-art-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.15);
    font-size: 1.2rem;
}

.album-art-placeholder.gap-art {
    opacity: 0.3;
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.song-item:last-child {
    border-bottom: none;
}

.song-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.song-details h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.song-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.song-timestamp {
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.confidence-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.confidence-high {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success-color);
}

.confidence-medium {
    background: rgba(255, 167, 38, 0.2);
    color: var(--warning-color);
}

.confidence-low {
    background: rgba(255, 107, 107, 0.2);
    color: var(--accent-color);
}

/* Low Confidence Song Re-verify */
.low-confidence-item {
    border-left: 3px solid rgba(255, 107, 107, 0.3);
}

.reverify-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 167, 38, 0.3);
    border-radius: 8px;
    background: rgba(255, 167, 38, 0.08);
    color: var(--warning-color);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.reverify-btn:hover {
    background: rgba(255, 167, 38, 0.2);
    border-color: rgba(255, 167, 38, 0.5);
    transform: rotate(30deg);
}

.reverify-btn:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

.reverify-btn.verifying i {
    animation: spin 1s linear infinite;
}

.reverify-btn.verified {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.4);
    color: var(--success-color);
}

.reverify-all-btn {
    background: rgba(255, 167, 38, 0.1) !important;
    border-color: rgba(255, 167, 38, 0.3) !important;
    color: var(--warning-color) !important;
}

.reverify-all-btn:hover {
    background: rgba(255, 167, 38, 0.2) !important;
    border-color: rgba(255, 167, 38, 0.5) !important;
}

#reverifyCount {
    background: rgba(255, 107, 107, 0.25);
    color: var(--accent-color);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 4px;
    font-weight: 700;
}

/* Gap / Unidentified Segment Styles */
.gap-item {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    opacity: 0.65;
}

.gap-item:hover {
    opacity: 0.8;
}

.gap-number {
    color: var(--text-secondary) !important;
}

.gap-title {
    font-style: italic;
    color: var(--text-secondary) !important;
}

.gap-badge {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

/* Transition items */
.transition-item {
    background: rgba(99, 102, 241, 0.04);
    border-left: 3px solid rgba(99, 102, 241, 0.3);
    opacity: 0.55;
}

.transition-item:hover {
    opacity: 0.7;
}

.transition-art {
    opacity: 0.4;
}

.transition-title {
    font-style: italic;
    color: rgba(99, 102, 241, 0.7);
}

.transition-badge {
    background: rgba(99, 102, 241, 0.12);
    color: rgba(99, 102, 241, 0.7);
}

/* Gap action bar */
.gap-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gap-action-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    white-space: nowrap;
}

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

.gap-action-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.gap-audio {
    height: 28px;
    margin-top: 6px;
}

/* Edit form (manual tag) */
.edit-form {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-form input {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    width: 100%;
}

.edit-form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.edit-form-buttons button {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition);
}

.edit-form-buttons button:first-child {
    background: var(--primary-color);
    color: white;
}

.edit-form-buttons button:last-child {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Experimental / AI Estimate Styles */
.experimental-item {
    border-left: 3px solid var(--warning-color);
}

.experimental-tag {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 167, 38, 0.2);
    color: var(--warning-color);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Export Styles */
.export-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.export-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.export-btn {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
}

.export-btn:hover {
    border-color: var(--primary-color);
    background: rgba(29, 185, 84, 0.1);
    transform: translateY(-2px);
}

.streaming-exports h4 {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.streaming-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.streaming-btn {
    padding: 15px 25px;
    border: none;
    border-radius: var(--border-radius);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    position: relative;
}

.spotify-btn {
    background: #1db954;
}

.spotify-btn:hover:not(:disabled) {
    background: #1ed760;
    transform: translateY(-2px);
}

.spotify-btn:disabled {
    background: #333;
    cursor: not-allowed;
    opacity: 0.5;
}

.apple-btn {
    background: #666;
    cursor: not-allowed;
}

.coming-soon {
    font-size: 0.7rem;
    background: var(--accent-color);
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 5px;
}

/* Error Styles */
.error-card {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--accent-color);
}

.error-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.retry-btn {
    padding: 12px 24px;
    background: var(--accent-color);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.retry-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.spotify-linked {
    color: #1db954;
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 4px;
}

/* Spotify Match Preview */
.spotify-match-preview {
    margin-top: 12px;
}

.match-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 5px 10px;
    border-radius: 6px;
}

.match-ready {
    color: #1db954;
    background: rgba(29, 185, 84, 0.08);
}

.match-search {
    color: var(--warning-color);
    background: rgba(255, 167, 38, 0.08);
}

.match-skip {
    color: var(--accent-color);
    background: rgba(255, 107, 107, 0.08);
}

.match-duplicate {
    color: #9e9e9e;
    background: rgba(158, 158, 158, 0.08);
}

.dup-count {
    color: var(--text-secondary);
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 4px;
}

.match-details {
    margin-top: 8px;
    font-size: 0.8rem;
}

.match-details summary {
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 0;
}

.match-details ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0 0;
    max-height: 120px;
    overflow-y: auto;
}

.match-details li {
    padding: 3px 10px;
    color: var(--text-secondary);
    border-left: 2px solid rgba(255, 167, 38, 0.3);
    margin-bottom: 3px;
}

/* Legal Pages */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 0;
}

.legal-page h1 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.legal-updated {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 32px;
}

.legal-page h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.legal-page h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.legal-page p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-page ul {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 24px;
}

.legal-page li {
    margin-bottom: 6px;
}

.legal-page a {
    color: var(--primary-color);
    text-decoration: none;
}

.legal-page a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    margin-top: 50px;
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.footer-links {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .logo h1 {
        font-size: 1.8rem;
    }
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .hero-section {
        padding: 12px 10px 0;
        margin-bottom: 16px;
    }

    .input-section {
        margin-bottom: 28px;
    }

    .how-it-works {
        margin-bottom: 24px;
    }

    .features-section {
        margin-bottom: 24px;
    }

    .hero-title {
        font-size: 1.8rem;
        letter-spacing: -1px;
    }

    .hero-phonetic {
        font-size: 0.85rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .flow {
        flex-direction: column;
        gap: 0;
    }

    .flow-node {
        border-radius: 0;
        padding: 14px 18px;
    }

    .flow-node:first-child {
        border-radius: 12px 12px 0 0;
    }

    .flow-node:last-child {
        border-radius: 0 0 12px 12px;
    }

    .flow-edge {
        width: 100%;
        height: 28px;
        justify-content: center;
    }

    .flow-edge svg {
        width: 24px;
        height: 100%;
        transform: rotate(90deg);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .feature-card {
        padding: 18px 14px;
    }

    .recent-grid {
        grid-template-columns: 1fr;
    }

    .input-card {
        padding: 24px 20px;
    }

    .input-group {
        flex-direction: column;
    }

    .url-field {
        padding: 0 14px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-stats {
        gap: 15px;
    }

    .song-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }

    .album-art, .album-art-placeholder {
        display: none;
    }

    .streaming-buttons {
        justify-content: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth Section */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Legacy compat */

.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.auth-loading { color: var(--text-secondary); }

.auth-anonymous {
    display: flex;
    gap: 8px;
}

.auth-btn {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.auth-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.google-login:hover { border-color: #4285f4; }
.github-login:hover { border-color: #fff; }

.auth-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-credits {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.jobs-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(29, 185, 84, 0.15);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
}
.jobs-badge:hover {
    background: rgba(29, 185, 84, 0.25);
}
.jobs-badge i {
    font-size: 0.7rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.user-menu:hover {
    background: rgba(255,255,255,0.1);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #141414;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    min-width: 230px;
    padding: 8px 0;
    z-index: 100;
    box-shadow:
        0 0 0 1px rgba(29,185,84,.04),
        0 16px 48px rgba(0,0,0,0.5),
        0 4px 16px rgba(0,0,0,0.3);
    animation: dropdown-in 0.15s ease-out;
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
    padding: 9px 16px;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s;
    text-decoration: none;
    border-radius: 0;
    margin: 0 4px;
    border-radius: 8px;
}

.dropdown-item:hover {
    background: rgba(29, 185, 84, 0.06);
    color: var(--text-primary);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

.dropdown-item:hover i {
    opacity: 1;
}

.dropdown-item a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Spotify connect item in dropdown */
.spotify-connect-item i {
    color: #888;
}

.spotify-connect-item.spotify-connected i {
    color: #1db954;
}

.spotify-connect-item.spotify-connected::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1db954;
    margin-left: auto;
    flex-shrink: 0;
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 6px 12px;
}

@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .site-header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin: 0;
    }
    .site-header-nav .nav-tab {
        flex: 1;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.78rem;
    }
    .site-header-nav .nav-tab i {
        display: none;
    }
    .auth-section {
        margin-left: auto;
    }
    .user-name {
        display: none;
    }
}
