/* ============================================================================
   Data Integration Wizard Panel - Styles
   ============================================================================ */

#dataIntegrationWizardContainer {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.98));
    border: 2px solid rgba(139, 69, 19, 0.4); /* Brown theme for data integration */
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 1000;
}

#dataIntegrationWizardContainer .panel-header {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.3), rgba(160, 82, 45, 0.2));
    border-bottom: 1px solid rgba(139, 69, 19, 0.3);
}

/* ============================================================================
   Wizard Steps Container
   ============================================================================ */

.wizard-steps-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.wizard-step {
    flex: 1;
    text-align: center;
    padding: 15px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wizard-step::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -10px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid rgba(139, 69, 19, 0.3);
}

.wizard-step:last-child::after {
    display: none;
}

.wizard-step.inactive {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-step.active {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.4), rgba(160, 82, 45, 0.3));
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.wizard-step.completed {
    opacity: 0.8;
}

.wizard-step-number {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    border-radius: 50%;
    background: rgba(139, 69, 19, 0.5);
    color: #fff;
    font-weight: bold;
    margin-bottom: 8px;
}

.wizard-step.active .wizard-step-number {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    box-shadow: 0 0 15px rgba(139, 69, 19, 0.6);
}

.wizard-step.completed .wizard-step-number {
    background: #28a745;
}

.wizard-step-title {
    font-size: 12px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wizard-step.active .wizard-step-title {
    color: #fff;
    font-weight: 600;
}

/* ============================================================================
   Wizard Content Area
   ============================================================================ */

.wizard-content {
    padding: 20px;
    min-height: 300px;
}

.wizard-step-content {
    display: none;
}

.wizard-step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.wizard-form-group {
    margin-bottom: 20px;
}

.wizard-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
    font-weight: 500;
    font-size: 14px;
}

.wizard-form-group input[type="text"],
.wizard-form-group input[type="number"],
.wizard-form-group input[type="time"],
.wizard-form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.wizard-form-group input:focus,
.wizard-form-group select:focus {
    outline: none;
    border-color: rgba(139, 69, 19, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.3);
}

.wizard-form-group input[type="checkbox"] {
    margin-right: 8px;
}

.wizard-form-group .checkbox-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* ============================================================================
   Source Type Toggle
   ============================================================================ */

.source-type-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.source-type-btn {
    flex: 1;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.source-type-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(139, 69, 19, 0.5);
}

.source-type-btn.active {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.4), rgba(160, 82, 45, 0.3));
    border-color: #8B4513;
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.4);
}

.source-type-btn .icon {
    font-size: 24px;
    margin-bottom: 5px;
    display: block;
}

/* ============================================================================
   Dashboard Display
   ============================================================================ */

.wizard-dashboard {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.dashboard-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.dashboard-stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #8B4513;
    margin-bottom: 5px;
}

.dashboard-stat-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-execution-log {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 15px;
}

.execution-log-entry {
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    border-radius: 4px;
    font-size: 13px;
}

.execution-log-entry.success {
    border-left-color: #28a745;
}

.execution-log-entry.error {
    border-left-color: #dc3545;
}

.execution-log-entry.pending {
    border-left-color: #ffc107;
}

.execution-log-entry .log-filename {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.execution-log-entry .log-details {
    font-size: 11px;
    color: #999;
}

/* ============================================================================
   Control Buttons
   ============================================================================ */

.wizard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid rgba(139, 69, 19, 0.3);
    background: rgba(0, 0, 0, 0.2);
}

.wizard-btn {
    padding: 10px 20px;
    border: 1px solid rgba(139, 69, 19, 0.4);
    border-radius: 6px;
    background: rgba(139, 69, 19, 0.2);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.wizard-btn:hover {
    background: rgba(139, 69, 19, 0.4);
    border-color: #8B4513;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.wizard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wizard-btn.primary {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    border-color: #8B4513;
}

.wizard-btn.primary:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513);
    box-shadow: 0 4px 16px rgba(139, 69, 19, 0.5);
}

.wizard-btn.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
}

.wizard-btn.success:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
}

.wizard-btn.danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-color: #dc3545;
}

.wizard-btn.danger:hover {
    background: linear-gradient(135deg, #c82333, #dc3545);
}

.wizard-btn.start-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-color: #007bff;
    font-weight: 600;
}

.wizard-btn.start-btn:hover {
    background: linear-gradient(135deg, #0056b3, #007bff);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.5);
}

.wizard-btn.complete-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #28a745;
    font-weight: 600;
}

.wizard-btn.complete-btn:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.5);
}

/* ============================================================================
   Execution Controls (Step 4)
   ============================================================================ */

.execution-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
}

.execution-controls .wizard-btn {
    flex: 1 1 auto;
    min-width: 140px;
    max-width: 200px;
    white-space: nowrap;
    overflow: visible;
}

.batch-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.batch-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-info-row:last-child {
    border-bottom: none;
}

.batch-info-label {
    color: #999;
    font-size: 13px;
}

.batch-info-value {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

/* ============================================================================
   File List Display
   ============================================================================ */

.file-list {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
}

.file-list-item {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.file-list-item .filename {
    color: #ddd;
}

.file-list-item .file-order {
    color: #8B4513;
    font-weight: 600;
    font-size: 11px;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
    #dataIntegrationWizardContainer {
        width: calc(100% - 40px);
        max-width: 90vw;
    }

    .wizard-steps-container {
        flex-direction: column;
    }

    .wizard-step::after {
        display: none;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .execution-controls {
        flex-direction: column;
    }
}
