/* ============================================================================
   Writz Audiobook Studio - Main Stylesheet
   ============================================================================ */

/* CSS Variables */
:root {
    /* Colors - Dark Theme */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f26;
    --bg-tertiary: #242b33;
    --bg-card: #1e252d;
    --bg-input: #2a323c;
    --bg-hover: #323d4a;
    
    /* Accent Colors */
    --accent-primary: #8b5cf6;
    --accent-primary-hover: #7c3aed;
    --accent-secondary: #06b6d4;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    
    /* Border Colors */
    --border-primary: #334155;
    --border-secondary: #475569;
    
    /* Status Colors */
    --status-new: #64748b;
    --status-source: #06b6d4;
    --status-narrated: #8b5cf6;
    --status-chapters: #f59e0b;
    --status-qc: #f97316;
    --status-complete: #10b981;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Layout */
    --header-height: 60px;
    --footer-height: 36px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow: hidden;
}

/* Layout Structure */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    z-index: 100;
}

.app-main {
    position: fixed;
    top: var(--header-height);
    bottom: var(--footer-height);
    left: 0;
    right: 0;
    overflow: hidden;
}

.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    font-size: 12px;
    color: var(--text-muted);
}

/* Header Components */
.app-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-right: var(--space-xl);
}

.brand-icon {
    font-size: 24px;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tabs Navigation */
.app-tabs {
    display: flex;
    gap: var(--space-xs);
    flex: 1;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.tab-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-icon {
    font-size: 16px;
}

.tab-label {
    display: none;
}

@media (min-width: 900px) {
    .tab-label {
        display: inline;
    }
}

/* App Status */
.app-status {
    margin-left: auto;
}

.current-project {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tab Content */
.tab-content {
    display: none;
    height: 100%;
    overflow: hidden;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

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

.tab-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.tab-subtitle {
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.tab-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

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

.btn-secondary:hover {
    background: var(--bg-hover);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Projects List */
.projects-container {
    max-width: 1200px;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.project-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.project-card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.project-date {
    font-size: 12px;
    color: var(--text-muted);
}

.project-actions {
    display: flex;
    gap: var(--space-xs);
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.project-status.new { background: var(--status-new); color: white; }
.project-status.has_source { background: var(--status-source); color: white; }
.project-status.narrated { background: var(--status-narrated); color: white; }
.project-status.chapters_done { background: var(--status-chapters); color: var(--text-inverse); }
.project-status.qc_in_progress { background: var(--status-qc); color: white; }
.project-status.completed { background: var(--status-complete); color: white; }

.project-stats {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-primary);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Module Placeholder */
.module-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: var(--space-lg);
}

.module-placeholder h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.module-placeholder p {
    max-width: 400px;
    margin-bottom: var(--space-sm);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-md);
}

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

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

/* Footer */
.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

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

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.online {
    background: var(--accent-success);
}

.version {
    font-family: var(--font-mono);
    font-size: 11px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content.modal-sm {
    max-width: 380px;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-primary);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-hint {
    margin-top: var(--space-xs);
    font-size: 12px;
    color: var(--text-muted);
}

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

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--accent-success);
}

.toast.error {
    border-color: var(--accent-danger);
}

.toast-icon {
    font-size: 16px;
}

.toast-message {
    font-size: 13px;
}

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

/* Utility Classes */
.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--accent-success);
}

.text-danger {
    color: var(--accent-danger);
}

.text-danger {
    color: var(--accent-danger);
}

.text-success {
    color: var(--accent-success);
}

.hidden {
    display: none !important;
}

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

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

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

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

/* ============================================================================
   Narration Module Styles
   ============================================================================ */

.narrate-container {
    height: 100%;
}

.narrate-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--space-lg);
    height: calc(100% - 80px);
}

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

.narrate-settings,
.narrate-output {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

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

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

/* Source Status */
.source-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.source-status.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.source-status .status-icon {
    font-size: 18px;
}

/* Upload Area */
.upload-area {
    text-align: center;
    padding: var(--space-md);
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-md);
}

.upload-area p {
    margin-top: var(--space-sm);
    font-size: 12px;
}

/* Large Button */
.btn-large {
    width: 100%;
    padding: var(--space-md);
    font-size: 16px;
}

/* Narration Status */
.narration-status {
    text-align: center;
    padding: var(--space-xl);
}

.status-icon-large {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.narration-status p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.narration-status.error {
    color: var(--accent-danger);
}

/* Progress Bar Large */
.progress-container {
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar-large {
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-fill-large {
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Audio Player */
.audio-player-container {
    margin: var(--space-lg) 0;
}

.audio-player-container audio {
    width: 100%;
    border-radius: var(--radius-md);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Test Section */
#testText {
    resize: vertical;
    min-height: 60px;
    margin-bottom: var(--space-sm);
}

#testResult {
    margin-top: var(--space-md);
}

.test-loading {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
}

.test-error {
    color: var(--accent-danger);
    padding: var(--space-sm);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

/* ============================================================================
   Chapters Module Styles
   ============================================================================ */

.chapters-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
}

.chapters-layout {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .chapters-layout {
        grid-template-columns: 250px 1fr 250px;
    }
}

/* Chapters Sidebar */
.chapters-sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
}

.upload-template-area {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-primary);
}

.upload-section {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-primary);
}

.upload-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.upload-section .btn {
    margin-bottom: var(--space-xs);
}

.upload-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    text-align: center;
}

