@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --surface: #ffffff;
    --surface-elevated: #f8fafc;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-strong: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --accent-dark: #1d4ed8;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ===== HEADER ===== */
.header {
    margin-bottom: 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 3rem;
    height: 3rem;
    background: var(--gradient-accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
}

.logo-text h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===== CONTENT SELECTOR ===== */
.content-selector {
    margin-bottom: 2rem;
}

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

.selector-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--surface);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.selector-header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.content-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.option-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
    transform: scale(1);
}

.option-card:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.option-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--surface) 100%);
    box-shadow: 0 0 0 3px var(--accent-light);
    transform: scale(1.02);
}

.option-card.featured {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--surface) 0%, var(--accent-light) 100%);
}

.option-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
}

.option-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--gradient-accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.option-card:hover .option-icon {
    transform: scale(1.1);
}

.option-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.option-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.875rem;
}

.option-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.feature {
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.option-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-accent);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    z-index: 10;
}

/* ===== HOVER PREVIEWS ===== */
.hover-preview {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    margin-left: 1.5rem;
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--animation-bounce);
    z-index: 100;
    min-width: 280px;
    max-width: 320px;
}

.option-card:hover .hover-preview {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(10px);
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Podcast Preview Steps */
.preview-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--surface-elevated);
    border-radius: var(--radius);
    transition: var(--transition);
}

