/**
 * Setup Wizard Styles - iFlows for WooCommerce

 * @package iFlows_for_WooCommerce
 * @since 1.0.0
 */

.iflows-wizard {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.iflows-wizard-header {
    background: #f0f0f1;
    padding: 24px;
    border-bottom: 1px solid #ccd0d4;
}

.iflows-wizard-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
    color: #1d2327;
}

.iflows-wizard-content {
    padding: 32px;
}

.iflows-wizard-steps {
    display: flex;
    justify-content: space-between;
    padding: 24px 32px;
    background: #fff;
    border-bottom: 1px solid #ccd0d4;
}

.iflows-wizard-steps .step {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    background: #f0f0f1;
    color: #50575e;
    border-radius: 4px;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.iflows-wizard-steps .step:not(:last-child) {
    margin-right: 16px;
}

.iflows-wizard-steps .step.active {
    background: #2271b1;
    color: #fff;
}

.iflows-wizard-steps .step.done {
    background: #46b450;
    color: #fff;
}

.iflows-wizard-steps .step.done::after {
    content: "✓";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
}

.iflows-wizard-content h2 {
    margin-top: 0;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.4;
    color: #1d2327;
}

.iflows-wizard-content h3 {
    font-size: 18px;
    font-weight: 500;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1d2327;
}

.iflows-wizard-content p {
    line-height: 1.6;
    color: #50575e;
}

.iflows-wizard-checklist {
    list-style: disc;
    margin-left: 20px;
    line-height: 1.8;
    color: #50575e;
}

.iflows-next-steps {
    line-height: 1.8;
    color: #50575e;
    padding-left: 20px;
}

.iflows-warehouse-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.iflows-wizard-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #dcdcde;
    display: flex;
    gap: 12px;
    align-items: center;
}

.iflows-wizard-actions .button {
    text-decoration: none;
}

.iflows-wizard-success {
    text-align: center;
    padding: 24px;
    background: #f0f6fc;
    border-radius: 4px;
    margin-bottom: 32px;
}

.iflows-wizard-success .success-title {
    color: #46b450;
    margin: 0 0 16px 0;
}

.iflows-wizard-success p {
    margin: 8px 0;
}

.iflows-wizard-success .status-active {
    color: #46b450;
    font-weight: 500;
}

.iflows-info-box {
    background: #f1f1f1;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 24px;
}

.iflows-info-box p {
    margin: 8px 0;
}

.iflows-info-box p:first-child {
    margin-top: 0;
}

.iflows-info-box p:last-child {
    margin-bottom: 0;
}

.iflows-warning-box {
    background: #fff3cd;
    padding: 16px;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    margin-bottom: 24px;
}

.iflows-warning-box p {
    margin: 0;
    color: #856404;
}

.iflows-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.iflows-stats-card {
    text-align: center;
    padding: 24px 16px;
    background: #f9f9f9;
    border-radius: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.iflows-stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.iflows-stats-card .stats-value {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: 8px;
}

.iflows-stats-card .stats-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.iflows-stats-card-blue .stats-value {
    color: #0073aa;
}

.iflows-stats-card-green .stats-value {
    color: #46b450;
}

.iflows-stats-card-red .stats-value {
    color: #d63638;
}

.iflows-wizard-message {
    margin: 20px 0;
    padding: 12px 16px;
    border-radius: 4px;
    border-left: 4px solid;
    font-size: 14px;
}

.iflows-wizard-message.success {
    background: #ecf7ed;
    border-color: #46b450;
    color: #1e4620;
}

.iflows-wizard-message.error {
    background: #fcf0f1;
    border-color: #d63638;
    color: #3c1518;
}

.iflows-wizard-message.info {
    background: #f0f6fc;
    border-color: #2271b1;
    color: #1e293b;
}

#test-result {
    display: none;
    margin: 20px 0;
    padding: 12px 16px;
    border-radius: 4px;
    border-left: 4px solid;
    font-weight: 500;
    font-size: 14px;
}

#test-result.iflows-wizard-success {
    display: block;
    background: #ecf7ed;
    border-color: #46b450;
    color: #1e4620;
}

#test-result.iflows-wizard-error {
    display: block;
    background: #fcf0f1;
    border-color: #d63638;
    color: #d63638;
    font-weight: 600;
}

.iflows-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px #d63638;
}

.iflows-field-error-message {
    display: block;
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

#url-error {
    display: block;
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

.iflows-wizard-content .form-table {
    margin-top: 24px;
}

.iflows-wizard-content .form-table th {
    padding: 16px 10px 16px 0;
    font-weight: 500;
}

.iflows-wizard-content .form-table td {
    padding: 16px 10px;
}

.iflows-wizard-content .form-table input[type="url"],
.iflows-wizard-content .form-table input[type="password"] {
    width: 100%;
    max-width: 400px;
}

.iflows-wizard-content .form-table .description {
    margin-top: 8px;
    color: #646970;
    font-size: 13px;
}

.iflows-wizard-content .button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.iflows-wizard-content .button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

.iflows-message-success {
    color: #46b450;
    font-weight: 500;
}

.iflows-message-error {
    color: #d63638;
    font-weight: 500;
}

.iflows-message-loading {
    color: #2271b1;
    font-weight: 500;
}

.iflows-message-info {
    color: #646970;
    font-weight: 500;
}

.button.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

/* ========================================
   Setup Step Styles - Progress & Status
   ======================================== */

.iflows-setup-progress {
    max-width: 600px;
    margin: 0 auto;
}

.iflows-progress-steps {
    margin-bottom: 32px;
}

.progress-step {
    display: flex;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #dcdcde;
    transition: all 0.3s ease;
}

.progress-step .step-icon {
    font-size: 24px;
    margin-right: 16px;
    min-width: 32px;
    text-align: center;
}

.progress-step .step-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #50575e;
}

.progress-step .step-status {
    font-size: 13px;
    font-weight: 600;
    color: #646970;
    min-width: 60px;
    text-align: right;
}

/* Step states */
.progress-step.step-processing {
    background: #f0f6fc;
    border-left-color: #2271b1;
}

.progress-step.step-processing .step-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-step.step-complete {
    background: #ecf7ed;
    border-left-color: #46b450;
}

.progress-step.step-complete .step-icon {
    color: #46b450;
}

.progress-step.step-complete .step-status {
    color: #46b450;
}

.progress-step.step-error {
    background: #fcf0f1;
    border-left-color: #d63638;
}

.progress-step.step-error .step-icon {
    color: #d63638;
}

.progress-step.step-error .step-status {
    color: #d63638;
}

/* Progress bar */
.iflows-progress-bar {
    width: 100%;
    height: 24px;
    background: #f0f0f1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
}

.iflows-progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    margin-bottom: 24px;
}

/* Error display */
.iflows-setup-error {
    display: none;
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 6px;
    padding: 20px;
    margin-top: 24px;
}

.iflows-setup-error .error-message {
    color: #d63638;
    font-weight: 500;
    margin-bottom: 16px;
    font-size: 14px;
}

.iflows-setup-error .button {
    margin-right: 8px;
}

/* Pulse animation for processing step */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Sync explanation box */
.iflows-sync-explanation {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
}

.iflows-sync-explanation h4 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #1d2327;
}

.iflows-sync-explanation p {
    margin: 8px 0;
    padding-left: 16px;
}

.iflows-sync-explanation strong {
    color: #1d2327;
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    padding-left: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .iflows-stats-grid {
        grid-template-columns: 1fr;
    }

    .progress-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-step .step-icon {
        margin-bottom: 8px;
    }

    .progress-step .step-status {
        text-align: left;
        margin-top: 8px;
    }
}