/* ============================================ */
/* MAIN-APP MODERN REDESIGN STYLES             */
/* Uses same container structure as video/audio */
/* ============================================ */

/* ============================================ */
/* TRANSCRIPTION BANNER                         */
/* ============================================ */

.transcription-banner-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #0066FF 0%, #00D4FF 100%); /* Fallback background matching banner colors */
}

.transcription-banner-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Tablet responsiveness */
@media (max-width: 900px) {
    .transcription-banner-container {
        margin: 0 auto 20px;
        border-radius: 10px;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .transcription-banner-container {
        margin: 0 auto 16px;
        border-radius: 8px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .transcription-banner-container {
        margin: 0 -12px 16px -12px;
        width: calc(100% + 24px);
        border-radius: 0;
    }
}

/* Hide banner when layout is in processing mode */
.transcription-page-layout.processing .transcription-banner-container,
.transcription-page-layout.results-visible .transcription-banner-container {
    display: none !important;
}

/* Dark theme support */
.dark-theme .transcription-banner-container {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Hide copy buttons - app.js sets inline display but we override with !important */
#copyPromptBtn,
#copyResultsBtn,
#copyToast,
.copy-toast {
    display: none !important;
}

/* ============================================ */
/* TWO-COLUMN GRID LAYOUT                       */
/* ============================================ */

/* Grid layout - match video/audio width */
.transcription-header-row {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: stretch;
}

/* Left column card */
.analysis-config-column {
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    gap: 20px;
}

.analysis-config-column.hidden {
    display: none;
}

/* When processing, make upload card full width */
.transcription-header-row.processing {
    grid-template-columns: 1fr;
}

.transcription-header-row.processing .analysis-config-column {
    display: none;
}

@media (max-width: 900px) {
    .transcription-header-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================ */
/* 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, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
}

.config-link-btn.audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 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                                 */
/* ============================================ */

/* Base ready-container styles moved to enhanced section at end of file */

.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;
}

/* ============================================ */
/* RUN AI ANALYSIS BUTTON                      */
/* ============================================ */

.run-analysis-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

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

.run-analysis-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.run-analysis-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.run-analysis-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.run-analysis-btn svg {
    flex-shrink: 0;
}

.analysis-credit-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
}

.analysis-credit-note svg {
    color: #f59e0b;
}

.analysis-credit-note span span {
    font-weight: 600;
    color: #1e293b;
}

/* Dark theme for Run Analysis button */
.dark-theme .run-analysis-container {
    border-top-color: #334155;
}

.dark-theme .run-analysis-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.dark-theme .run-analysis-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.dark-theme .analysis-credit-note {
    color: #94a3b8;
}

.dark-theme .analysis-credit-note span span {
    color: #f1f5f9;
}

/* ============================================ */
/* 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                              */
/* ============================================ */

/* Hide the old green analyze button that gets injected into ready-container */
.ready-container-modern .analyze-actions-modern,
.ready-container-modern .analyze-btn-modern,
#uploadStep3 .ready-container-modern .analyze-actions-modern,
#uploadStep3 .ready-container-modern .analyze-btn-modern {
    display: none !important;
}

/* Original styles - only used outside of ready-container if needed */
.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:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.45);
}

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

/* ============================================ */
/* 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                                  */
/* ============================================ */

/* Upload card header - add spacing between title and badge */
.upload-card .config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.upload-card .config-header .config-title {
    margin: 0;
}

.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;
}

/* ============================================ */
/* 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;
    }
}

/* ============================================ */
/* NAVBAR DROPDOWN FIX                          */
/* ============================================ */

