/* ============================================ */
/* MAIN-APP MODERN REDESIGN STYLES             */
/* Two-column layout with clickable selectors  */
/* ============================================ */

/* ============================================ */
/* LAYOUT                                       */
/* ============================================ */

.analysis-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.analysis-config-column {
    transition: all 0.4s ease;
}

.analysis-config-column.hidden {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.analysis-upload-column {
    transition: all 0.4s ease;
}

/* Full width when config hidden */
.analysis-layout.processing .analysis-upload-column {
    grid-column: 1 / -1;
}

/* Hide config column when ready to analyze (file uploaded, waiting for analysis) */
.analysis-layout.ready-to-analyze .analysis-config-column,
.transcription-header-row.ready-to-analyze .analysis-config-column {
    opacity: 0 !important;
    transform: translateX(-20px) !important;
    pointer-events: none !important;
    position: absolute !important;
    visibility: hidden !important;
}

.analysis-layout.ready-to-analyze .analysis-upload-column,
.transcription-header-row.ready-to-analyze .upload-card {
    grid-column: 1 / -1 !important;
}

/* CSS-only fallback: Hide config when Step 2 (Processing) is visible */
.transcription-header-row:has(#uploadStep2[style*="block"]) .analysis-config-column,
.transcription-header-row:has(#uploadStep2:not([style*="none"])[style]) .analysis-config-column {
    opacity: 0 !important;
    transform: translateX(-20px) !important;
    pointer-events: none !important;
    position: absolute !important;
    visibility: hidden !important;
}

.transcription-header-row:has(#uploadStep2[style*="block"]) .upload-card,
.transcription-header-row:has(#uploadStep2:not([style*="none"])[style]) .upload-card {
    grid-column: 1 / -1 !important;
}

/* CSS-only fallback: Hide config when Step 3 (Ready to Analyze) is visible */
.transcription-header-row:has(#uploadStep3[style*="block"]) .analysis-config-column,
.transcription-header-row:has(#uploadStep3:not([style*="none"])[style]) .analysis-config-column {
    opacity: 0 !important;
    transform: translateX(-20px) !important;
    pointer-events: none !important;
    position: absolute !important;
    visibility: hidden !important;
}

.transcription-header-row:has(#uploadStep3[style*="block"]) .upload-card,
.transcription-header-row:has(#uploadStep3:not([style*="none"])[style]) .upload-card {
    grid-column: 1 / -1 !important;
}

/* ============================================ */
/* READY TO ANALYZE - ENHANCED VISUAL STATE    */
/* ============================================ */

/* Center the upload card vertically when in ready-to-analyze state */
.transcription-header-row.ready-to-analyze,
.transcription-header-row:has(#uploadStep3[style*="block"]),
.transcription-header-row:has(#uploadStep3:not([style*="none"])[style]) {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: calc(100vh - 200px) !important;
}

/* Enhanced card styling when ready to analyze */
.transcription-header-row.ready-to-analyze .upload-card,
.transcription-header-row:has(#uploadStep3[style*="block"]) .upload-card,
.transcription-header-row:has(#uploadStep3:not([style*="none"])[style]) .upload-card {
    max-width: 800px !important;
    width: 100% !important;
    margin: 0 auto !important;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(226, 232, 240, 0.8) !important;
    animation: cardEntranceReady 0.5s ease-out !important;
}

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

/* Enhanced ready container styling */
.ready-container-modern {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    position: relative;
    transition: all 0.3s ease;
}

.ready-container-modern:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Enhanced file preview thumbnail */
.ready-container-modern .text-preview-thumbnail {
    position: relative;
    width: 180px;
    height: 220px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

/* Document lines pattern for thumbnail */
.ready-container-modern .text-preview-content {
    padding: 16px;
    font-size: 7px;
    line-height: 1.6;
    color: #94a3b8;
    font-family: 'SF Mono', 'Monaco', monospace;
}

/* Fade overlay at bottom of preview */
.ready-container-modern .text-preview-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, #f8fafc);
    pointer-events: none;
}

/* File info section */
.ready-file-info {
    flex: 1;
    min-width: 0;
}

.ready-filename {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    line-height: 1.4;
    word-break: break-word;
}

/* Enhanced metadata row */
.ready-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
}

/* Word count group - hidden by default via inline style, can be shown if needed */
.ready-meta .word-count-group {
    display: none;
    align-items: center;
    gap: 8px;
}

.ready-separator {
    color: #cbd5e1;
    font-weight: 300;
}

/* Enhanced Ready to analyze badge */
.ready-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

.ready-status-badge svg {
    color: #22c55e;
}

/* Enhanced remove/close button */
.remove-file-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.remove-file-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
    transform: scale(1.05);
}

.remove-file-btn:active {
    transform: scale(0.95);
}

/* Dark theme support for ready state */
.dark-theme .ready-container-modern {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark-theme .ready-container-modern .text-preview-thumbnail {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark-theme .ready-container-modern .text-preview-content {
    color: #64748b;
}

.dark-theme .ready-container-modern .text-preview-fade {
    background: linear-gradient(transparent, #0f172a);
}

.dark-theme .ready-filename {
    color: #f1f5f9;
}

.dark-theme .ready-meta {
    color: #94a3b8;
}

.dark-theme .ready-status-badge {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

.dark-theme .remove-file-btn {
    background: #1e293b;
    border-color: #334155;
    color: #64748b;
}

.dark-theme .remove-file-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .ready-container-modern {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .ready-container-modern .text-preview-thumbnail {
        width: 140px;
        height: 180px;
    }
    
    .ready-filename {
        font-size: 16px;
    }
    
    .ready-meta {
        justify-content: center;
    }
}

/* ============================================ */
/* AI PROCESSING STATE                          */
/* Hide upload card when AI analysis is running */
/* ============================================ */

/* Hide the transcription-header-row (upload section) when AI progress is actively displaying */
/* Only trigger when aiAnalysisProgress has inline style making it visible (not default hidden) */
.transcription-page-layout:has(#aiAnalysisProgress[style*="display: block"]) .transcription-header-row,
.transcription-page-layout:has(#aiAnalysisProgress[style*="display:block"]) .transcription-header-row,
.transcription-page-layout:has(#aiAnalysisProgress[style*="display: flex"]) .transcription-header-row,
.transcription-page-layout:has(#aiAnalysisProgress[style*="display:flex"]) .transcription-header-row {
    display: none !important;
}

/* Hide the transcription-header-row when AI Results card is visible */
.transcription-page-layout:has(#aiResultsCard[style*="display: block"]) .transcription-header-row,
.transcription-page-layout:has(#aiResultsCard[style*="display:block"]) .transcription-header-row,
.transcription-page-layout:has(#aiResultsCard:not([style*="display: none"]):not([style*="display:none"])[style]) .transcription-header-row {
    display: none !important;
}

/* Ensure the AI progress card is centered and prominent */
.ai-progress-card {
    max-width: 900px;
    margin: 40px auto;
}

@media (max-width: 900px) {
    .analysis-layout {
        grid-template-columns: 1fr;
    }
    
    .analysis-config-column.hidden {
        display: none;
    }
}

/* ============================================ */
/* CONFIG CARD (LEFT COLUMN)                   */
/* ============================================ */

.config-card-modern {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.config-modern-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 28px 0;
    letter-spacing: -0.02em;
}

/* ============================================ */
/* CLICKABLE CONFIG OPTIONS                    */
/* ============================================ */

.config-options-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.config-option-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.config-option-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    min-width: 110px;
}

.config-option-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #0ea5e9;
    cursor: pointer;
    transition: all 0.2s ease;
}

.config-option-value:hover {
    color: #0284c7;
}

.config-option-value:hover .config-option-chevron {
    transform: translateY(2px);
}

.config-option-chevron {
    opacity: 0.6;
    transition: transform 0.2s ease;
}

/* ============================================ */
/* CREDITS SECTION                             */
/* ============================================ */

.config-credits-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 14px;
    margin-bottom: 24px;
}

.config-credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.15);
}

.config-credits-badge svg {
    stroke: #b45309;
}

.config-credits-remaining {
    font-size: 14px;
    color: #92400e;
}

.config-credits-remaining span {
    font-weight: 700;
}

/* ============================================ */
/* TRANSCRIPTION LINKS                         */
/* ============================================ */

.config-transcription-links {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    border: 1px solid #e2e8f0;
}

.config-links-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    margin-bottom: 14px;
}

.config-links-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.config-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.config-link-btn.video {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
}

.config-link-btn.video:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.config-link-btn.audio {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
}

.config-link-btn.audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

/* ============================================ */
/* UPLOAD CARD (RIGHT COLUMN)                  */
/* ============================================ */

.upload-card-modern {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    min-height: 400px;
}

.upload-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.upload-card-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* ============================================ */
/* UPLOAD AREA                                 */
/* ============================================ */

.upload-area-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    border: 2px dashed #0ea5e9;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area-modern:hover {
    border-color: #0284c7;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    transform: translateY(-2px);
}

.upload-area-modern.drag-over {
    border-color: #0284c7;
    background: linear-gradient(135deg, #bae6fd 0%, #7dd3fc 100%);
    transform: scale(1.02);
}

.upload-area-icon {
    color: #0ea5e9;
    margin-bottom: 16px;
}

.upload-area-text {
    font-size: 18px;
    font-weight: 600;
    color: #0ea5e9;
    margin-bottom: 8px;
}

.upload-area-subtext {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 20px;
}

.upload-browse-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.file-input-hidden {
    display: none;
}

/* ============================================ */
/* TEXT PREVIEW THUMBNAIL                      */
/* ============================================ */

.text-preview-thumbnail {
    position: relative;
    width: 200px;
    height: 260px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.text-preview-thumbnail.ready {
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-preview-thumbnail.ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.text-preview-content {
    padding: 16px;
    font-size: 8px;
    line-height: 1.5;
    color: #475569;
    font-family: 'Courier New', monospace;
}

.text-preview-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.text-preview-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

.text-preview-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(14, 165, 233, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.text-preview-thumbnail.ready:hover .text-preview-overlay {
    opacity: 1;
}

/* ============================================ */
/* PROCESSING STATE                            */
/* ============================================ */

.processing-container-modern {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
}

.processing-info-modern {
    flex: 1;
}

.processing-filename {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.processing-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #0ea5e9;
    margin-bottom: 16px;
}

.processing-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e0f2fe;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.processing-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.processing-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.processing-progress-text {
    font-size: 13px;
    color: #64748b;
    text-align: right;
}

/* ============================================ */
/* READY STATE                                 */
/* ============================================ */

.ready-container-modern {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.ready-file-info {
    flex: 1;
}

.ready-filename {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.ready-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    flex-wrap: wrap;
}

.ready-separator {
    color: #cbd5e1;
}

.ready-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #16a34a;
    font-weight: 600;
}

.ready-status-badge svg {
    stroke: #16a34a;
}

.remove-file-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-file-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* ============================================ */
/* ANALYSIS SUMMARY                            */
/* ============================================ */

.analysis-summary-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    margin-top: 20px;
    font-size: 14px;
    color: #92400e;
}

.analysis-summary-icon {
    font-size: 18px;
}

.analysis-config-summary {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    margin-top: 12px;
    font-size: 14px;
    color: #1e40af;
    line-height: 1.6;
}

.config-summary-icon {
    font-size: 18px;
}

.config-summary-text strong {
    color: #1e40af;
}

/* ============================================ */
/* ANALYZE BUTTON                              */
/* ============================================ */

.analyze-actions-modern {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.analyze-btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.analyze-btn-modern:disabled {
    background: #94a3b8;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

/* Pulsing animation for Run AI Analysis button when ready */
.analyze-btn-modern:not(:disabled) {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(16, 185, 129, 0.55), 0 0 20px rgba(16, 185, 129, 0.3);
        transform: scale(1.02);
    }
}

.analyze-btn-modern:hover {
    animation: none;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.45);
}

/* ============================================ */
/* OPTION SELECTOR MODAL                       */
/* ============================================ */

.option-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.option-selector-modal.show {
    display: flex;
}

.option-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.option-selector-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.option-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.option-selector-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.option-selector-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-selector-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.option-selector-search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.option-selector-search svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.option-selector-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 15px;
    color: #1e293b;
    outline: none;
}

.option-selector-search input::placeholder {
    color: #94a3b8;
}

.option-selector-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.option-item:hover {
    background: #f0f9ff;
}

.option-item.selected {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.option-item-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.option-item.selected .option-item-icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: white;
}

.option-item-content {
    flex: 1;
}

.option-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.option-item-description {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.option-item-check {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}

.option-item.selected .option-item-check {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: white;
}

/* ============================================ */
/* STEP BADGE                                  */
/* ============================================ */

.step-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.step-badge.processing {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

.step-badge.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

/* ============================================ */
/* DARK THEME                                  */
/* ============================================ */

.dark-theme .config-card-modern,
.dark-theme .upload-card-modern {
    background: #1e293b;
    border-color: #334155;
}

.dark-theme .config-modern-title,
.dark-theme .upload-card-title {
    color: #f1f5f9;
}

.dark-theme .config-option-label {
    color: #e2e8f0;
}

.dark-theme .config-option-value {
    color: #38bdf8;
}

.dark-theme .upload-card-header {
    border-color: #334155;
}

.dark-theme .upload-area-modern {
    background: linear-gradient(135deg, #0c4a6e 0%, #075985 100%);
    border-color: #0ea5e9;
}

.dark-theme .upload-area-text {
    color: #38bdf8;
}

.dark-theme .upload-area-subtext {
    color: #94a3b8;
}

.dark-theme .text-preview-thumbnail {
    background: #0f172a;
    border-color: #334155;
}

.dark-theme .text-preview-content {
    color: #94a3b8;
}

.dark-theme .text-preview-fade {
    background: linear-gradient(transparent, #0f172a);
}

.dark-theme .ready-container-modern {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}

.dark-theme .ready-filename {
    color: #f1f5f9;
}

.dark-theme .ready-meta {
    color: #94a3b8;
}

.dark-theme .option-selector-content {
    background: #1e293b;
}

.dark-theme .option-selector-header {
    border-color: #334155;
}

.dark-theme .option-selector-title {
    color: #f1f5f9;
}

.dark-theme .option-selector-search {
    background: #0f172a;
    border-color: #334155;
}

.dark-theme .option-selector-search input {
    color: #f1f5f9;
}

.dark-theme .option-item:hover {
    background: rgba(14, 165, 233, 0.1);
}

.dark-theme .option-item-name {
    color: #f1f5f9;
}

.dark-theme .option-item-description {
    color: #94a3b8;
}

/* ============================================ */
/* DARK THEME - ANALYSIS CONFIG COLUMN         */
/* Left panel "Illuminate every conversation"  */
/* ============================================ */

/* Main config column container */
.dark-theme .analysis-config-column {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Credits section - dark amber theme */
.dark-theme .config-credits-section {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.15) 0%, rgba(146, 64, 14, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.dark-theme .config-credits-badge {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark-theme .config-credits-badge svg {
    stroke: #fbbf24;
}

.dark-theme .config-credits-remaining {
    color: #fcd34d;
}

.dark-theme .config-credits-remaining span {
    color: #fbbf24;
}

/* Transcription links section */
.dark-theme .config-transcription-links {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.6) 100%);
    border-color: #334155;
}

.dark-theme .config-links-label {
    color: #94a3b8;
}

.dark-theme .config-link-btn.video {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.dark-theme .config-link-btn.video:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.25) 100%);
    border-color: rgba(59, 130, 246, 0.5);
}

.dark-theme .config-link-btn.audio {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(190, 24, 93, 0.15) 100%);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.dark-theme .config-link-btn.audio:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3) 0%, rgba(190, 24, 93, 0.25) 100%);
    border-color: rgba(236, 72, 153, 0.5);
}

/* Option selector modal dark theme enhancements */
.dark-theme .option-selector-close {
    background: #334155;
    color: #94a3b8;
}

.dark-theme .option-selector-close:hover {
    background: #475569;
    color: #f1f5f9;
}

.dark-theme .option-selector-search input::placeholder {
    color: #64748b;
}

.dark-theme .option-item.selected {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(56, 189, 248, 0.15) 100%);
}

.dark-theme .option-item-icon {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(56, 189, 248, 0.1) 100%);
}

.dark-theme .option-item.selected .option-item-icon {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

.dark-theme .option-item-check {
    border-color: #475569;
}

/* Processing state dark theme */
.dark-theme .processing-filename {
    color: #f1f5f9;
}

.dark-theme .processing-status {
    color: #38bdf8;
}

.dark-theme .processing-spinner {
    border-color: rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
}

.dark-theme .processing-progress-bar {
    background: #334155;
}

.dark-theme .processing-progress-text {
    color: #94a3b8;
}

/* Analysis summary dark theme */
.dark-theme .analysis-summary-row {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.15) 0%, rgba(146, 64, 14, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

.dark-theme .analysis-config-summary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.dark-theme .config-summary-text strong {
    color: #60a5fa;
}

/* Step badge dark theme */
.dark-theme .step-badge {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(56, 189, 248, 0.15) 100%);
    color: #38bdf8;
}

.dark-theme .step-badge.processing {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.2) 0%, rgba(146, 64, 14, 0.15) 100%);
    color: #fbbf24;
}

.dark-theme .step-badge.success {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.2) 0%, rgba(21, 128, 61, 0.15) 100%);
    color: #4ade80;
}

/* ============================================ */
/* RESPONSIVE                                  */
/* ============================================ */

@media (max-width: 900px) {
    .analysis-layout {
        padding: 16px;
    }
    
    .processing-container-modern,
    .ready-container-modern {
        flex-direction: column;
        text-align: center;
    }
    
    .text-preview-thumbnail {
        width: 160px;
        height: 200px;
    }
}

/* Tablet and mobile - left-align dropdowns in config column */
@media (max-width: 768px) {
    .config-option-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px;
        width: 100%;
    }
    
    /* Ensure dropdown values are left-aligned on mobile/tablet */
    .config-option-value {
        justify-content: flex-start !important;
        text-align: left !important;
        margin-left: 0 !important;
    }
    
    /* Left-align the config options list */
    .config-options-list {
        align-items: flex-start !important;
        width: 100%;
    }
    
    /* Left-align config option labels */
    .config-option-label {
        text-align: left !important;
        width: 100%;
    }
    
    /* Ensure the entire config column content is left-aligned */
    .analysis-config-column {
        align-items: flex-start !important;
        text-align: left !important;
    }
    
    .analysis-config-column * {
        text-align: left;
    }
    
    /* Config modern title left align */
    .config-modern-title {
        text-align: left !important;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .config-option-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px;
        width: 100%;
    }
    
    /* Ensure dropdown values are left-aligned on mobile */
    .config-option-value {
        justify-content: flex-start !important;
        text-align: left !important;
        margin-left: 0 !important;
    }
    
    /* Left-align the config options list */
    .config-options-list {
        align-items: flex-start !important;
        width: 100%;
    }
    
    /* Left-align config option labels */
    .config-option-label {
        text-align: left !important;
        width: 100%;
    }
    
    /* Ensure the entire config column content is left-aligned */
    .analysis-config-column {
        align-items: flex-start !important;
        text-align: left !important;
    }
    
    .config-links-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .analyze-btn-modern {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================ */
/* AI COACHING REPORTS SIDEBAR                 */
/* Two-column layout: Sidebar + Results        */
/* ============================================ */

.results-with-sidebar {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}

/* Left Sidebar - AI Coaching Reports */
.coaching-sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

.sidebar-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.1);
}

.sidebar-title {
    font-size: 12px;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    text-align: center;
}

.sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    min-height: 52px;
    box-sizing: border-box;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: white;
    color: #475569;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

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

/* Save to Drive button */
.sidebar-btn.save-drive-btn:hover {
    border-color: #0EA5E9;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

/* Share to Slack button */
.sidebar-btn.share-slack-btn {
    position: relative;
}

.sidebar-btn.share-slack-btn:hover {
    border-color: #E01E5A;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.sidebar-btn.share-slack-btn .slack-spinner {
    display: none;
    animation: spin 1s linear infinite;
}

.sidebar-btn.share-slack-btn.loading .slack-spinner {
    display: block;
}

.sidebar-btn.share-slack-btn.loading .slack-icon {
    display: none;
}

.sidebar-btn.share-slack-btn .slack-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: none;
    flex-shrink: 0;
}

.sidebar-btn.share-slack-btn.connected .slack-status-dot {
    display: block;
}

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

/* Save PDF button */
.sidebar-btn.action-btn:hover {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4f46e5;
}

.sidebar-btn svg {
    flex-shrink: 0;
}

/* Right Column - Results Content */
.results-content-column {
    flex: 1;
    min-width: 0;
}

/* Navigation buttons - centered under results content */
.results-navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
    padding: 0 0 0 244px; /* Offset for sidebar width + gap */
}

@media (max-width: 768px) {
    .results-navigation-buttons {
        padding-left: 0; /* No offset on mobile */
    }
}

/* Dark Theme Support */
.dark-theme .sidebar-card {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(6, 182, 212, 0.08) 100%);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dark-theme .sidebar-title {
    color: #7dd3fc;
}

.dark-theme .sidebar-btn {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(71, 85, 105, 0.3);
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dark-theme .sidebar-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.dark-theme .sidebar-btn.save-drive-btn:hover {
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.15);
}

.dark-theme .sidebar-btn.share-slack-btn:hover {
    border-color: #f472b6;
    background: rgba(236, 72, 153, 0.15);
}

.dark-theme .sidebar-btn.action-btn:hover {
    border-color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .results-with-sidebar {
        flex-direction: column;
    }
    
    .coaching-sidebar {
        width: 100%;
        position: static;
        order: -1; /* Show above results on mobile */
    }
    
    .sidebar-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sidebar-btn {
        flex: 1 1 auto;
        min-width: 140px;
        max-width: 180px;
        justify-content: center;
    }
}
