/* ==========================================
   Demo Modal Styles - White Background Fix
   Updated: 2025-01-28
   ========================================== */

/* Clean Modal Colors */
:root {
    /* Light mode - Clean & Minimal */
    --modal-bg: #ffffff;
    --modal-content-bg: #ffffff;
    --modal-backdrop: rgba(0, 0, 0, 0.4);
    --modal-text-primary: #1f2937;
    --modal-text-secondary: #6b7280;
    --modal-text-muted: #9ca3af;
    --modal-border: rgba(229, 231, 235, 0.8);
    --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    
    /* Accent colors - Clean palette */
    --accent-primary: #2563eb;
    --accent-secondary: #6b7280;
    --accent-success: #10b981;
    --accent-hover: #1d4ed8;
    
    /* Interactive elements */
    --button-bg: #2563eb;
    --button-hover: #1d4ed8;
    --button-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    
    /* Surface colors */
    --surface-primary: #ffffff;
    --surface-secondary: rgba(248, 250, 252, 0.8);
    --surface-hover: rgba(37, 99, 235, 0.05);
    --border-color: rgba(229, 231, 235, 0.6);
}

/* Dark mode - Auto detection */
@media (prefers-color-scheme: dark) {
    :root {
        /* Force white background in dark mode too */
        --modal-bg: #ffffff;
        --modal-content-bg: #ffffff;
        --modal-backdrop: rgba(0, 0, 0, 0.4);
        --modal-text-primary: #1f2937;
        --modal-text-secondary: #6b7280;
        --modal-text-muted: #9ca3af;
        --modal-border: rgba(0, 0, 0, 0.1);
        --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
        
        /* Accent colors - Same as light mode */
        --accent-primary: #3b82f6;
        --accent-secondary: #6b7280;
        --accent-success: #10b981;
        --accent-hover: #2563eb;
        
        /* Interactive elements */
        --button-bg: #3b82f6;
        --button-hover: #2563eb;
        --button-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
        
        /* Surface colors - white backgrounds */
        --surface-primary: #ffffff;
        --surface-secondary: rgba(248, 250, 252, 1);
        --surface-hover: rgba(59, 130, 246, 0.1);
        --border-color: rgba(0, 0, 0, 0.1);
    }
}

/* Manual dark mode toggle class */
.dark-mode {
    --modal-bg: #ffffff;
    --modal-content-bg: #ffffff;
    --modal-backdrop: rgba(0, 0, 0, 0.4);
    --modal-text-primary: #1f2937;
    --modal-text-secondary: #6b7280;
    --modal-text-muted: #9ca3af;
    --modal-border: rgba(0, 0, 0, 0.1);
    --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    --accent-primary: #3b82f6;
    --accent-secondary: #6b7280;
    --accent-success: #10b981;
    --accent-hover: #2563eb;
    --button-bg: #3b82f6;
    --button-hover: #2563eb;
    --button-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    --surface-primary: #ffffff;
    --surface-secondary: rgba(248, 250, 252, 1);
    --surface-hover: rgba(59, 130, 246, 0.1);
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Override any display:none from other modal CSS */
.modal#demoModal {
    display: none !important;
}

.modal#demoModal.show {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--modal-backdrop) !important;
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: center !important;
    backdrop-filter: blur(12px) saturate(150%) !important;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.demo-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff !important;
    border-radius: 20px !important;
    position: relative !important;
    box-shadow: var(--modal-shadow) !important;
    border: 1px solid var(--modal-border);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
    backdrop-filter: blur(20px);
}

/* Force white background even in dark mode */
#demoModal .demo-modal {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

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

/* Elegant scrollbar */
.demo-modal {
    overflow-y: auto;
}

.demo-modal::-webkit-scrollbar {
    width: 4px;
}

.demo-modal::-webkit-scrollbar-track {
    background: transparent;
}

.demo-modal::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.demo-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Demo Steps */
.demo-step {
    display: none;
}

.demo-step.active {
    display: block;
}

.demo-modal-header {
    text-align: center;
    padding: 40px 40px 30px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    background: var(--surface-primary);
    position: relative;
    overflow: hidden;
}

.demo-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    opacity: 0.03;
    transform: skewX(-15deg);
    transition: all 0.6s ease;
}

.demo-modal-header:hover::before {
    left: 100%;
}

.demo-icon {
    width: 64px;
    height: 64px;
    background: var(--button-bg);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--button-shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.demo-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.35);
}

.demo-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--modal-text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.025em;
    position: relative;
    z-index: 2;
}