.chapters-list-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

.sidebar-actions {
    padding: var(--space-sm);
    border-top: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

/* Chapter Cards */
.chapter-card {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.chapter-card:hover {
    background: var(--bg-hover);
}

.chapter-card.selected {
    border-left-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.15);
}

.chapter-card.matched {
    border-left-color: var(--accent-success);
}

.chapter-card.unmatched {
    border-left-color: #b388ff;
    opacity: 0.7;
}

.ch-num {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.ch-name {
    font-weight: 600;
    font-size: 13px;
    margin: 2px 0;
}

.ch-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-success);
}

.ch-preview {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-info {
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    display: inline-block;
}

.match-info.good { color: var(--accent-success); }
.match-info.partial { color: var(--accent-warning); }
.match-info.none { color: #b388ff; }

/* Text Panel */
.text-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

.text-toolbar {
    padding: var(--space-sm);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.text-toolbar input {
    flex: 1;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

.text-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
    font-size: 14px;
    line-height: 1.8;
}

.text-line {
    display: flex;
    padding: 2px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.text-line:hover {
    background: rgba(255, 255, 255, 0.05);
}

.text-line.chapter-start {
    background: rgba(139, 92, 246, 0.3);
    border-left: 3px solid var(--accent-primary);
    margin: var(--space-sm) 0;
    padding-left: var(--space-sm);
}

.text-line.highlighted {
    background: rgba(16, 185, 129, 0.15);
}

.line-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
    padding-right: var(--space-md);
    user-select: none;
}

.line-text {
    flex: 1;
}

.line-text.empty {
    min-height: 1.5em;
}

.part-header {
    background: var(--bg-card);
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-md) 0;
    border-left: 4px solid var(--accent-secondary);
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-secondary);
}

/* Edit Panel */
.edit-panel {
    background: var(--bg-card);
    border-left: 1px solid var(--border-primary);
    padding: var(--space-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.edit-chapter-name {
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tips-list {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: var(--space-md);
    margin: 0;
}

.tips-list li {
    margin-bottom: var(--space-xs);
}

.tip-green { color: var(--accent-success); }
.tip-purple { color: #b388ff; }

/* Chapter Player Footer */
.chapter-player {
    background: var(--bg-card);
    border-top: 2px solid var(--accent-primary);
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    height: 60px;
}

.player-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-success);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-btn:hover {
    background: #00ff7f;
}

.player-info {
    min-width: 180px;
}

.player-title {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-time {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.seek-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.seek-progress {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    width: 0;
    transition: width 0.1s;
}

/* Format Select */
.format-select {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
}

/* Button Variations */
.btn-success {
    background: var(--accent-success);
    color: var(--text-inverse);
}

.btn-success:hover {
    background: #00ff7f;
}

.btn-small {
    padding: var(--space-xs) var(--space-sm);
    font-size: 12px;
}

/* Audio Info */
.audio-info p {
    margin-bottom: var(--space-xs);
    font-size: 13px;
}

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

.audio-file-info {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.audio-file-info.primary {
    border-left: 3px solid var(--accent-success);
}

.audio-file-name {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: var(--space-xs);
    word-break: break-all;
}

.audio-file-details {
    display: flex;
    gap: var(--space-sm);
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.audio-ext {
    background: var(--accent-primary);
    color: white;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 10px;
}

.audio-files-more {
    font-size: 11px;
    color: var(--text-muted);
    padding: var(--space-xs) 0;
}

.audio-stats {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-primary);
}

.audio-stats p {
    margin-bottom: var(--space-xs);
    font-size: 12px;
}

/* Text alignment utilities */
.text-center {
    text-align: center;
}

/* ============================================================================
   QC/Editor Module Styles
   ============================================================================ */

.qc-container {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
}

.qc-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.qc-sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-primary);
    padding: var(--space-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.qc-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Karaoke Text Container */
.karaoke-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-primary);
}

.karaoke-text {
    font-size: 18px;
    line-height: 2;
    text-align: justify;
}

.karaoke-paragraph {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
}

.karaoke-paragraph:last-child {
    border-bottom: none;
}

.karaoke-word {
    display: inline;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.karaoke-word:hover {
    background: rgba(255, 255, 255, 0.1);
}

.karaoke-word.current {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

.karaoke-word.flagged {
    background: rgba(239, 68, 68, 0.3);
    border-bottom: 2px solid var(--accent-danger);
}

.karaoke-word.flagged.current {
    background: var(--accent-danger);
}

/* QC Player */
.qc-player {
    background: var(--bg-card);
    border-top: 2px solid var(--accent-primary);
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    height: 60px;
}

.speed-select {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    min-width: 60px;
}

/* Flagged Words List */
.flagged-words-list {
    max-height: 200px;
    overflow-y: auto;
    margin: var(--space-sm) 0;
}

.flagged-word-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    font-size: 12px;
}

.flagged-word-item:hover {
    background: var(--bg-hover);
}

.flagged-word-text {
    flex: 1;
    font-weight: 500;
    color: var(--accent-danger);
}

.flagged-word-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.flagged-word-reason {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: capitalize;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-icon-small {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    opacity: 0.6;
}

.btn-icon-small:hover {
    opacity: 1;
}

.flagged-nav {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

/* Context Menu */
.context-menu {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 160px;
    overflow: hidden;
}

.context-menu-header {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid var(--border-primary);
}

.context-menu-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    font-size: 13px;
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

/* ============================================================================
   Voices Module Styles
   ============================================================================ */

.voices-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: var(--space-lg);
    padding: var(--space-lg);
}

.create-voice-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.voice-library {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.upload-zone {
    text-align: center;
    padding: var(--space-md);
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
}

.file-info {
    background: var(--bg-input);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    margin: var(--space-sm) 0;
    font-size: 12px;
}

.file-info p {
    margin: var(--space-xs) 0;
}

.analysis-box {
    min-height: 60px;
    margin: var(--space-md) 0;
}

.analysis-results p {
    margin: var(--space-xs) 0;
    font-size: 13px;
}

.analysis-results .success {
    color: var(--accent-success);
}

.analysis-results .error {
    color: var(--accent-danger);
}

.analysis-results .warning {
    color: var(--accent-warning);
}

.voices-list {
    max-height: 400px;
    overflow-y: auto;
}

.voice-group {
    margin-bottom: var(--space-md);
}

.voice-group h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-primary);
}

.voices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-sm);
}

.voice-card {
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    transition: all 0.2s ease;
}

.voice-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.voice-card.custom {
    border-left: 3px solid var(--accent-primary);
}

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

.voice-name {
    font-weight: 600;
    font-size: 13px;
}

.voice-gender {
    font-size: 14px;
}

.voice-gender.female {
    color: #ec4899;
}

.voice-gender.male {
    color: #3b82f6;
}

.voice-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
}

.voice-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.voice-card-actions {
    display: flex;
    gap: var(--space-xs);
    justify-content: flex-end;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-muted);
}

/* ============================================================================
   Settings Module Styles
   ============================================================================ */

.settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    padding: var(--space-lg);
    max-width: 1200px;
}

.settings-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.checkbox-group {
    margin: var(--space-sm) 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 13px;
}

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

.settings-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-primary);
}