/* Hide skip link (visually, still accessible) */
.skip-link {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Hide aria live region visually */
.aria-live-region {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Hide copy toast by default */
.copy-toast {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.copy-toast.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ============================================ */
/* CONFIG OPTIONS STYLING                       */
/* ============================================ */

/* Config title - left aligned */
.config-modern-title {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 24px 0;
    letter-spacing: -0.02em;
    text-align: left;
}

/* Config options - left aligned */
.config-options-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
    width: 100%;
}

.config-option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.config-option-label {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

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

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

.config-option-chevron {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* Credits section */
.config-credits-section {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    text-align: center;
}

.config-credits-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #fcd34d;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #b45309;
    margin-bottom: 8px;
}

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

/* Transcription links section */
.config-transcription-links {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e2e8f0;
}

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

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

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

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

.config-link-btn.video:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
}

.config-link-btn.audio {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
}

.config-link-btn.audio:hover {
    background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
}

/* Upload card styling to match video/audio upload-card */
.upload-card-modern {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    height: 100%;
}

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

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

/* ============================================ */
/* AI PROGRESS AND RESULTS CARDS               */
/* ============================================ */

.ai-progress-card,
.ai-results-card {
    margin-top: 8px;
    padding: 0;
    overflow: hidden;
}

/* Hide progress card when aiAnalysisProgress is empty/hidden */
.ai-progress-card:has(#aiAnalysisProgress:empty),
.ai-progress-card:has(#aiAnalysisProgress[style*="display: none"]) {
    display: none;
}

/* Show progress card when aiAnalysisProgress has content */
.ai-progress-card:has(#aiAnalysisProgress[style*="display: block"]),
.ai-progress-card:has(#aiAnalysisProgress .ai-loading-container) {
    display: block;
}

.ai-progress-card .ai-loading-container {
    padding: 32px 24px;
    text-align: center;
}

/* Coaching Banner Image (AI Processing) */
.ai-progress-card .coaching-banner-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 24px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* AI Loading Title */
.ai-progress-card .ai-loading-title {
    font-size: 18px;
    font-weight: 700;
    color: #0EA5E9;
    margin-bottom: 12px;
}

/* AI Loading Subtitle */
.ai-progress-card .ai-loading-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    text-align: center;
}

/* Progress Bar Container */
.ai-progress-card .ai-progress-bar-container {
    margin: 12px 0 16px;
}

.ai-progress-card .ai-progress-bar {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ai-progress-card .ai-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0EA5E9, #38BDF8);
    border-radius: 6px;
    transition: width 0.5s ease-out;
    position: relative;
}

.ai-progress-card .ai-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Stage Progress */
.ai-progress-card .ai-loading-progress {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px 12px;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
}

.ai-progress-card .ai-loading-stage {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ai-progress-card .ai-loading-stage-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
}

.ai-progress-card .ai-loading-stage-icon.pending {
    background: #e2e8f0;
    color: #94a3b8;
}

.ai-progress-card .ai-loading-stage-icon.active {
    background: #DBEAFE;
    color: #0EA5E9;
    animation: pulse 1.5s ease infinite;
}

.ai-progress-card .ai-loading-stage-icon.complete {
    background: #D1FAE5;
    color: #059669;
}

.ai-progress-card .ai-loading-stage-text {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

.ai-progress-card .ai-loading-stage-text.active {
    color: #0EA5E9;
    font-weight: 600;
}

.ai-progress-card .ai-loading-stage-text.complete {
    color: #059669;
}

/* Tip */
.ai-progress-card .ai-loading-tip {
    font-size: 13px;
    color: #64748b;
    padding: 12px;
    background: #fefce8;
    border-radius: 6px;
    border: 1px solid #fef08a;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.ai-results-card {
    padding: 24px;
}

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

.ai-results-card .results-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.ai-results-card #resultsFilename {
    font-size: 14px;
    color: #64748b;
}

.ai-results-card .ai-results-display {
    font-size: 15px;
    line-height: 1.7;
    color: #334155;
}

/* ============================================ */
/* DARK THEME - MAIN APP MODERN                */
/* ============================================ */

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

/* Config title */
.dark-theme .config-modern-title {
    color: #f1f5f9;
}

/* Config option labels */
.dark-theme .config-option-label {
    color: #94a3b8;
}

/* Config option values (clickable dropdowns) */
.dark-theme .config-option-value {
    color: #38bdf8;
}

.dark-theme .config-option-value:hover {
    color: #7dd3fc;
}

/* Credits section */
.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-remaining {
    color: #fcd34d;
}

/* 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(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.dark-theme .config-link-btn.audio:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(22, 163, 74, 0.25) 100%);
    border-color: rgba(34, 197, 94, 0.5);
}

/* Upload card */
.dark-theme .upload-card-modern {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

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

/* Text preview */
.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);
}

/* AI Progress Card */
.dark-theme .ai-progress-card .ai-loading-container {
    background: #1e293b;
}

.dark-theme .ai-progress-card .ai-loading-title {
    color: #38bdf8;
}

.dark-theme .ai-progress-card .ai-loading-subtitle {
    color: #94a3b8;
}

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

.dark-theme .ai-progress-card .ai-loading-progress {
    background: rgba(15, 23, 42, 0.8);
}

.dark-theme .ai-progress-card .ai-loading-stage-icon.pending {
    background: #334155;
    color: #64748b;
}

.dark-theme .ai-progress-card .ai-loading-stage-icon.active {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
}

.dark-theme .ai-progress-card .ai-loading-stage-icon.complete {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.dark-theme .ai-progress-card .ai-loading-stage-text {
    color: #94a3b8;
}

.dark-theme .ai-progress-card .ai-loading-stage-text.active {
    color: #38bdf8;
}

.dark-theme .ai-progress-card .ai-loading-stage-text.complete {
    color: #34d399;
}

.dark-theme .ai-progress-card .ai-loading-tip {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

/* AI Results Card */
.dark-theme .ai-results-card {
    background: #1e293b;
    border-color: #334155;
}

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

.dark-theme .ai-results-card .results-header h3 {
    color: #f1f5f9;
}

.dark-theme .ai-results-card #resultsFilename {
    color: #94a3b8;
}

.dark-theme .ai-results-card .ai-results-display {
    color: #e2e8f0;
}

/* Responsive */
@media (max-width: 900px) {
    .analysis-layout {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .ai-progress-card,
    .ai-results-card {
        margin-top: 16px;
    }
}

/* ============================================ */
/* ENHANCED STEP 3: READY TO ANALYZE STYLES   */
/* Modern, polished design improvements        */
/* ============================================ */

/* ============================================ */
/* READY CONTAINER - COMPLETE REDESIGN         */
/* ============================================ */

.ready-container-modern {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    margin: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* Hide any rogue buttons inside the ready container - only X button should show */
.ready-container-modern > .run-analysis-btn,
.ready-container-modern > button:not(.remove-file-btn),
.ready-container-modern .run-analysis-btn:not(#runAnalysisModern),
#uploadStep3 .ready-container-modern .run-analysis-btn {
    display: none !important;
}

.ready-container-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-primary, #0EA5E9);
    z-index: 10;
}

.ready-container-modern:hover {
    border-color: var(--brand-primary, #0EA5E9);
    box-shadow: 0 8px 32px rgba(var(--brand-primary-rgb, 14, 165, 233), 0.15);
    transform: translateY(-2px);
}

/* ============================================ */
/* DOCUMENT PREVIEW CARD - ENHANCED            */
/* ============================================ */

#uploadStep3 .text-preview-thumbnail {
    position: relative !important;
    width: 180px !important;
    min-width: 180px !important;
    min-height: 200px !important;
    height: auto !important;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: none !important;
    border-right: 1px solid #e2e8f0 !important;
    border-radius: 18px 0 0 18px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: none !important;
    transform: none !important;
}

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

#uploadStep3 .text-preview-thumbnail.ready:hover {
    background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Document header with subtle styling */
#uploadStep3 .text-preview-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(14, 165, 233, 0.04) 100%);
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
    z-index: 1;
    pointer-events: none;
}

#uploadStep3 .text-preview-content {
    padding: 52px 16px 20px;
    font-size: 7px;
    line-height: 1.6;
    color: #64748b;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    flex: 1;
    overflow: hidden;
}

#uploadStep3 .text-preview-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    opacity: 0.8;
}

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

/* Hover overlay */
#uploadStep3 .text-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(14, 165, 233, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0;
}

