:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --success: #22c55e;
    --error: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --accent: #ffc832;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.step {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input[type="url"],
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn.primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

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

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.download {
    background: var(--success);
    color: white;
    text-decoration: none;
    display: inline-block;
}

.loading {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

.error {
    color: var(--error);
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: 8px;
    margin-top: 1rem;
}

.feed-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.episodes-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.episode-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.episode-item:hover {
    background: var(--background);
}

.episode-title {
    font-weight: 500;
}

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

#waveform-container {
    width: 100%;
    height: 150px;
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
}

#waveform-timeline {
    width: 100%;
    height: 30px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-top: 4px;
}

.clip-controls {
    margin: 1rem 0;
    display: flex;
    gap: 0.5rem;
}

.clip-info {
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    margin: 1rem 0;
}

.clip-info p {
    margin: 0.25rem 0;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.transcript-editor {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
}

.word-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.word-item input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.word-item .timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
}

.aspect-selector {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.aspect-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.bg-preview {
    margin: 1rem 0;
}

#preview-canvas {
    max-width: 100%;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.color-options {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
}

.color-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

#final-preview {
    max-width: 100%;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: #000;
}

.preview-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.export-progress {
    text-align: center;
    padding: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.export-complete {
    text-align: center;
    padding: 1rem;
}

.word-active {
    background: rgba(255, 200, 50, 0.2);
    border-left: 3px solid var(--accent);
}

.word-past {
    opacity: 1;
}

.word-future {
    opacity: 0.5;
}