@use '../globals' as *;

// Onboarding Wizard Styles

.mpz-onboarding-wrapper {
    display: flex;
    background: #fff;
    min-height: 600px;
    max-width: 960px;
    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
.mpz-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    padding: 30px;
    flex-shrink: 0;

    .mpz-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;
        }
    }
}

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

.mpz-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
.mpz-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
}

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

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

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

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

    &.center-align {
        text-align: center;
        margin: 60px auto 0;
        max-width: 480px;
    }

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

// Option Cards (URL structure)
.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
.mpz-content-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

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

// ========================================
// Welcome Screen
// ========================================

.mpz-welcome-icon {
    margin-bottom: 24px;

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

.mpz-welcome-title {
    font-size: 28px;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 16px;
}

.mpz-welcome-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

// ========================================
// Billing Toggle
// ========================================

.mpz-billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: #f0f0f1;
    border-radius: 6px;
    padding: 4px;
    margin-bottom: 24px;

    &__option {
        padding: 8px 20px;
        font-size: 14px;
        font-weight: 500;
        color: #646970;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
        user-select: none;

        &--active {
            background: #fff;
            color: #1d2327;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        &:hover:not(&--active) {
            color: #1d2327;
        }
    }

    &__badge {
        margin-left: 10px;
        font-size: 12px;
        font-weight: 600;
        color: #00a32a;
        background: #edfaef;
        padding: 3px 8px;
        border-radius: 10px;
    }
}

// ========================================
// Tier Cards
// ========================================

.mpz-tier-step {
    max-width: 100%;
}

.mpz-tier-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.mpz-tier-card {
    position: relative;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;

    &:hover {
        border-color: #2271b1;
        box-shadow: 0 2px 8px rgba(34, 113, 177, 0.1);
    }

    &--selected {
        border-color: #2271b1;
        background: #f0f6fc;
        box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
    }

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

    &__badge {
        position: absolute;
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
        background: #2271b1;
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        padding: 3px 12px;
        border-radius: 10px;
        white-space: nowrap;
    }

    &__name {
        font-size: 18px;
        font-weight: 600;
        color: #1d2327;
        margin: 0 0 12px;
    }

    &__price {
        margin-bottom: 12px;
    }

    &__amount {
        font-size: 32px;
        font-weight: 700;
        color: #1d2327;
    }

    &__period {
        font-size: 14px;
        color: #646970;
        margin-left: 4px;
    }

    &__languages {
        font-size: 14px;
        color: #2271b1;
        font-weight: 500;
        margin: 0 0 16px;
    }

    &__features {
        list-style: none;
        padding: 0;
        margin: 0 0 16px;

        li {
            font-size: 13px;
            color: #50575e;
            padding: 4px 0;
            line-height: 1.4;

            &::before {
                content: '✓';
                color: #00a32a;
                font-weight: 600;
                margin-right: 8px;
            }
        }
    }

    &__select {
        text-align: center;
    }
}

.mpz-tier-loading {
    text-align: center;
    padding: 40px 0;
    color: #646970;
}

// ========================================
// Onboarding Form (Register / Login)
// ========================================

.mpz-onboarding-form {
    max-width: 400px;

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

    .presszone-multilingual-label--settings {
        display: block;
        margin-bottom: 6px;
        font-weight: 500;
        color: #1d2327;
    }

    .presszone-multilingual-input--settings {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #c3c4c7;
        border-radius: 4px;
        font-size: 14px;

        &:focus {
            border-color: #2271b1;
            box-shadow: 0 0 0 1px #2271b1;
            outline: none;
        }
    }
}

.mpz-onboarding-link {
    font-size: 14px;
    color: #646970;
    margin-top: 16px;

    a {
        color: #2271b1;
        text-decoration: none;
        font-weight: 500;

        &:hover {
            text-decoration: underline;
        }
    }
}

.mpz-onboarding-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 20px;

    p {
        margin: 0;
        color: #d63638;
        font-size: 14px;
    }
}

// ========================================
// Checkout Summary
// ========================================

.mpz-checkout-summary {
    background: #f8f9fa;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;

    &__plan {
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid #eee;

        h3 {
            margin: 0 0 4px;
            font-size: 20px;
            font-weight: 600;
            color: #1d2327;
        }
    }

    &__cycle {
        font-size: 14px;
        color: #646970;
        margin: 0;
    }

    &__price {
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid #eee;
    }

    &__amount {
        font-size: 36px;
        font-weight: 700;
        color: #1d2327;
    }

    &__period {
        font-size: 14px;
        color: #646970;
        margin-left: 6px;
    }

    &__details {
        p {
            margin: 0;
            font-size: 14px;
            color: #50575e;
        }
    }
}

.mpz-checkout-features {
    margin-bottom: 24px;

    h4 {
        font-size: 14px;
        font-weight: 600;
        color: #1d2327;
        margin: 0 0 12px;
    }

    ul {
        list-style: none;
        padding: 0;
        margin: 0;

        li {
            font-size: 14px;
            color: #50575e;
            padding: 4px 0;

            &::before {
                content: '✓';
                color: #00a32a;
                font-weight: 600;
                margin-right: 8px;
            }
        }
    }
}

// ========================================
// Language Setup
// ========================================

.mpz-setup-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 24px 0 8px;

    &:first-of-type {
        margin-top: 0;
    }
}

// ========================================
// Complete Screen
// ========================================

.mpz-complete-screen {
    .success-icon {
        font-size: 64px;
        margin-bottom: 24px;
    }

    h2 {
        font-size: 28px;
        font-weight: 600;
        color: #1d2327;
        margin: 0 0 16px;
    }
}

