@use '../globals' as *;

// Onboarding Wizard Styles

.ipz-onboarding-wrapper {
    display: flex;
    background: #fff;
    min-height: 600px;
    max-width: 900px;
    margin: 40px auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

// Sidebar
.ipz-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    padding: 30px;
    flex-shrink: 0;

    .ipz-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 40px;

        .dashicons {
            font-size: 24px;
            color: #2271b1;
            width: 24px;
            height: 24px;
        }

        h1 {
            font-size: 16px;
            font-weight: 600;
            color: #1d2327;
            margin: 0;
            line-height: 1.2;
        }
    }
}

.ipz-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ipz-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: #646970;

    .step-number {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 2px solid #c3c4c7;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 600;
        transition: all 0.2s;
    }

    .step-title {
        font-size: 14px;
        font-weight: 500;
    }

    &.active {
        color: #1d2327;

        .step-number {
            border-color: #2271b1;
            background: #2271b1;
            color: #fff;
        }
    }

    &.completed {
        color: #2271b1;

        .step-number {
            border-color: #2271b1;
            background: #fff;
            color: #2271b1;
        }
    }
}

// Content Area
.ipz-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
}

.ipz-content-header {
    margin-bottom: 30px;

    h2 {
        margin: 0;
        font-size: 24px;
        color: #1d2327;
    }
}

.ipz-content-body {
    flex-grow: 1;
}

.step-container {
    max-width: 480px;

    &.center-align {
        text-align: center;
        margin-top: 60px;
    }

    .step-description {
        font-size: 15px;
        color: #50575e;
        line-height: 1.5;
        margin-bottom: 25px;
    }
}

// Option Cards (Step 3)
.option-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;

    &:hover {
        border-color: #2271b1;
    }

    &.selected {
        border-color: #2271b1;
        background: #f0f6fc;

        .option-radio {
            color: #2271b1;
        }
    }

    .option-radio {
        font-size: 18px;
        color: #c3c4c7;
        margin-top: 2px;
    }

    .option-content {
        strong {
            display: block;
            margin-bottom: 4px;
            color: #1d2327;
        }

        span {
            font-size: 13px;
            color: #646970;
        }
    }
}

// API Verification
.api-verify-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.api-status-message {
    font-size: 13px;
    font-weight: 500;

    &.success {
        color: #00a32a;
    }

    &.error {
        color: #d63638;
    }
}

// Success Step
.success-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

// Footer buttons
.ipz-content-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: flex;
    justify-content: flex-end; // Push Next button to right
    gap: 15px;
    margin-top: 20px;

    /* If there's a back button, push it to the left */
    /* We achieve this by targeting the buttons directly if needed, or relying on flex layout order */
    /* Assuming Back is added first, then Next */
}

/* Button override for Back to push it left, assuming only 2 buttons max */
.ipz-content-footer>button:first-child:nth-last-child(2) {
    margin-right: auto;
}

// Plan selection region (DataRegion: skeleton -> keyed plan cards)
.ipz-tier-cards {
    margin: 20px 0;

    .international-skeleton-wrapper--stat-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
    }
}

.ipz-tier-cards__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.ipz-tier-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;

    &:focus-visible {
        outline: 2px solid #2271b1;
        outline-offset: 2px;
    }

    &--selected {
        border-color: #2271b1;
    }

    &--recommended {
        box-shadow: 0 2px 10px rgba(34, 113, 177, 0.15);
    }

    [hidden] {
        display: none;
    }

    &__badge {
        position: absolute;
        top: -12px;
        right: 12px;
        background: #2271b1;
        color: #fff;
        border-radius: 10px;
        padding: 2px 10px;
        font-size: 11px;
    }

    &__amount {
        font-size: 28px;
        font-weight: 600;
    }

    &__period {
        color: #666;
        margin-left: 4px;
    }

    &__features {
        margin: 12px 0;
        padding-left: 18px;
        list-style: disc;
    }

    &__price--annual {
        display: none;
    }
}

.ipz-tier-cards--annual .ipz-tier-card {
    &__price--monthly {
        display: none;
    }

    &__price--annual {
        display: block;
    }
}