.system-info-grid {
    display: grid;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    font-family: var(--font-mono);
}

.deps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs);
}

.dep-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.dep-item.available {
    border-left: 2px solid var(--accent-success);
}

.dep-item.missing {
    border-left: 2px solid var(--accent-danger);
    opacity: 0.7;
}

/* ============================================================================
   Auto Narrate Tab Styles
   ============================================================================ */

.auto-container {
    height: 100%;
    padding: var(--space-md);
}

.auto-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-lg);
    height: 100%;
}

.auto-upload-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auto-status-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.epub-drop-zone {
    border: 2px dashed var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epub-drop-zone:hover,
.epub-drop-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.05);
}

.drop-zone-content {
    text-align: center;
}

.drop-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.drop-zone-content h3 {
    margin: 0 0 var(--space-xs);
    color: var(--text-primary);
}

.drop-zone-content p {
    margin: 0;
    color: var(--text-muted);
}

.upload-success {
    text-align: center;
}

.upload-success .success-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.upload-success h3 {
    margin: 0 0 var(--space-xs);
    color: var(--text-primary);
}

.upload-success p {
    margin: 0 0 var(--space-md);
    color: var(--text-muted);
}

.book-stats {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.book-stats span {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.how-it-works {
    margin: 0;
    padding-left: var(--space-lg);
    color: var(--text-secondary);
}

.how-it-works li {
    margin-bottom: var(--space-xs);
    font-size: 13px;
}

/* Analysis Results */
.analysis-complete h4 {
    margin: 0 0 var(--space-md);
}

.estimate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

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

.estimate-item.highlight {
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid var(--accent-primary);
}

.estimate-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.estimate-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.issues-summary h4 {
    color: var(--accent-warning);
    margin: var(--space-md) 0 var(--space-sm);
}

.issues-summary ul {
    margin: 0;
    padding-left: var(--space-lg);
}

.issues-summary li {
    margin-bottom: var(--space-xs);
    font-size: 13px;
}

.issue-word {
    font-family: var(--font-mono);
    background: rgba(239, 68, 68, 0.2);
    padding: 1px 4px;
    border-radius: 2px;
    color: var(--accent-danger);
}

/* RunPod Status */
.runpod-status {
    margin-bottom: var(--space-md);
}

.status-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.online {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.status-indicator.offline {
    background: var(--accent-danger);
}

.runpod-controls {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* Progress View */
.progress-view {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.job-progress {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--border-primary);
}

.progress-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.status-icon {
    font-size: 32px;
}

.status-message {
    font-size: 20px;
    font-weight: 600;
}

.current-chapter-title {
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.progress-bar-container {
    margin-bottom: var(--space-lg);
}

.progress-bar-large {
    height: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.progress-fill-large {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    transition: width 0.3s ease;
}

.chapters-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: var(--space-lg);
}

.chapter-status {
    font-size: 16px;
}

.chapter-status.current {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
}

.error-message {
    margin: var(--space-md) 0;
}

.complete-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-lg);
}

/* ============================================================================
   Review Tab Styles
   ============================================================================ */

.review-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.review-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.review-header h2 {
    margin: 0 0 var(--space-xs);
    font-size: 28px;
}

.review-header .author {
    color: var(--text-muted);
    font-size: 16px;
}

.review-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-primary);
}

.review-section h3 {
    margin: 0 0 var(--space-md);
    font-size: 16px;
}

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

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

.summary-item .label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.summary-item .value {
    font-size: 18px;
    font-weight: 600;
}

.summary-item.highlight {
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid var(--accent-primary);
}

.chapters-review-list {
    max-height: 400px;
    overflow-y: auto;
}

.chapter-review-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.chapter-review-item:hover {
    background: var(--bg-input);
}

.chapter-review-item.front-matter,
.chapter-review-item.back-matter {
    opacity: 0.6;
}

.chapter-review-item label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    cursor: pointer;
}

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

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

