/**
 * ChronoEye Analyzer - Main Stylesheet
 * Company Branding: Professional dark theme with ChronoEye color palette
 * Primary: #387186, Accent: #55C4C7, Warning: #D4B119, Secondary: #A07553, Muted: #7D98B5
 */

/* ===== ROOT VARIABLES - COMPANY BRAND COLORS ===== */
:root {
    --primary-blue: #387186;
    --accent-teal: #55C4C7;
    --warning-gold: #D4B119;
    --secondary-brown: #A07553;
    --muted-blue: #7D98B5;
    --success-green: #48bb78;
    --error-red: #f56565;
    --dark-bg: #1a202c;
    --darker-bg: #171923;
    --card-bg: rgba(56, 113, 134, 0.1);
    --border-color: rgba(56, 113, 134, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #1a202c 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER STYLES ===== */
.header {
    background: linear-gradient(135deg, 
        rgba(26, 32, 44, 0.95) 0%, 
        rgba(56, 113, 134, 0.3) 30%, 
        rgba(45, 55, 72, 0.8) 70%, 
        rgba(26, 32, 44, 0.95) 100%);
    backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(56, 113, 134, 0.2);
    border-bottom: 1px solid rgba(85, 196, 199, 0.3);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--accent-teal), #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-links a:hover {
    background: rgba(85, 196, 199, 0.2);
    border-color: var(--accent-teal);
    transform: translateY(-2px);
}

/* ===== LAYOUT STYLES ===== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ===== SECTION STYLES ===== */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-teal);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary-blue);
}

/* ===== UPLOAD SECTION ===== */
.upload-section {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(56, 113, 134, 0.1);
}

.upload-area {
    border: 2px dashed var(--accent-teal);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(85, 196, 199, 0.05);
}

.upload-area:hover {
    border-color: var(--warning-gold);
    background: rgba(212, 177, 25, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(85, 196, 199, 0.2);
}

.upload-area.dragover {
    border-color: var(--warning-gold);
    background: rgba(212, 177, 25, 0.15);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: var(--accent-teal);
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.upload-subtext {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-input {
    display: none;
}

/* ===== UPLOAD PROGRESS SECTION ===== */
#uploadProgressSection {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(56, 113, 134, 0.1);
    display: none;
}

.upload-progress-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.cancel-btn {
    background: var(--error-red);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.upload-progress-bar {
    width: 100%;
    height: 24px;
    background: var(--darker-bg);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-teal), var(--primary-blue));
    border-radius: 12px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
}

.upload-progress-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%); }
}

.upload-progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

/* ===== FORM STYLES ===== */
.analysis-name {
    margin-top: 1rem;
}

.analysis-name input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

.analysis-name input::placeholder {
    color: #a0aec0;
}

/* ===== PROGRESS SECTION ===== */
.progress-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    display: none;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(125, 152, 181, 0.2);
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue) 0%, var(--accent-teal) 50%, var(--warning-gold) 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(56, 113, 134, 0.4);
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

/* ===== RESULTS SECTION ===== */
.results-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    display: none;
}

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

.export-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ===== BUTTON STYLES ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(56, 113, 134, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 113, 134, 0.4);
    background: linear-gradient(135deg, var(--accent-teal) 0%, var(--primary-blue) 100%);
}

.btn-secondary {
    background: rgba(125, 152, 181, 0.2);
    color: var(--text-primary);
    border: 1px solid var(--muted-blue);
}