.demo-subtitle {
    color: var(--modal-text-secondary);
    font-size: 0.95rem;
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

.demo-modal-body {
    padding: 32px 40px 40px;
}

.demo-description {
    font-size: 1rem;
    color: var(--modal-text-secondary);
    line-height: 1.6;
    text-align: center;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.demo-description strong {
    background: var(--accent-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.demo-features {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.demo-feature {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.demo-feature:hover {
    background: #f1f5f9;
    transform: translateX(5px);
}

.demo-feature > i {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.demo-feature h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 5px 0;
}

.demo-feature p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
}

.demo-cta {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.demo-cta .btn-primary {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 16px 32px;
    margin-bottom: 16px;
    background: var(--button-bg);
    border: none;
    border-radius: 12px;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--button-shadow);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.demo-cta .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-hover);
    transition: all 0.5s ease;
    z-index: -1;
}

.demo-cta .btn-primary:hover::before {
    left: 0;
}

.demo-cta .btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.demo-note {
    color: var(--modal-text-muted);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
}

.demo-note i {
    color: #667eea;
    margin-right: 6px;
    font-size: 0.875rem;
}

/* Progress Bar */
.demo-progress {
    margin-bottom: 24px;
    padding: 0 8px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--surface-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

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

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

.progress-fill {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.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: progressShimmer 1.5s infinite;
}

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

.step-indicator {
    font-size: 0.8rem;
    color: var(--modal-text-muted);
    text-align: center;
    display: block;
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Upload Area */
.upload-area {
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 24px;
    background: rgba(248, 250, 252, 0.5);
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.03);
    transform: translateY(-1px);
}

.upload-area > i {
    font-size: 2.5rem;
    color: #d1d5db;
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.upload-area:hover > i {
    color: #667eea;
}

.upload-area h3 {
    font-size: 1.125rem;
    color: #1f2937;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.upload-area > p {
    color: var(--modal-text-muted);
    margin: 8px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.btn-upload {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 12px 0;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
}

.btn-upload:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6941a0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.upload-formats {
    font-size: 0.875rem;
    color: var(--modal-text-muted);
    margin: 15px 0 0 0;
}

/* Uploaded Files */
.uploaded-files {
    margin: 20px 0;
}

.uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 10px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-info i {
    color: #16a34a;
    font-size: 1.25rem;
}

.file-details h5 {
    margin: 0;
    color: var(--modal-text-secondary);
    font-weight: 600;
}

.file-details p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.file-remove {
    background: #ef4444;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.file-remove:hover {
    background: #dc2626;
}

/* Questions */
.questions-container {
    margin-bottom: 30px;
}

.question-item {
    margin-bottom: 20px;
}

.question-item label {
    display: block;
    font-weight: 600;
    color: var(--modal-text-secondary);
    margin-bottom: 8px;
}

.question-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.question-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Email Section */
.email-section {
    text-align: center;
}

.report-preview {
    background: #f8fafc;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    text-align: left;
}

.report-preview > i {
    font-size: 2.5rem;
    color: #3b82f6;
    flex-shrink: 0;
    margin-top: 5px;
}

.report-preview h4 {
    color: var(--modal-text-secondary);
    margin: 0 0 15px 0;
    font-size: 1.125rem;
}

.report-preview ul {
    color: #6b7280;
    margin: 0;
    padding-left: 20px;
}

.report-preview li {
    margin-bottom: 5px;
}

.email-input-section {
    margin-bottom: 25px;
}

.email-input-section label {
    display: block;
    font-weight: 600;
    color: var(--modal-text-secondary);
    margin-bottom: 15px;
}

.email-input-group {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.email-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
}

.email-input-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.skip-section {
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
}

.btn-text {
    background: none;
    border: none;
    color: #6b7280;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 10px;
}

.btn-text:hover {
    color: var(--modal-text-secondary);
}

/* Demo Actions */
.demo-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 32px;
}

/* Navigation buttons */
.demo-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.demo-actions .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: #6b7280;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.demo-actions .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--modal-text-secondary);
    transform: translateY(-1px);
}

.demo-actions .btn-primary {
    background: var(--button-bg);
    color: white;
    box-shadow: var(--button-shadow);
}

.demo-actions .btn-primary:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

/* Success Icon */
.demo-icon.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

/* Close button */
.modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    width: 32px !important;
    height: 32px !important;
    background: var(--surface-secondary) !important;
    border: none !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: var(--modal-text-muted) !important;
    font-size: 1.2rem !important;
    z-index: 10 !important;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: var(--surface-hover) !important;
    color: var(--modal-text-secondary) !important;
    transform: translateY(-1px) scale(1.05) !important;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: absolute !important;
    top: 16px !important;
    right: 56px !important;
    width: 32px !important;
    height: 32px !important;
    background: var(--surface-secondary) !important;
    border: none !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: var(--modal-text-muted) !important;
    font-size: 1rem !important;
    z-index: 10 !important;
    backdrop-filter: blur(10px);
}

.dark-mode-toggle:hover {
    background: var(--accent-primary) !important;
    color: white !important;
    transform: translateY(-1px) scale(1.05) rotate(180deg) !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .demo-modal {
        max-width: 95%;
        margin: 16px;
        max-height: 95vh;
    }
    
    .demo-modal-header {
        padding: 32px 24px 24px;
    }
    
    .demo-modal-body {
        padding: 24px 24px 32px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .email-input-group {
        flex-direction: column;
        max-width: none;
    }
    
    .demo-actions {
        flex-direction: column;
        gap: 12px;
        padding: 24px 24px 0;
    }
    
    .demo-actions button {
        width: 100%;
        padding: 12px 20px;
    }
    
    .report-preview {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .demo-icon {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }
    
    .demo-modal-header h2 {
        font-size: 1.375rem;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .demo-modal {
        max-width: 95%;
        margin: 20px;
    }
    
    .demo-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .demo-modal-header h2 {
        font-size: 1.5rem;
    }
    
    .demo-description {
        font-size: 1rem;
    }
    
    .demo-feature {
        flex-direction: column;
        text-align: center;
    }
    
    .demo-cta .btn-primary {
        width: 100%;
    }
}

/* FORCE WHITE BACKGROUND - OVERRIDE ALL */
#demoModal,
#demoModal .modal,
#demoModal .demo-modal,
.modal#demoModal,
.modal.demo-modal {
    background: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
}

/* Modal overlay should be semi-transparent black */
#demoModal::before,
.modal-overlay {
    background: rgba(0, 0, 0, 0.4) !important;
    background-color: rgba(0, 0, 0, 0.4) !important;
}