.chapter-words {
    font-size: 12px;
    color: var(--text-muted);
}

.badge-muted {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.issues-review-list {
    max-height: 300px;
    overflow-y: auto;
}

.issue-review-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

.issue-number {
    font-size: 10px;
    color: var(--text-muted);
    min-width: 24px;
}

.issue-arrow {
    color: var(--text-muted);
}

.issue-suggestion {
    color: var(--accent-success);
    font-family: var(--font-mono);
}

.issue-source {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
}

.review-actions {
    display: flex;
    justify-content: space-between;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-primary);
    margin-top: var(--space-lg);
}

.btn-large {
    padding: var(--space-md) var(--space-xl);
    font-size: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-xxl);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    margin: 0 0 var(--space-sm);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* Spinner */
.analyzing {
    text-align: center;
    padding: var(--space-lg);
}

.upload-progress {
    text-align: center;
}

/* Mode Toggle */
.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.mode-btn.active {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.1);
}

.mode-icon {
    font-size: 24px;
    margin-bottom: var(--space-xs);
}

.mode-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.mode-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Status Grid */
.status-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.status-item {
    font-size: 13px;
}

/* Mode Badge in Progress */
.mode-badge {
    margin-left: auto;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

/* Issue Editing Styles */
.issue-review-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
    transition: all var(--transition-fast);
}