.btn-secondary:hover {
    background: rgba(125, 152, 181, 0.3);
    border-color: var(--accent-teal);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(45deg, #e53e3e, #fc8181);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(45deg, #c53030, #f56565);
}

.btn-warning {
    background: var(--warning-gold);
    color: var(--text-primary);
    border: 1px solid var(--warning-gold);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-warning:hover {
    background: rgba(212, 177, 25, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 177, 25, 0.3);
}

/* ===== TABLE STYLES ===== */
.results-table {
    background: rgba(26, 32, 44, 0.6);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.table-header {
    display: grid;
    grid-template-columns: 60px 2fr 100px 100px 150px;
    gap: 1rem;
    background: rgba(85, 196, 199, 0.2);
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: var(--accent-teal);
    border-bottom: 2px solid rgba(85, 196, 199, 0.3);
}

.table-row {
    display: grid;
    grid-template-columns: 60px 2fr 100px 100px 150px;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.table-row:hover {
    background: rgba(85, 196, 199, 0.1);
    transform: translateX(4px);
}

.table-row.current-step {
    background: rgba(85, 196, 199, 0.2);
    border-left: 4px solid var(--accent-teal);
    box-shadow: 0 4px 15px rgba(85, 196, 199, 0.3);
}

.step-number {
    font-weight: bold;
    color: var(--accent-teal);
    text-align: center;
    background: rgba(85, 196, 199, 0.2);
    border-radius: 6px;
    padding: 0.25rem;
}

.timestamp {
    color: var(--warning-gold);
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    transition: all 0.3s ease;
}

.timestamp:hover {
    color: #ffffff;
    text-shadow: 0 0 8px var(--warning-gold);
    transform: scale(1.05);
}

.step-description {
    color: var(--text-primary);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-description-text {
    flex: 1;
}

.step-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-row:hover .step-actions {
    opacity: 1;
}

.step-actions button {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.edit-step-btn {
    background: rgba(99, 179, 237, 0.2);
    color: #63b3ed;
    border: 1px solid rgba(99, 179, 237, 0.3);
}

.edit-step-btn:hover {
    background: rgba(99, 179, 237, 0.3);
    transform: translateY(-1px);
}

.split-step-btn {
    background: rgba(212, 177, 25, 0.2);
    color: #d4b119;
    border: 1px solid rgba(212, 177, 25, 0.3);
}

.split-step-btn:hover {
    background: rgba(212, 177, 25, 0.3);
    transform: translateY(-1px);
}

.delete-step-btn {
    background: rgba(245, 101, 101, 0.2);
    color: #f56565;
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.delete-step-btn:hover {
    background: rgba(245, 101, 101, 0.3);
    transform: translateY(-1px);
}

.tools-col {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tool-tag {
    background: linear-gradient(135deg, var(--secondary-brown) 0%, var(--muted-blue) 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== STATUS MESSAGES ===== */
.status-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    display: none;
    backdrop-filter: blur(10px);
    border-left: 4px solid;
}

.status-message.success {
    background: rgba(72, 187, 120, 0.15);
    border-left-color: var(--success-green);
    color: #9ae6b4;
}

.status-message.error {
    background: rgba(245, 101, 101, 0.15);
    border-left-color: var(--error-red);
    color: #feb2b2;
}

.status-message.warning {
    background: rgba(212, 177, 25, 0.15);
    border-left-color: var(--warning-gold);
    color: #f6e05e;
}

.status-message.info {
    background: rgba(85, 196, 199, 0.15);
    border-left-color: var(--accent-teal);
    color: var(--accent-teal);
}

/* ===== VIDEO PREVIEW STYLES ===== */
.video-preview {
    margin-top: 1rem;
}

.video-controls {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ===== SETTINGS MODAL ===== */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 32, 44, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

.settings-content {
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.95) 0%, rgba(23, 25, 35, 0.95) 100%);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    border: 2px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(56, 113, 134, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: modalSlideIn 0.3s ease-out;
}

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

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-teal);
    background: rgba(85, 196, 199, 0.1);
    transform: rotate(90deg);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-teal);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: rgba(26, 32, 44, 0.8);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(85, 196, 199, 0.2);
    background: rgba(26, 32, 44, 0.9);
}

/* ===== CUSTOM PROMPT STYLES ===== */
.prompt-mode-selection {
    margin-bottom: 1rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.radio-option:hover {
    background: rgba(85, 196, 199, 0.1);
}

.radio-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.custom-prompt-container {
    margin-top: 1rem;
}

.prompt-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.custom-prompt-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    flex: 1;
    transition: all 0.3s ease;
}

.custom-prompt-textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-prompt-textarea.placeholder {
    color: #a0aec0;
    font-style: italic;
}

.custom-prompt-textarea.custom-prompt-enabled {
    border-color: var(--accent-teal) !important;
    background: rgba(85, 196, 199, 0.1) !important;
}

.clear-prompt-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 4px;
    color: white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.clear-prompt-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.prompt-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    min-width: auto;
}

.btn-small i {
    margin-right: 0.3rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 50px 1fr 80px 80px 120px;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .settings-content {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

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

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ===== COMPANY FOOTER ===== */
.company-footer {
    background: linear-gradient(135deg, var(--darker-bg) 0%, var(--dark-bg) 50%, var(--darker-bg) 100%);
    border-top: 2px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.footer-logo-img {
    width: 32px;
    height: 32px;
    filter: brightness(1.1);
}

.footer-company-name {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--accent-teal), var(--primary-blue));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-established {
    color: var(--accent-teal);
    font-weight: 500;
}

.footer-separator {
    color: var(--muted-blue);
}

.footer-copyright {
    color: var(--text-secondary);
}

.footer-right {
    text-align: right;
}

.footer-tagline {
    color: var(--accent-teal);
    font-size: 1rem;
    font-weight: 500;
    font-style: italic;
}

/* Footer Responsive Design */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-right {
        text-align: center;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-separator {
        display: none;
    }
}

/* ===== SETTINGS DISCOVERABILITY STYLES ===== */
.settings-pulse-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-teal), var(--primary-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.settings-pulse-icon i {
    color: white;
    font-size: 1rem;
    animation: rotate 3s linear infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(85, 196, 199, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(85, 196, 199, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(85, 196, 199, 0); }
}

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

.dismiss-prompt-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(160, 174, 192, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.dismiss-prompt-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    transform: scale(1.1);
}

.settings-prompt.dismissed {
    display: none !important;
}

/* ===== EXPORT OVERLAY STYLES ===== */
.export-progress-overlay,
.export-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 32, 44, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.export-progress-content,
.export-success-content {
    background: linear-gradient(135deg, 
        rgba(56, 113, 134, 0.2) 0%, 
        rgba(85, 196, 199, 0.1) 50%, 
        rgba(56, 113, 134, 0.2) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(85, 196, 199, 0.3);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.export-progress-icon,
.export-success-icon {
    margin-bottom: 1rem;
    color: var(--accent-teal);
}

.export-progress-content h3,
.export-success-content h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.export-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 1rem 0;
    overflow: hidden;
}

.export-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-teal), var(--warning-gold));
    width: 0%;
    transition: width 1.2s ease-out;
    border-radius: 4px;
}

.export-progress-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.export-success-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.export-success-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.export-success-details strong {
    color: var(--accent-teal);
}

.export-success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.export-success-actions .btn {
    flex: 1;
    max-width: 150px;
}

.export-success-overlay.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.export-success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s ease-out;
}

.export-success-content h3 {
    color: #55C4C7;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.export-success-content p {
    color: #E2E8F0;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.export-description {
    font-size: 0.9rem;
    color: #CBD5E0 !important;
    font-style: italic;
    margin-bottom: 1.5rem !important;
}

.export-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.export-alt-btn,
.export-close-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.export-alt-btn {
    background: linear-gradient(135deg, #55C4C7, #387186);
    color: white;
}

.export-alt-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(85, 196, 199, 0.3);
}

.export-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* ===== DURATION VALIDATION STYLES ===== */
.duration-validation-container {
    margin-bottom: 2rem;
}

.duration-validation-card {
    background: rgba(45, 55, 72, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid var(--accent-teal);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1000;
}

.validation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1001;
}

.validation-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1002;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1002;
}

.status-passed {
    background: rgba(72, 187, 120, 0.2);
    color: #68d391;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd93d;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.status-failed {
    background: rgba(245, 101, 101, 0.2);
    color: #fc8181;
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.confidence-indicator {
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    z-index: 1002;
}

.confidence-high { color: #68d391; }
.confidence-medium { color: #ffd93d; }
.confidence-low { color: #fc8181; }

.validation-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1001;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1001;
}

.detail-label {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-teal);
}

.gap-warning {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1001;
}

.gap-warning i {
    color: #fc8181;
    font-size: 1.2rem;
}

.gap-text {
    color: #fc8181;
    font-weight: 500;
}

.validation-flags {
    margin: 1rem 0;
    position: relative;
    z-index: 1001;
}

.flags-label {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.flag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flag-tag {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd93d;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 193, 7, 0.3);
    position: relative;
    z-index: 1001;
}

.validation-recommendations {
    margin-top: 1rem;
    position: relative;
    z-index: 1001;
}

.recommendations-label {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1001;
}

.recommendation-item i {
    color: #ffd93d;
    font-size: 0.9rem;
}

.recommendation-text {
    color: #e2e8f0;
    font-size: 0.9rem;
}

/* Retry Modal Styles */
.retry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.retry-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2001;
}

.retry-modal h3 {
    color: var(--accent-teal);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.retry-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.retry-option {
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    z-index: 2001;
}

.retry-option:hover {
    border-color: var(--accent-teal);
    background: rgba(85, 196, 199, 0.1);
    transform: translateY(-2px);
}

.retry-option-title {
    font-weight: 600;
    color: var(--accent-teal);
    margin-bottom: 0.5rem;
}

.retry-option-desc {
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.retry-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.retry-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2001;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #a0aec0;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

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

.btn-primary:hover {
    background: #4a9a9d;
    transform: translateY(-1px);
}

/* Multi-unit alert styles */
.multi-unit-alert {
    position: relative;
    z-index: 1001;
}

/* Ensure all interactive elements have proper z-index */
.duration-validation-card button,
.duration-validation-card .retry-option,
.duration-validation-card .status-badge {
    position: relative;
    z-index: 1002;
}

/* Human-in-the-Loop Editing Styles */
.step-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.edit-step-btn, .split-step-btn, .delete-step-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.edit-step-btn:hover {
    background: var(--accent-teal);
    color: white;
    border-color: var(--accent-teal);
}

.split-step-btn:hover {
    background: var(--warning-gold);
    color: white;
    border-color: var(--warning-gold);
}

.delete-step-btn:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
}

/* Edit Step Modal */
.edit-step-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(26, 32, 44, 0.95) 0%, 
        rgba(56, 113, 134, 0.3) 30%, 
        rgba(45, 55, 72, 0.8) 70%, 
        rgba(26, 32, 44, 0.95) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(85, 196, 199, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(56, 113, 134, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header h3 {
    color: var(--text-primary);
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

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

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

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(85, 196, 199, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #4a9a9d;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Split Step Modal Specific */
.split-preview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.split-step {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.split-step h4 {
    color: var(--accent-teal);
    margin: 0 0 1rem 0;
    font-size: 1rem;
}

.split-step input {
    margin-bottom: 0.75rem;
}

/* Quality Rating System */
.quality-rating {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.rating-container h4 {
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.star-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.star {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.star:hover, .star.active {
    color: var(--warning-gold);
    transform: scale(1.1);
}

.rating-feedback {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rating-feedback textarea {
    min-height: 80px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
}

.rating-feedback textarea::placeholder {
    color: var(--text-secondary);
}

.rating-feedback button {
    align-self: flex-start;
}

/* Results Table Enhancement */
.actions-col {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .step-actions {
        flex-direction: column;
        gap: 0.25rem;
        opacity: 1 !important; /* Always visible on mobile */
    }
    
    .edit-step-btn, .split-step-btn, .delete-step-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .split-preview {
        gap: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* Settings Modal Enhancements */
.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--accent-teal);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 10px;
    line-height: 16px;
    cursor: help;
    margin-left: 0.5rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-teal);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--accent-teal);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider-value {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-teal);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    font-size: 0.9rem;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(85, 196, 199, 0.1);
}

/* ===== TOOLTIP SYSTEM ===== */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(26, 32, 44, 0.95) 0%, rgba(23, 25, 35, 0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(85, 196, 199, 0.3);
    border-radius: 12px;
    padding: 1rem;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(26, 32, 44, 0.95);
}

.tooltip-container:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.tooltip-header {
    color: var(--accent-teal);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(85, 196, 199, 0.2);
}

.tooltip-description {
    color: #a0aec0;
    line-height: 1.5;
}

.tooltip-description strong {
    color: var(--accent-teal);
    font-weight: 500;
}

/* Auto-flagging system styles */
.auto-flagging-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.flagging-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.flagging-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.flag-count {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.flagging-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.flag-stat {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.flag-stat.error {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.flag-stat.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.flag-stat.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.flagging-description {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

/* Step flag indicators */
.step-flags {
    display: inline-flex;
    gap: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.flag-indicator {
    font-size: 14px;
    cursor: help;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.flag-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* ===== ENHANCED QUALITY FLAGS SYSTEM ===== */
.step-flags-enhanced {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.flag-indicator-enhanced {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 50px;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.flag-indicator-enhanced:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.flag-indicator-enhanced.error {
    animation: pulse-error 2s infinite;
}

.flag-indicator-enhanced.warning {
    animation: pulse-warning 3s infinite;
}

.flag-icon-large {
    font-size: 0.9rem;
    display: inline-block;
}

.flag-type-badge {
    font-size: 0.55rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Enhanced flag animations */
@keyframes pulse-error {
    0%, 100% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 4px 12px rgba(220, 38, 38, 0.6); }
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.6); }
}

/* Flagged row styling */
.table-row.flagged-critical {
    border-left: 3px solid #dc2626;
    background: rgba(220, 38, 38, 0.03);
}

.table-row.flagged-warning {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.03);
}

.table-row.flagged-info {
    border-left: 3px solid #3b82f6;
    background: rgba(59, 130, 246, 0.03);
}

.table-row.flagged-critical:hover,
.table-row.flagged-warning:hover,
.table-row.flagged-info:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Enhanced tooltip for flagged steps */
.flagged-critical .tooltip,
.flagged-warning .tooltip,
.flagged-info .tooltip {
    border-left: 3px solid;
}

.flagged-critical .tooltip {
    border-left-color: #dc2626;
}

.flagged-warning .tooltip {
    border-left-color: #f59e0b;
}

.flagged-info .tooltip {
    border-left-color: #3b82f6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .flagging-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .flagging-stats {
        justify-content: flex-start;
    }
    
    .step-flags {
        margin-bottom: 4px;
        display: block;
    }
}

/* Duplicate video detection alert */
.duplicate-video-alert {
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

.duplicate-video-alert .alert-content {
    padding: 16px;
}

.duplicate-video-alert .alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.duplicate-video-alert .alert-header h4 {
    margin: 0;
    color: var(--accent-color);
    font-size: 16px;
    font-weight: 600;
}

.duplicate-video-alert .close-alert {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

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

.duplicate-info {
    margin-bottom: 16px;
}

.confidence-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.confidence-badge.confidence-high {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.confidence-badge.confidence-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.duplicate-info p {
    margin: 4px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.duplicate-info strong {
    color: var(--text-primary);
}

.duplicate-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.duplicate-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.duplicate-actions .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.duplicate-actions .btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.duplicate-actions .btn-secondary:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

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

/* Responsive adjustments for duplicate alert */
@media (max-width: 768px) {
    .duplicate-actions {
        flex-direction: column;
    }
    
    .duplicate-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* ===== INLINE RETRY STATUS STYLING ===== */
.retry-status {
    background: linear-gradient(135deg, rgba(85, 196, 199, 0.15), rgba(85, 196, 199, 0.05));
    border: 1px solid rgba(85, 196, 199, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: slideInFromTop 0.5s ease-out;
}

.retry-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.retry-icon {
    font-size: 1.5rem;
    animation: rotate 2s linear infinite;
}

.retry-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-teal, #55C4C7);
}

.retry-reason {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    color: #e2e8f0;
    border-left: 3px solid var(--accent-teal, #55C4C7);
}

.retry-progress {
    margin-bottom: 1rem;
}

.retry-steps {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.retry-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.retry-step.active {
    background: rgba(85, 196, 199, 0.2);
    border: 1px solid rgba(85, 196, 199, 0.4);
    transform: scale(1.02);
}

.retry-step.completed {
    background: rgba(72, 187, 120, 0.2);
    border: 1px solid rgba(72, 187, 120, 0.4);
}

.step-number {
    background: var(--accent-teal, #55C4C7);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.retry-step.completed .step-number {
    background: var(--success-green, #48bb78);
}

.step-text {
    color: #e2e8f0;
    font-size: 0.9rem;
}

.retry-attempt {
    text-align: center;
    color: var(--accent-teal, #55C4C7);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.retry-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.retry-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .retry-steps {
        flex-direction: column;
    }
    
    .retry-step {
        min-width: unset;
    }
    
    .retry-actions {
        flex-direction: column;
    }
}

/* ===== VIDEO INFO SECTION FIXES ===== */
.video-info-section {
    min-width: 0; /* Allow shrinking */
}

.video-info-section #videoFilename {
    word-break: break-all;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    display: inline-block;
    line-height: 1.3;
}

/* Responsive video info container */
.video-info-section > div {
    min-width: 0; /* Allow container to shrink */
    max-width: 100%;
    overflow: hidden;
}

/* Better spacing for long filenames */
.video-info-section > div > div {
    margin-bottom: 0.75rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.video-info-section > div > div:last-child {
    margin-bottom: 0 !important;
}

/* Style the filename specifically */
.video-info-section strong {
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}

.video-info-section span:not(strong) {
    flex: 1;
    min-width: 0;
}

/* ===== MEMORY ERROR ALERT STYLING ===== */
.memory-error-alert {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
    border: 2px solid #dc3545;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
    animation: slideDown 0.3s ease-out;
}

.memory-error-alert h4 {
    color: #dc3545;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.memory-error-alert h5 {
    color: #721c24;
    margin: 15px 0 10px 0;
    font-size: 1.1rem;
}

.memory-error-alert p {
    color: #721c24;
    margin: 10px 0;
    font-size: 1rem;
}

.memory-error-alert ul {
    color: #721c24;
    margin: 10px 0;
    padding-left: 20px;
}

.memory-error-alert li {
    margin: 8px 0;
    line-height: 1.4;
}

.memory-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.memory-actions .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.memory-actions .btn-primary {
    background: #007bff;
    color: white;
}

.memory-actions .btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.memory-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.memory-actions .btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

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

/* Memory error responsive design */
@media (max-width: 768px) {
    .memory-actions {
        flex-direction: column;
    }
    
    .memory-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .memory-error-alert {
        padding: 20px;
    }
    
    .memory-error-alert h4 {
        font-size: 1.3rem;
    }
}