:root {
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #a78bfa;
    --accent-hover: #c084fc;
    --text-main: #f8fafc;
    --text-dim: #cbd5e1;
    --bg-dark: #0f172a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2vh;
    overflow-x: hidden;
}

/* Background Layer */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: url('gandalf.png');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    /* Reduced global blob opacity */
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    right: -100px;
    opacity: 0.3;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    bottom: -50px;
    left: -50px;
    opacity: 0.3;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #db2777;
    top: 35%;
    /* Moved slightly up */
    left: 25%;
    /* Moved slightly left */
    opacity: 0.15;
    /* Significantly reduced to show face */
}

/* Container */
.wizard-container {
    width: 95%;
    max-width: 1000px;
    z-index: 1;
}

.wizard-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.wizard-header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    opacity: 0.8;
}

/* Steps Indicator */
.steps-indicator {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 45vh;
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    padding: 0.6rem;
    border-radius: 100px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.step {
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 0.4rem 1.2rem;
    border-radius: 100px;
    transition: all 0.3s ease;
}

.step.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.2);
}

/* Glass Card */
.glass-card {
    background: rgba(255, 255, 255, 0.01);
    /* Even more transparent */
    backdrop-filter: blur(5px);
    /* Reduced blur for clarity */
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.2rem 2rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
}

.main-card h2 {
    margin-bottom: 0.5rem;
}

.main-card p {
    color: var(--text-dim);
    margin-bottom: 2rem;
}

/* Selection Options */
.input-options {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
}

.option-card {
    flex: 1;
    background: #141e22;
    /* User requested color */
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-card:hover {
    background: #404542;
    /* User requested hover color */
    transform: translateY(-5px);
    border-color: var(--accent);
}

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.option-card h3 {
    margin-bottom: 0.5rem;
}

.option-card p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.option-separator {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    font-weight: 600;
}

/* YouTube Input Group */
.yt-input-group {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input[type="text"] {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    outline: none;
    width: 100%;
}

input[type="text"]:focus {
    border-color: var(--accent);
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

/* Specific override for Process button */
#btn-yt-process {
    background: #141e22;
    color: white;
    border: 1px solid var(--glass-border);
}

#btn-yt-process:hover {
    background: #404542;
}

/* Step 5: Final Render Victory View */
.render-success-view {
    text-align: center;
    padding: 2rem;
    animation: fadeInScaleUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px var(--accent));
    animation: bounce 2s infinite ease-in-out;
}

.render-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

@keyframes fadeInScaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* --- Redesigned Lyrics Editor (White Glove) --- */
.whisper-editor-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    color: #333;
    overflow: hidden;
    margin: 2rem auto;
    max-width: 1000px;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.editor-header-strip {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.editor-content {
    padding: 2rem;
}

/* Stats Dashboard */
.stats-dashboard {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Editor Sections */
.editor-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Full Text Area */
.white-editor-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
    background: #fff;
    color: #333;
    margin-bottom: 1rem;
}

.white-editor-textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Word Grid */
.white-words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.white-word-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
}

.white-word-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.white-word-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    background: #fff;
    margin-bottom: 8px;
}

.white-word-input:focus {
    outline: none;
    border-color: #667eea;
}

.white-word-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Footer Actions */
.editor-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

/* Status Box */
.status-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hidden {
    display: none;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Wizard Steps Visibility */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

/* Step 2: Lyrics Progress & Paste */
.lyrics-source-options {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
}

.loader-large {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.paste-lyrics-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

textarea {
    flex: 1;
    min-height: 200px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    resize: none;
    outline: none;
}

textarea:focus {
    border-color: var(--accent);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Step 3: Editor */
.editor-card {
    padding: 2rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.editor-actions {
    display: flex;
    gap: 1rem;
}

.editor-workspace {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.lyrics-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    line-height: 2;
}

.word-block {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 0.3rem 0.6rem;
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.word-block:hover {
    background: rgba(167, 139, 250, 0.2);
    border-color: var(--accent);
}

.word-block .word-text {
    font-weight: 600;
}

.word-block .word-time {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.editor-controls {
    margin-top: 1.5rem;
    text-align: center;
}

.hint {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-style: italic;
}

.btn-icon {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
}