/* ============================================
   MIDI to VSQX Converter - Premium Styles
   Modern glassmorphism with vibrant accents
   ============================================ */

/* CSS Variables */
:root {
    /* Colors */
    --primary-hue: 280;
    --accent-hue: 340;
    --secondary-hue: 200;

    --primary: hsl(var(--primary-hue), 80%, 60%);
    --primary-dark: hsl(var(--primary-hue), 80%, 45%);
    --primary-light: hsl(var(--primary-hue), 80%, 75%);

    --accent: hsl(var(--accent-hue), 85%, 60%);
    --accent-dark: hsl(var(--accent-hue), 85%, 45%);

    --secondary: hsl(var(--secondary-hue), 70%, 55%);

    --bg-dark: hsl(250, 30%, 8%);
    --bg-card: hsla(250, 30%, 12%, 0.8);
    --bg-card-hover: hsla(250, 30%, 16%, 0.9);
    --bg-input: hsla(250, 30%, 15%, 0.6);

    --text-primary: hsl(0, 0%, 95%);
    --text-secondary: hsl(250, 20%, 70%);
    --text-muted: hsl(250, 15%, 50%);

    --border: hsla(250, 30%, 40%, 0.3);
    --border-focus: hsla(var(--primary-hue), 80%, 60%, 0.5);

    --gradient-primary: linear-gradient(135deg, var(--primary), var(--accent));
    --gradient-bg: linear-gradient(180deg, hsl(260, 35%, 12%) 0%, var(--bg-dark) 100%);

    --shadow-sm: 0 2px 8px hsla(0, 0%, 0%, 0.3);
    --shadow-md: 0 4px 20px hsla(0, 0%, 0%, 0.4);
    --shadow-lg: 0 8px 40px hsla(0, 0%, 0%, 0.5);
    --shadow-glow: 0 0 30px hsla(var(--primary-hue), 80%, 50%, 0.3);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

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

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: var(--gradient-bg);
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 50px) scale(0.95);
    }

    75% {
        transform: translate(-50px, -20px) scale(1.05);
    }
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
    position: relative;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-xl);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

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

