/* static/css/style.css - Complete Updated Version */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
}

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

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 3em;
    font-weight: 800;
}

header p {
    color: #7f8c8d;
    font-size: 1.3em;
    margin-bottom: 5px;
}

.subtitle {
    color: #e74c3c !important;
    font-weight: 600;
    font-size: 1.1em;
}

.hero {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.hero h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.hero p {
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.feature-icon {
    font-size: 3em;
    margin-bottom: 20px;
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.feature-card p {
    color: #7f8c8d;
    line-height: 1.6;
}

.workflow {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    margin-top: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.workflow h3 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}

.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.step {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    transition: transform 0.3s;
}

.step:hover {
    transform: scale(1.05);
}

.btn {
    display: inline-block;
    padding: 15px 35px;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.start-btn { 
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    font-size: 1.2em;
    padding: 18px 45px;
}

.primary-btn { 
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.success-btn { 
    background: linear-gradient(135deg, #27ae60, #219a52);
}

.back-btn { 
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.secondary-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.small-btn {
    padding: 8px 15px;
    font-size: 0.9em;
    margin: 0 5px;
}

/* Upload Section Styles */
.upload-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.file-input {
    margin-bottom: 30px;
}

.file-input label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.2em;
}

.file-input input[type="file"] {
    width: 100%;
    padding: 15px;
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    background: #f8f9fa;
    font-size: 16px;
    transition: all 0.3s;
}

.file-input input[type="file"]:focus {
    border-color: #3498db;
    outline: none;
    background: white;
}

.file-input small {
    color: #7f8c8d;
    font-size: 0.95em;
    display: block;
    margin-top: 8px;
}

/* Enhanced Upload Styles */
.file-drop-area {
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    cursor: pointer;
    position: relative;
}

.file-drop-area:hover {
    border-color: #3498db;
    background: #e8f4fd;
}

.file-drop-area.highlight {
    border-color: #27ae60;
    background: #d4edda;
}

.file-msg {
    font-size: 1.1em;
    color: #7f8c8d;
    display: block;
}

.file-input-element {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-preview {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    background: #f8f9fa;
}

.no-files {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-left: 10px;
}

.more-files .file-name {
    color: #3498db;
    font-style: italic;
}

.file-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 10px;
    background: #e8f4fd;
    border-radius: 6px;
    font-size: 0.9em;
}

.file-count, .total-size {
    font-weight: 600;
    color: #2c3e50;
}

.upload-tips {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.upload-tips h3 {
    color: #856404;
    margin-bottom: 15px;
}

.upload-tips ul {
    list-style: none;
    padding-left: 0;
}

.upload-tips li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    color: #856404;
}

.upload-tips li:before {
    content: "💡";
    position: absolute;
    left: 0;
}

.info-section {
    background: rgba(232, 244, 253, 0.8);
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid #3498db;
}

.info-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.info-section ol {
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 12px;
    color: #2c3e50;
    line-height: 1.6;
}

/* Progress Page Specific Styles */
.progress-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: #ecf0f1;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 20px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    width: 0%;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 50px 50px;
    animation: move 2s linear infinite;
}

@keyframes move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

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

#progressText {
    font-size: 1.4em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

#currentStep {
    color: #7f8c8d;
    font-style: italic;
    font-size: 1.1em;
}

/* Pipeline Visualization */
.pipeline-visual {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.pipeline-visual h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
}

.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.stage {
    background: #ecf0f1;
    padding: 15px 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stage::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.stage.active {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    border-color: #2980b9;
}

.stage.active::before {
    left: 100%;
}

.stage.completed {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    border-color: #219a52;
}

.stage.pending {
    background: #bdc3c7;
    color: #7f8c8d;
}

/* Statistics Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h4 {
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card div {
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: bold;
}

/* Logs Section */
.logs-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.logs-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.log-count {
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: 600;
}

.auto-scroll {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.auto-scroll input[type="checkbox"] {
    margin: 0;
}

.logs {
    background: #2c3e50;
    color: white;
    padding: 25px;
    border-radius: 15px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 2px solid #34495e;
}

.logs::-webkit-scrollbar {
    width: 8px;
}

.logs::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 4px;
}

.logs::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.logs::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.log-entry {
    margin-bottom: 10px;
    padding: 10px;
    border-bottom: 1px solid #34495e;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    border-radius: 4px;
}

.log-entry:hover {
    border-left: 3px solid #3498db;
    background: #34495e;
}

.log-entry:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* Completion Message */
.completion-message {
    background: rgba(212, 237, 218, 0.9);
    border: 2px solid #c3e6cb;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 15px 35px rgba(39, 174, 96, 0.2);
    animation: slideIn 0.5s ease-out;
}

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

.success-animation {
    text-align: center;
    margin-bottom: 20px;
}

.checkmark {
    display: inline-block;
    width: 80px;
    height: 80px;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    font-size: 40px;
    line-height: 80px;
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

.completion-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

/* Error Message */
.error-message {
    background: rgba(248, 215, 218, 0.9);
    border: 2px solid #f5c6cb;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 15px 35px rgba(231, 76, 60, 0.2);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {transform: translateX(0);}
    10%, 30%, 50%, 70%, 90% {transform: translateX(-5px);}
    20%, 40%, 60%, 80% {transform: translateX(5px);}
}

.error-message h3 {
    color: #721c24;
    margin-bottom: 15px;
}

#errorText {
    color: #721c24;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

/* Results Page Styles */
.results-summary {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    text-align: center;
}

.results-summary h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 2.2em;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.stat {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: transform 0.3s;
}

.stat:hover {
    transform: translateY(-5px);
}

.stat h3 {
    color: #7f8c8d;
    margin-bottom: 10px;
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat p {
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: bold;
}

.success {
    color: #27ae60 !important;
}

.download-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.download-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4em;
}

.download-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
    justify-content: center;
}

/* Additional Animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Loading state for submit button */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Scrollbar for file preview */
.file-preview::-webkit-scrollbar {
    width: 6px;
}

.file-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.file-preview::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.file-preview::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2.2em;
    }
    
    .hero h2 {
        font-size: 1.8em;
    }
    
    .pipeline-steps, .pipeline-stages {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .download-buttons, .completion-actions, .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .logs-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .btn {
        width: 100%;
        text-align: center;
        margin: 5px 0;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .feature-card, .stat-card {
        padding: 20px;
    }
    
    .progress-section, .pipeline-visual, .logs-section {
        padding: 25px;
    }
    
    .file-drop-area {
        padding: 30px 15px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .file-stats {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .file-name {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    header {
        padding: 20px;
    }
    
    .hero {
        padding: 30px 20px;
    }
    
    .pipeline-steps, .pipeline-stages {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .feature-card h3 {
        font-size: 1.2em;
    }
    
    .progress-fill {
        font-size: 14px;
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-success {
    color: #27ae60;
}

.text-warning {
    color: #f39c12;
}

.text-danger {
    color: #e74c3c;
}

.text-info {
    color: #3498db;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}