#uploadStep3 .text-preview-overlay svg {
    color: white;
}

#uploadStep3 .text-preview-overlay::after {
    content: 'View Document';
    font-size: 12px;
    font-weight: 600;
    color: white;
}

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

/* ============================================ */
/* FILE INFO SECTION - ENHANCED                */
/* ============================================ */

#uploadStep3 .ready-file-info {
    flex: 1;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

#uploadStep3 .ready-filename {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
}

/* File type icon before filename */
#uploadStep3 .ready-filename::before {
    content: '';
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cline x1='10' y1='9' x2='8' y2='9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

#uploadStep3 .ready-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #64748b;
    flex-wrap: wrap;
    margin-left: 56px;
}

#uploadStep3 .ready-separator {
    color: #cbd5e1;
    font-size: 10px;
}

/* ============================================ */
/* STATUS BADGE - ENHANCED                     */
/* ============================================ */

#uploadStep3 .ready-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(var(--brand-primary-rgb, 14, 165, 233), 0.1);
    color: var(--brand-primary, #0EA5E9);
    font-weight: 600;
    font-size: 13px;
    border-radius: 24px;
    border: 1px solid rgba(var(--brand-primary-rgb, 14, 165, 233), 0.2);
}

#uploadStep3 .ready-status-badge svg {
    stroke: var(--brand-primary, #0EA5E9);
}

/* ============================================ */
/* REMOVE FILE BUTTON - ENHANCED               */
/* ============================================ */

#uploadStep3 .remove-file-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#uploadStep3 .remove-file-btn:hover {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

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

/* ============================================ */
/* RUN AI ANALYSIS SECTION - ENHANCED          */
/* ============================================ */

#uploadStep3 .run-analysis-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 28px 32px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    margin-top: 0;
}

/* Analysis button - Premium style */
#uploadStep3 .run-analysis-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 48px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.35),
                0 0 0 0 rgba(14, 165, 233, 0.4);
    width: 100%;
    max-width: 340px;
    position: relative;
    overflow: hidden;
}