.issue-review-item.resolved {
    background: rgba(34, 197, 94, 0.1);
    border-left: 3px solid var(--success);
}

.issue-review-item.ignored {
    background: rgba(100, 100, 100, 0.1);
    border-left: 3px solid var(--text-muted);
    opacity: 0.7;
}

.issue-number {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 30px;
}

.issue-word {
    font-weight: 600;
    color: var(--warning);
}

.issue-word.resolved-word {
    color: var(--text-muted);
}

.issue-arrow {
    color: var(--text-muted);
}

.issue-suggestion {
    color: var(--success);
}

.issue-correction {
    color: var(--success);
    font-weight: 600;
}

.issue-status {
    margin-left: auto;
    font-size: 12px;
}

.issue-status.ignored-status {
    color: var(--text-muted);
}

.issue-actions {
    display: flex;
    gap: var(--space-xs);
    margin-left: auto;
}

.btn-icon-small {
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.btn-icon-small:hover {
    background: var(--bg-card);
    border-color: var(--border-primary);
}

.btn-icon-small.btn-success:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--success);
}

.issue-edit-input {
    padding: 4px 8px;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 150px;
}

.issue-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

/* Logout Button */
.logout-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #ff6b6b;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 15px;
    transition: all 0.3s;
}
.logout-btn:hover {
    background: rgba(231, 76, 60, 0.4);
    border-color: #ff6b6b;
}

/* Account Button */
.account-btn {
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.5);
    color: #5dade2;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-left: 15px;
    text-decoration: none;
    transition: all 0.3s;
}
.account-btn:hover {
    background: rgba(52, 152, 219, 0.4);
    border-color: #5dade2;
}


/* === FIX_ALL AUTO-APPENDED === */


/* ============================================================
   FIX: aliases for --success / --warning (used in JS styles)
   ============================================================ */
:root {
    --success: #10b981;   /* same as --accent-success */
    --warning: #f59e0b;   /* same as --accent-warning */
}

/* ============================================================
   FIX: .form-label  (used on every <label> in HTML)
   ============================================================ */
.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ============================================================
   FIX: .form-select  (used on every <select> in HTML)
   ============================================================ */