.github-link {
    display: flex;
    align-items: center;
    padding: var(--space-sm);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.github-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    letter-spacing: -0.03em;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Converter Card */
.converter-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

/* Form Sections */
.form-section {
    margin-bottom: var(--space-2xl);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.section-number {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
}

/* Upload Zones */
.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.upload-zone {
    position: relative;
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: var(--bg-input);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: 180px;
}

.upload-zone:hover .upload-label,
.upload-zone.dragover .upload-label {
    border-color: var(--primary);
    background: hsla(var(--primary-hue), 80%, 50%, 0.1);
}

.upload-zone.has-file .upload-label {
    border-color: var(--secondary);
    border-style: solid;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.upload-zone:hover .upload-icon {
    color: var(--primary);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.upload-filename {
    margin-top: var(--space-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--secondary);
    word-break: break-all;
}

/* Radio Cards */
.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.radio-card {
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
}

.radio-card:hover .radio-content {
    border-color: var(--primary-light);
}

.radio-card input:checked+.radio-content {
    border-color: var(--primary);
    background: hsla(var(--primary-hue), 80%, 50%, 0.15);
}

.radio-icon {
    width: 36px;
    height: 36px;
    margin-bottom: var(--space-sm);
    color: var(--text-muted);
}

.radio-card input:checked+.radio-content .radio-icon {
    color: var(--primary);
}

.radio-icon svg {
    width: 100%;
    height: 100%;
}

.radio-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.radio-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Manual Lyrics Container */
.manual-lyrics-container {
    display: none;
    margin-top: var(--space-lg);
}

.manual-lyrics-container.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inputs & Selects */
.input-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

textarea,
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
    resize: vertical;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(var(--primary-hue), 80%, 50%, 0.2);
}

textarea::placeholder,
input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.input-hint-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Select Wrapper */
.select-group {
    margin-top: var(--space-lg);
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: var(--space-md);
    padding-right: 48px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    transition: all var(--transition-fast);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(var(--primary-hue), 80%, 50%, 0.2);
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    color: var(--text-muted);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.tuning-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

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

.option-card {
    background: var(--bg-input);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.option-card .input-label {
    margin-bottom: var(--space-md);
}

.option-card.option-card-wide {
    grid-column: 1 / -1;
}

.option-card input[type="number"] {
    background: hsla(250, 30%, 10%, 0.5);
}

/* Version Toggle */
.version-toggle {
    display: flex;
    gap: var(--space-sm);
}

.version-toggle-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.version-toggle-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.version-toggle-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
}

.version-toggle input {
    position: absolute;
    opacity: 0;
}

.version-btn {
    flex: 1;
    padding: var(--space-md);
    background: hsla(250, 30%, 10%, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.version-toggle input:checked+.version-btn {
    background: var(--gradient-primary);
    border-color: transparent;
}

.version-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.version-desc {
    display: block;
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px hsla(var(--primary-hue), 80%, 50%, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
}

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

/* Preview Panel */
.preview-panel {
    display: none;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
}

.preview-panel.visible {
    display: block;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.preview-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.close-btn svg {
    width: 16px;
    height: 16px;
}

.preview-stats {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.stat-item {
    background: var(--bg-input);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.stat-label {
    color: var(--text-muted);
    margin-right: var(--space-sm);
}

.stat-value {
    font-weight: 600;
    color: var(--primary-light);
}

.preview-content {
    max-height: 400px;
    overflow-y: auto;
    background: hsla(250, 30%, 8%, 0.5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.preview-table th,
.preview-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.preview-table th {
    background: hsla(250, 30%, 15%, 0.5);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

.preview-table tr:hover td {
    background: hsla(250, 30%, 20%, 0.3);
}

.note-split {
    color: var(--accent);
}

.note-split::after {
    content: '✂';
    margin-left: var(--space-xs);
    font-size: 0.75rem;
}

/* Features Section */
.features {
    margin-top: var(--space-3xl);
    padding: var(--space-2xl) 0;
}

.section-heading {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-2xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

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

.feature-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

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

/* How It Works */
.how-it-works {
    margin-top: var(--space-2xl);
    padding: var(--space-2xl) 0;
}

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.step {
    text-align: center;
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.step-number {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.step h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.step p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-2xl) 0;
    margin-top: var(--space-2xl);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: hsla(250, 30%, 8%, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-lg);
    z-index: 1000;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid hsl(140, 70%, 50%);
}

.toast.error {
    border-left: 4px solid hsl(0, 70%, 55%);
}

.toast.info {
    border-left: 4px solid var(--secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: var(--space-md);
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .converter-card {
        padding: var(--space-lg);
    }

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

    .btn {
        width: 100%;
        justify-content: center;
    }

    .step-connector {
        display: none;
    }

    .steps {
        flex-direction: column;
    }

    .step {
        max-width: 100%;
    }

    /* Advanced Engine Tuning Mobile Fix */
    .match-options {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
        padding: var(--space-md);
    }

    .match-option {
        padding: var(--space-sm);
        background: hsla(250, 30%, 15%, 0.3);
        border-radius: var(--radius-sm);
    }

    /* Powerful Features Mobile Fix */
    .section-heading {
        font-size: 1.75rem;
        margin-bottom: var(--space-xl);
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Horizontal layout for features on mobile */
    .feature-card {
        display: flex;
        align-items: flex-start;
        text-align: left;
        gap: var(--space-md);
        padding: var(--space-lg);
    }

    .feature-icon {
        margin: 0;
        width: 48px;
        height: 48px;
        flex-shrink: 0;
    }

    .feature-icon svg {
        width: 24px;
        height: 24px;
    }

    .feature-card h3 {
        margin-top: var(--space-xs);
        font-size: 1.1rem;
    }

    .feature-card p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: var(--space-md);
    }

    .upload-label {
        min-height: 140px;
        padding: var(--space-lg);
    }

    .radio-group {
        grid-template-columns: 1fr;
    }

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

/* ============================================
   Channel Mapping Styles
   ============================================ */

.channel-section {
    animation: fadeIn 0.4s ease;
}

.section-hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
    margin-top: calc(var(--space-sm) * -1);
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.extra-channels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    grid-column: 1 / -1;
    margin-top: var(--space-lg);
}

.extra-channels.hidden {
    display: none;
}

.show-more-channels {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: hsla(var(--secondary-hue), 70%, 50%, 0.05);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.show-more-channels:hover {
    background: hsla(var(--secondary-hue), 70%, 50%, 0.1);
    border-color: var(--secondary);
}

.show-more-channels .btn-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.channel-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
}

.channel-card:hover {
    border-color: var(--border-focus);
}

.channel-card.recommended {
    border-color: var(--primary);
    background: hsla(var(--primary-hue), 80%, 50%, 0.1);
}

.channel-card.selected {
    border-color: var(--secondary);
    background: hsla(var(--secondary-hue), 80%, 50%, 0.15);
    box-shadow: 0 0 15px hsla(var(--secondary-hue), 80%, 50%, 0.2);
    transform: translateY(-2px);
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.channel-name {
    font-weight: 600;
    font-size: 1rem;
}

.channel-badge {
    background: var(--gradient-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.channel-info {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.channel-stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.channel-stat svg {
    color: var(--text-muted);
}

.channel-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.channel-tag.poly {
    background: hsla(var(--accent-hue), 85%, 50%, 0.2);
    color: var(--accent);
}

.channel-lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.btn-text-action {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-text-action:hover {
    background: hsla(var(--secondary-hue), 70%, 50%, 0.1);
    color: var(--text-primary);
}

.channel-lyrics-input label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.channel-lyrics-input textarea {
    width: 100%;
    min-height: 80px;
    font-size: 0.875rem;
    background: hsla(250, 30%, 8%, 0.5);
}

/* Enhanced Preview Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.stat-item {
    background: var(--bg-input);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-item .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.stat-item .stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-item.highlight {
    background: hsla(var(--primary-hue), 80%, 50%, 0.15);
    border: 1px solid var(--primary);
}

.stat-value.good {
    color: hsl(140, 70%, 50%);
}

.stat-value.ok {
    color: hsl(45, 80%, 55%);
}

.stat-value.low {
    color: hsl(0, 70%, 55%);
}

.stat-section {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.stat-section-title {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.channel-pills {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.channel-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.channel-pill:hover {
    border-color: var(--secondary);
    background: hsla(var(--secondary-hue), 80%, 50%, 0.1);
}

.channel-pill.selected {
    background: hsla(var(--primary-hue), 80%, 50%, 0.2);
    border-color: var(--primary);
    color: var(--primary-light);
}

.channel-pill.custom {
    border-color: var(--accent);
}

.channel-pill .similarity {
    font-weight: 600;
    opacity: 0.8;
}

/* Enhanced Table Row Styles */
.preview-table .note-name {
    font-weight: 600;
    color: var(--primary-light);
}

.preview-table .note-midi {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preview-table .lyric-cell {
    font-weight: 500;
}

.preview-table .lyric-continue {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Word boundary indicators */
.preview-table tr.word-start td:last-child {
    position: relative;
    padding-left: var(--space-lg);
}

.preview-table tr.word-start td:last-child::before {
    content: '⌐';
    position: absolute;
    left: 6px;
    color: var(--secondary);
    opacity: 0.6;
}

.preview-table tr.word-end td:last-child::after {
    content: ' ⌐';
    color: var(--secondary);
    opacity: 0.6;
    transform: rotate(180deg);
    display: inline-block;
}

.preview-table tr.word-mid td:last-child {
    color: var(--text-secondary);
}

.preview-table .more-row td {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--space-md);
}

.more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

/* Match options checkboxes (if added later) */
.match-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    max-width: 1100px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.match-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.match-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Responsive channel grid */
@media (max-width: 640px) {
    .channel-grid {
        grid-template-columns: 1fr;
    }

    .channel-info {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Footer & Legal */
.footer {
    margin-top: var(--space-3xl);
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-width: 800px;
    margin: 0 auto;
}

.legal-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.disclaimer {
    background: hsla(0, 0%, 100%, 0.03);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: var(--space-sm);
}

.disclaimer strong {
    color: var(--text-secondary);
}

.license-info a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
}

.license-info a:hover {
    text-decoration: underline;
}