/* Animated shine effect */
#uploadStep3 .run-analysis-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    transition: left 0.5s ease;
}

#uploadStep3 .run-analysis-btn:hover::before {
    left: 100%;
}

#uploadStep3 .run-analysis-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.45),
                0 0 0 4px rgba(14, 165, 233, 0.1);
}

#uploadStep3 .run-analysis-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
}

#uploadStep3 .run-analysis-btn:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#uploadStep3 .run-analysis-btn:disabled::before {
    display: none;
}

#uploadStep3 .run-analysis-btn svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

#uploadStep3 .run-analysis-btn:hover svg {
    transform: scale(1.1);
}

/* ============================================ */
/* CREDIT NOTE - ENHANCED                      */
/* ============================================ */

#uploadStep3 .analysis-credit-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    padding: 10px 20px;
    background: white;
    border-radius: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

#uploadStep3 .analysis-credit-note svg {
    color: #f59e0b;
    animation: clockTick 2s ease infinite;
}

@keyframes clockTick {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(10deg); }
    20% { transform: rotate(0deg); }
}

#uploadStep3 .analysis-credit-note span span {
    font-weight: 700;
    color: #1e293b;
}

/* ============================================ */
/* STEP 3 DARK THEME                           */
/* ============================================ */

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

.dark-theme .ready-container-modern:hover {
    border-color: var(--brand-primary, #0EA5E9);
    box-shadow: 0 8px 32px rgba(var(--brand-primary-rgb, 14, 165, 233), 0.2);
}

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

.dark-theme #uploadStep3 .text-preview-thumbnail::after {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(14, 165, 233, 0.06) 100%);
    border-bottom-color: rgba(14, 165, 233, 0.15);
}

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

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

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

.dark-theme #uploadStep3 .ready-filename::before {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0.1) 100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cline x1='10' y1='9' x2='8' y2='9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

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

.dark-theme #uploadStep3 .ready-separator {
    color: #475569;
}

.dark-theme #uploadStep3 .ready-status-badge {
    background: rgba(var(--brand-primary-rgb, 14, 165, 233), 0.15);
    color: var(--brand-primary, #0EA5E9);
    border-color: rgba(var(--brand-primary-rgb, 14, 165, 233), 0.25);
}

.dark-theme #uploadStep3 .ready-status-badge svg {
    stroke: var(--brand-primary, #0EA5E9);
}

.dark-theme #uploadStep3 .remove-file-btn {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.dark-theme #uploadStep3 .remove-file-btn:hover {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-color: rgba(220, 38, 38, 0.3);
    color: #f87171;
}

.dark-theme #uploadStep3 .run-analysis-container {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-top-color: #334155;
}

.dark-theme #uploadStep3 .run-analysis-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.dark-theme #uploadStep3 .run-analysis-btn:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
}

.dark-theme #uploadStep3 .analysis-credit-note {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

.dark-theme #uploadStep3 .analysis-credit-note span span {
    color: #f1f5f9;
}

/* ============================================ */
/* STEP 3 RESPONSIVE ENHANCEMENTS              */
/* ============================================ */

@media (max-width: 768px) {
    .ready-container-modern {
        flex-direction: column;
        border-radius: 16px;
        margin: 16px;
    }
    
    #uploadStep3 .text-preview-thumbnail {
        width: 100%;
        min-width: 100%;
        height: 140px;
        min-height: 140px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .dark-theme #uploadStep3 .text-preview-thumbnail {
        border-bottom-color: #334155;
    }
    
    #uploadStep3 .text-preview-content {
        padding: 48px 20px 20px;
    }
    
    #uploadStep3 .ready-file-info {
        padding: 24px;
    }
    
    #uploadStep3 .ready-filename {
        font-size: 18px;
    }
    
    #uploadStep3 .ready-filename::before {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    #uploadStep3 .ready-meta {
        margin-left: 52px;
    }
    
    #uploadStep3 .run-analysis-container {
        padding: 24px;
    }
    
    #uploadStep3 .run-analysis-btn {
        padding: 16px 32px;
        font-size: 16px;
        max-width: 100%;
    }
    
    #uploadStep3 .remove-file-btn {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    #uploadStep3 .ready-filename {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 16px;
    }
    
    #uploadStep3 .ready-meta {
        margin-left: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #uploadStep3 .ready-separator {
        display: none;
    }
    
    #uploadStep3 .ready-status-badge {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================ */
/* STEP 3 ANIMATION ON ENTRY                   */
/* ============================================ */

.upload-step-content#uploadStep3 {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

#uploadStep3 .ready-container-modern {
    animation: containerFadeIn 0.5s ease 0.1s both;
}

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#uploadStep3 .run-analysis-container {
    animation: buttonsFadeIn 0.5s ease 0.2s both;
}

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