.preview-step:hover {
    background: var(--accent-light);
    transform: translateX(5px);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.step-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Text Input Preview Demo */
.preview-demo {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.demo-input,
.demo-output {
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.demo-input {
    background: var(--surface-elevated);
}

.demo-output {
    background: var(--success-light);
    border-color: var(--success);
}

.demo-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.demo-text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.demo-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: bold;
}

/* File Upload Preview Formats */
.preview-formats {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.format-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: var(--surface-elevated);
    border-radius: var(--radius);
    transition: var(--transition);
    flex: 1;
}

.format-item:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.format-icon {
    font-size: 1.5rem;
}

.format-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-process {
    padding: 0.75rem;
    background: var(--accent-light);
    border-radius: var(--radius);
    text-align: center;
}

.process-step {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-dark);
}

/* Responsive adjustments for hover previews */
@media (max-width: 1024px) {
    .hover-preview {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-left: 0;
        max-width: 90vw;
    }
    
    .option-card:hover .hover-preview {
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 768px) {
    .hover-preview {
        display: none;
    }
}

/* ===== MAIN CONTENT ===== */
.main-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.tab-content {
    display: none;
    animation: fadeInUp 0.5s var(--animation-bounce);
}

.tab-content.active {
    display: block;
}

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



/* ===== WORKFLOW PANELS ===== */
.workflow-container {
    position: relative;
}

.workflow-panel,
.simple-workflow {
    display: none;
    padding: 3rem;
}

.workflow-panel.active,
.simple-workflow {
    display: block;
    animation: slideIn 0.5s var(--animation-bounce);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.panel-icon {
    width: 4rem;
    height: 4rem;
    background: var(--gradient-accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow);
}

.panel-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* ===== FORMS ===== */
.form-section {
    margin-bottom: 2.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.optional {
    color: var(--text-tertiary);
    font-weight: 400;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.auto-growing-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    resize: none;
    overflow: hidden;
    font-family: inherit;
    min-height: 120px;
}

.auto-growing-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ===== FILE UPLOAD ===== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface-elevated);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
}

.file-input {
    display: none;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    color: var(--text-tertiary);
}

.upload-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.upload-content p {
    color: var(--text-secondary);
    margin: 0;
}

.upload-link {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}

.supported-formats {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.format-tag {
    background: var(--border-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.file-preview {
    background: var(--success-light);
    border: 1px solid var(--success);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

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

.file-details svg {
    color: var(--success);
}

.file-details div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

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

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn.secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn.secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

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

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

.auth-btn {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
}

.settings-btn {
    width: 3rem;
    height: 3rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: rotate(45deg);
}

/* ===== PANEL ACTIONS ===== */
.panel-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

.analysis-progress .panel-actions,
.generation-progress .panel-actions {
    justify-content: center;
    margin-top: 2rem;
}

/* ===== EPISODES & TOPICS GRID ===== */
.episodes-grid,
.topics-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.episode-card,
.topic-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.episode-card:hover,
.topic-card:hover {
    border-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.episode-card.selected,
.topic-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: var(--shadow);
}

.episode-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.episode-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.episode-date {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ===== ANALYSIS PROGRESS ===== */
.analysis-progress,
.generation-progress {
    text-align: center;
    padding: 3rem 2rem;
}

.progress-animation {
    margin-bottom: 2rem;
}

.progress-circle {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.progress-svg {
    transform: rotate(-90deg);
}

.progress-bar {
    animation: progressAnimation 3s ease-in-out infinite;
}

@keyframes progressAnimation {
    0%, 100% {
        stroke-dashoffset: 314;
    }
    50% {
        stroke-dashoffset: 0;
    }
}

.progress-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
}

.generation-animation {
    margin-bottom: 2rem;
}

.typing-indicator {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 2rem;
}

.typing-dot {
    width: 0.75rem;
    height: 0.75rem;
    background: var(--accent);
    border-radius: 50%;
    animation: typingAnimation 1.5s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* ===== RESULTS SECTION ===== */
.results-section {
    padding: 3rem;
    border-top: 1px solid var(--border);
}

.results-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    background: var(--success-light);
    color: var(--success);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow);
}

.results-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.results-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

/* ===== CONTENT EDITOR ===== */
.content-editor {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.editor-field {
    position: relative;
}

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

.field-header label {
    font-weight: 600;
    color: var(--text-primary);
}

.copy-btn {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.content-textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--surface);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    resize: vertical;
    font-family: inherit;
}

.content-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.title-field {
    font-weight: 600;
    font-size: 1.125rem;
}

.content-editor-rich {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    line-height: 1.6;
    transition: var(--transition);
}

.content-editor-rich:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ===== IMAGE SECTION ===== */
.image-section {
    display: flex;
    flex-direction: column;
}

.image-wrapper {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background: var(--surface-elevated);
}

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

.image-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.image-container {
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ===== RESULTS ACTIONS ===== */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== LOADING & STATUS ===== */
.loading-spinner {
    display: none;
    margin: 2rem auto;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-weight: 500;
    display: none;
}

.status-message.info {
    background: var(--accent-light);
    color: var(--accent-dark);
    border: 1px solid var(--accent);
}

.status-message.success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-message.error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: var(--surface);
    margin: 5% auto;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s var(--animation-bounce);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .results-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .image-section {
        order: -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem;
    }

    .logo {
        justify-content: center;
    }

    .selector-header h2 {
        font-size: 1.5rem;
    }

    .selector-header p {
        font-size: 0.9rem;
    }

    .content-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin: 0;
    }

    .option-card {
        padding: 1rem;
    }

    .option-icon {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .option-content h3 {
        font-size: 1rem;
    }

    .option-content p {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .progress-steps {
        padding: 1rem;
    }

    .progress-step {
        min-width: 80px;
    }

    .progress-step span {
        font-size: 0.75rem;
    }

    .workflow-panel,
    .simple-workflow,
    .results-section {
        padding: 1.5rem 1rem;
    }

    .panel-header {
        flex-direction: row;
        text-align: left;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .panel-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
        flex-shrink: 0;
    }

    .panel-header h2 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .panel-header p {
        font-size: 0.9rem;
    }

    .panel-actions {
        flex-direction: row;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .panel-actions .btn {
        flex: 1;
        min-width: 120px;
    }

    .episodes-grid,
    .topics-container {
        grid-template-columns: 1fr;
    }

    .results-actions {
        flex-direction: column;
    }

    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .selector-header h2 {
        font-size: 1.5rem;
    }

    .selector-header p {
        font-size: 1rem;
    }

    .option-card {
        padding: 1.5rem;
    }

    .panel-header h2 {
        font-size: 1.5rem;
    }

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

    /* Mobile modal improvements */
    .modal {
        padding: 1rem;
    }

    .modal-content {
        margin: 0;
        padding: 1.5rem;
        width: 100%;
        max-width: none;
        border-radius: var(--radius);
        max-height: calc(100vh - 2rem);
        min-height: auto;
    }

    .modal-header {
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    /* Improve textarea sizing on mobile */
    .auto-growing-textarea {
        min-height: 100px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Better button spacing in modals */
    .modal .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 44px; /* Better touch target */
    }
}

/* ===== SCROLL LOCK UTILITIES ===== */
.scroll-lock {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

.scroll-lock-ios {
    position: fixed !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 100% !important;
}

/* Prevent elastic bounce on iOS */
.modal,
.modal-content {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Legacy support for existing JavaScript */
.status { @extend .status-message; }
.loader { @extend .loading-spinner; }
.episode-grid { @extend .episodes-grid; }
.results-container { @extend .topics-container; }
.steps-container { @extend .progress-indicator; }
.step { @extend .progress-step; }
.step-number { @extend .step-circle; }
.step-title { @extend .progress-step span; }
.content-panel { @extend .workflow-panel; }
.panel { @extend .workflow-panel; }
.auto-growing-textarea { @extend .content-textarea; }
.editable-content { @extend .content-textarea; }
.file-upload-area { @extend .upload-zone; }
.file-info { @extend .file-preview; }
.action-buttons { @extend .panel-actions; }
.output-field-group { @extend .editor-field; }