.mpz-complete-tier {
    font-size: 15px;
    color: #50575e;
    margin-bottom: 32px;

    strong {
        color: #2271b1;
        text-transform: capitalize;
    }
}

// ========================================
// Dark Mode Support
// ========================================

.mpz-onboarding-wrapper {
    @include dark-mode-class {
        background: #1e1e1e;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }
}

.mpz-sidebar {
    @include dark-mode-class {
        background: #2c2c2c;
        border-right-color: #3c3c3c;

        .mpz-logo {
            h1 { color: #e0e0e0; }
            .dashicons { color: #4da6e8; }
        }
    }
}

.mpz-step {
    @include dark-mode-class {
        color: #999;

        &.active {
            color: #e0e0e0;
            .step-number { background: #4da6e8; border-color: #4da6e8; }
        }

        &.completed {
            color: #4da6e8;
            .step-number { border-color: #4da6e8; background: #2c2c2c; color: #4da6e8; }
        }
    }
}

.mpz-content {
    @include dark-mode-class {
        background: #1e1e1e;
    }
}

.mpz-content-header h2 {
    @include dark-mode-class { color: #e0e0e0; }
}

.step-container .step-description {
    @include dark-mode-class { color: #b0b0b0; }
}

.mpz-welcome-title {
    @include dark-mode-class { color: #e0e0e0; }
}

.mpz-welcome-icon .dashicons {
    @include dark-mode-class { color: #4da6e8; }
}

.option-card {
    @include dark-mode-class {
        border-color: #3c3c3c;
        background: #2c2c2c;

        &:hover { border-color: #4da6e8; }

        &.selected {
            border-color: #4da6e8;
            background: #1a3a5c;
            .option-radio { color: #4da6e8; }
        }

        .option-content {
            strong { color: #e0e0e0; }
            span { color: #999; }
        }

        .option-radio { color: #555; }
    }
}

.mpz-content-footer {
    @include dark-mode-class { border-top-color: #3c3c3c; }
}

.mpz-billing-toggle {
    @include dark-mode-class {
        background: #2c2c2c;
    }

    &__option {
        @include dark-mode-class {
            color: #999;

            &--active { background: #3c3c3c; color: #e0e0e0; }
        }
    }

    &__badge {
        @include dark-mode-class { background: #1a3a2a; color: #4caf50; }
    }
}

.mpz-tier-card {
    @include dark-mode-class {
        border-color: #3c3c3c;
        background: #2c2c2c;

        &:hover { border-color: #4da6e8; }
    }

    &--selected {
        @include dark-mode-class { border-color: #4da6e8; background: #1a3a5c; }
    }

    &__badge {
        @include dark-mode-class { background: #4da6e8; }
    }

    &__name {
        @include dark-mode-class { color: #e0e0e0; }
    }

    &__amount {
        @include dark-mode-class { color: #e0e0e0; }
    }

    &__period {
        @include dark-mode-class { color: #999; }
    }

    &__languages {
        @include dark-mode-class { color: #4da6e8; }
    }

    &__features li {
        @include dark-mode-class { color: #b0b0b0; }
    }
}

.mpz-tier-loading {
    @include dark-mode-class { color: #999; }
}

.mpz-onboarding-form {
    @include dark-mode-class {
        .presszone-multilingual-label--settings { color: #e0e0e0; }

        .presszone-multilingual-input--settings {
            background: #2c2c2c;
            border-color: #3c3c3c;
            color: #e0e0e0;

            &:focus { border-color: #4da6e8; box-shadow: 0 0 0 1px #4da6e8; }
        }
    }
}

.mpz-onboarding-link {
    @include dark-mode-class {
        color: #999;
        a { color: #4da6e8; }
    }
}

.mpz-onboarding-error {
    @include dark-mode-class {
        background: #3c1a1a;
        border-color: #d63638;
        p { color: #ff8a8a; }
    }
}

.mpz-checkout-summary {
    @include dark-mode-class {
        background: #2c2c2c;
        border-color: #3c3c3c;
    }

    &__plan {
        @include dark-mode-class {
            border-bottom-color: #3c3c3c;
            h3 { color: #e0e0e0; }
        }
    }

    &__cycle {
        @include dark-mode-class { color: #999; }
    }

    &__price {
        @include dark-mode-class { border-bottom-color: #3c3c3c; }
    }

    &__amount {
        @include dark-mode-class { color: #e0e0e0; }
    }

    &__period {
        @include dark-mode-class { color: #999; }
    }

    &__details p {
        @include dark-mode-class { color: #b0b0b0; }
    }
}

.mpz-checkout-features {
    @include dark-mode-class {
        h4 { color: #e0e0e0; }
        ul li { color: #b0b0b0; }
    }
}

.mpz-setup-section-title {
    @include dark-mode-class { color: #e0e0e0; }
}

.mpz-complete-screen h2 {
    @include dark-mode-class { color: #e0e0e0; }
}

.mpz-complete-tier {
    @include dark-mode-class {
        color: #b0b0b0;
        strong { color: #4da6e8; }
    }
}

// ========================================
// Responsive
// ========================================

@media (max-width: 768px) {
    .mpz-onboarding-wrapper {
        flex-direction: column;
        margin: 20px auto;
        max-width: 100%;
    }

    .mpz-sidebar {
        width: 100%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .mpz-steps {
        display: flex;
        gap: 8px;
        overflow-x: auto;
    }

    .mpz-step {
        flex-shrink: 0;
        padding: 8px 0;
    }

    .mpz-content {
        padding: 24px;
    }

    .mpz-tier-cards {
        grid-template-columns: 1fr;
    }

    .mpz-checkout-summary {
        padding: 16px;
    }
}