.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ============================================================
   FIX: .form-input  (used on every <input> / <textarea> in HTML)
   ============================================================ */
.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color var(--transition-fast);
}
.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
textarea.form-input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ============================================================
   FIX: .card-title  (used on every card heading in HTML)
   ============================================================ */
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-md) 0;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ============================================================
   FIX: .text-center
   ============================================================ */
.text-center {
    text-align: center;
}

/* ============================================================
   FIX: .checkbox-group  (also ensure it covers the HTML usage)
   ============================================================ */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: var(--space-sm) 0;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================================
   FIX: .modal-dialog  AND  .modal-content — both need to work.
   voices.js injects .modal-content; shell.html uses .modal-dialog.
   Give them the same visual treatment.
   ============================================================ */
.modal-dialog,
.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    min-width: 360px;
    max-width: 520px;
    width: 100%;
    z-index: 1;
}
/* voice tester modal is wider */
#voice-test-modal .modal-content {
    max-width: 560px;
}
/* quick phrases inside voice tester */
.quick-phrases {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}
.quick-phrases .btn {
    font-size: 12px;
    padding: var(--space-xs) var(--space-sm);
}

/* ============================================================
   FIX: QC interface — needs display:flex when active, not block
   The tab-content.active rule sets display:block globally.
   Override for the qc-interface inner div.
   ============================================================ */
#qc-interface {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}
#qc-interface.visible {
    display: flex;
}

/* ============================================================
   FIX: chapters-interface same issue
   ============================================================ */
#chapters-interface {
    display: none;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}
#chapters-interface.visible {
    display: flex;
}

/* ============================================================
   FIX: narrate-interface — hidden until project selected
   ============================================================ */
#narrate-interface {
    display: none;
}
#narrate-interface.visible {
    display: block;
}

/* ============================================================
   FIX: .status-row  — make sure it works outside auto panel too
   ============================================================ */
.status-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 13px;
}
.status-row.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ============================================================
   FIX: voice section headers inside Voices tab
   ============================================================ */
.voice-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 var(--space-xs);
    color: var(--text-primary);
}
.voice-section {
    margin-bottom: var(--space-xl);
}

/* ============================================================
   FIX: .btn-sm  (used in voice tester quick phrases)
   ============================================================ */
.btn-sm,
.btn.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: 12px;
}

/* ============================================================
   FIX: account-btn display (make it an inline-flex button look)
   ============================================================ */
.account-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   FIX: empty-icon (used in Review + Projects empty states)
   ============================================================ */
.empty-icon {
    font-size: 56px;
    margin-bottom: var(--space-md);
    display: block;
}

/* ============================================================
   FIX: karaoke-paragraph line-height for readability
   ============================================================ */
.karaoke-paragraph {
    line-height: 2.2;
    margin-bottom: var(--space-lg);
}

/* ============================================================
   FIX: chapter select dropdown inside QC chapter nav
   ============================================================ */
#chapterSelect {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}
#chapterSelect:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ============================================================
   FIX: chapterSearchInput width on small screens
   ============================================================ */
#chapterSearchInput.form-input {
    width: 140px;
    padding: 4px 8px;
    font-size: 12px;
}

/* ============================================================
   FIX: voices tab grid layout (HTML uses 1fr 360px but CSS
   defines voices-layout as 360px 1fr — reversed)
   ============================================================ */
#voices-tab > div {
    display: flex;
    flex-direction: column;
}

/* ============================================================
   FIX: progress bar text-align on narrate tab
   ============================================================ */
#narrationProgressFill {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   FIX: system-info-grid inside Settings tab
   ============================================================ */
.system-info-grid .info-item {
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-primary);
}
.system-info-grid .info-item:last-child {
    border-bottom: none;
}

/* ============================================================
   POLISH: tab content overflow for inner scrollable tabs
   ============================================================ */
#auto-tab,
#review-tab,
#narrate-tab,
#chapters-tab,
#qc-tab,
#voices-tab,
#multi-speaker-tab,
#settings-tab {
    overflow: hidden;
}

/* === END FIX_ALL === */
