/**
 * Opti-Behavior Onboarding Popup Styles
 *
 * Displayed on the dashboard after first activation when no data exists yet.
 * Guides users through understanding that tracking is active and how to see first results.
 *
 * NOTE: Many properties use !important to override the admin-notices.css global
 * hide rules (which use !important on display, visibility, opacity, height, margin,
 * padding, overflow for wildcard selectors like div[class*="onboard"], div[class*="preview"], etc.).
 *
 * @package opti-behavior
 * @since 1.6.0
 */

/* ── Overlay ─────────────────────────────────────────────────── */
.ob-setup-overlay {
    position: fixed !important;
    top: 32px !important; /* Below WP admin bar */
    left: 160px !important; /* Right of WP admin sidebar */
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    z-index: 100050 !important;
    animation: opti-onboarding-fadein 0.3s ease;
    height: auto !important;
    overflow: visible !important;
    margin: 0 !important;
}

/* Collapsed sidebar */
.folded .ob-setup-overlay {
    left: 36px !important;
}

@keyframes opti-onboarding-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal ───────────────────────────────────────────────────── */
.ob-setup-modal {
    background: #ffffff !important;
    border: 0.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 560px !important;
    overflow: hidden !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    animation: opti-onboarding-slideup 0.35s ease;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes opti-onboarding-slideup {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ──────────────────────────────────────────────────── */
.ob-setup-modal .ob-modal-header {
    background: #7c3aed !important;
    padding: 20px 24px 16px !important;
    position: relative !important;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-modal-header-top {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-plugin-icon {
    width: 36px !important;
    height: 36px !important;
    background: transparent !important;
    border-radius: 9px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.ob-setup-modal .ob-plugin-icon img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
    display: block !important;
    object-fit: cover !important;
}

.ob-setup-modal .ob-plugin-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    line-height: 1.3;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-plugin-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Progress ────────────────────────────────────────────────── */
.ob-setup-modal .ob-progress-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-step-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.2s;
    cursor: pointer;
    border: none;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-step-dot.active {
    background: #fff !important;
}

.ob-setup-modal .ob-step-dot.done {
    background: #10b981 !important;
}

.ob-setup-modal .ob-progress-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: auto !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-progress-bar-wrap {
    height: 3px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 2px;
    margin-top: 10px !important;
    display: block !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.ob-setup-modal .ob-progress-bar-fill {
    height: 100% !important;
    background: #10b981 !important;
    border-radius: 2px;
    transition: width 0.4s ease;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Body ────────────────────────────────────────────────────── */
.ob-setup-modal .ob-modal-body {
    padding: 24px !important;
    display: block !important;
    max-height: calc(100vh - 200px) !important;
    margin: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.ob-setup-modal .ob-step-panel {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-step-panel.active {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-step-title {
    font-size: 17px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 6px !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-step-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 18px !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
}

/* ── Status box ──────────────────────────────────────────────── */
.ob-setup-modal .ob-status-box {
    background: #ecfdf5 !important;
    border: 0.5px solid #a7f3d0 !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    height: auto !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-status-dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px;
    border-radius: 50%;
    background: #10b981 !important;
    animation: opti-onboarding-pulse 2s infinite;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

@keyframes opti-onboarding-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.ob-setup-modal .ob-status-text {
    font-size: 13px;
    font-weight: 500;
    color: #059669;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Preview cards (Step 1) ──────────────────────────────────── */
.ob-setup-modal .ob-feature-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-feature-tile {
    background: #f8fafc !important;
    border: 0.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    text-align: center !important;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-feature-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 7px;
    margin: 0 auto 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-feature-name {
    font-size: 11px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-feature-info {
    font-size: 10px;
    color: #64748b;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-feature-info.ob-feature-badges {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
}

.ob-setup-modal .ob-feature-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 18px !important;
    padding: 2px 9px !important;
    border-radius: 999px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: 0.04em !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
}

.ob-setup-modal .ob-feature-badge-free {
    color: #047857 !important;
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
}

.ob-setup-modal .ob-feature-badge-pro {
    color: #c2410c !important;
    background: #fff7ed !important;
    border: 1px solid #fed7aa !important;
}

/* ── Savings row (Step 1) ────────────────────────────────────── */
.ob-setup-modal .ob-savings-row {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-savings-chip {
    flex: 1;
    background: #f8fafc !important;
    border: 0.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    text-align: center !important;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-savings-num {
    font-size: 18px;
    font-weight: 500;
    color: #1e293b;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-savings-lbl {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
}

/* ── Goal grid (Step 2) ──────────────────────────────────────── */
.ob-setup-modal .ob-goal-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-goal-btn {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    cursor: pointer;
    text-align: left;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    transition: border-color 0.15s, background 0.15s;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-goal-btn:hover {
    border-color: #7c3aed !important;
    background: #ffffff !important;
}

.ob-setup-modal .ob-goal-btn.selected {
    border-color: #7c3aed !important;
    background: rgba(124, 58, 237, 0.05) !important;
}

.ob-setup-modal .ob-goal-icon-wrap {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px;
    border-radius: 8px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-goal-name {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-goal-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Wow box (Step 3) ────────────────────────────────────────── */
.ob-setup-modal .ob-wow-box {
    background: #f8fafc !important;
    border: 0.5px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 14px !important;
    margin-bottom: 14px !important;
    display: block !important;
    height: auto !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-wow-step {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 6px 0 !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-wow-num {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    border-radius: 50%;
    background: #7c3aed !important;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-wow-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    padding-top: 2px !important;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
}

.ob-setup-modal .ob-email-report-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(59, 130, 246, 0.06)) !important;
    border: 0.5px solid rgba(124, 58, 237, 0.2) !important;
    border-radius: 10px !important;
    padding: 14px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 14px !important;
}

.ob-setup-modal .ob-email-report-icon {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.14) !important;
}

.ob-setup-modal .ob-email-report-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin-bottom: 4px !important;
}

.ob-setup-modal .ob-email-report-text {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.5 !important;
}

.ob-setup-modal .ob-email-settings-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 2px !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    background: #7c3aed !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.22) !important;
}

.ob-setup-modal .ob-email-settings-link:hover {
    background: #6d28d9 !important;
    color: #ffffff !important;
}

/* ── Footer ──────────────────────────────────────────────────── */
.ob-setup-modal .ob-divider {
    height: 0.5px !important;
    background: #e2e8f0 !important;
    margin: 0 24px 20px !important;
    display: block !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-modal-footer {
    padding: 0 24px 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-btn-skip {
    font-size: 12px;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0 !important;
    display: inline-block !important;
    height: auto !important;
    margin: 0 !important;
}

.ob-setup-modal .ob-btn-skip:hover {
    color: #64748b;
}

.ob-setup-modal .ob-btn-next {
    background: #7c3aed !important;
    color: #fff !important;
    border: none;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: background 0.15s;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-btn-next:hover {
    background: #6d28d9 !important;
}

/* ── Success screen ──────────────────────────────────────────── */
.ob-setup-modal .ob-success-screen {
    padding: 32px 40px !important;
    text-align: center !important;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-success-icon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    background: #ecfdf5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 14px !important;
    padding: 0 !important;
    overflow: visible !important;
}

.ob-setup-modal .ob-success-title {
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 8px !important;
    display: block !important;
    height: auto !important;
    padding: 0 !important;
}

.ob-setup-modal .ob-success-desc {
    font-size: 13px;
    color: #64748b;
    display: block !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ── PRO badge in preview cards ──────────────────────────────── */
.ob-setup-modal .ob-pro-badge {
    display: inline-block !important;
    font-size: 8px;
    font-weight: 600;
    background: #7c3aed !important;
    color: #fff;
    padding: 1px 4px !important;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 3px !important;
    letter-spacing: 0.5px;
    height: auto !important;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media screen and (max-width: 960px) {
    .ob-setup-overlay {
        left: 36px !important;
    }
}

@media screen and (max-width: 782px) {
    .ob-setup-overlay {
        top: 46px !important; /* Mobile admin bar height */
        left: 0 !important;
    }

    .ob-setup-modal .ob-feature-grid {
        grid-template-columns: 1fr !important;
    }

    .ob-setup-modal .ob-goal-grid {
        grid-template-columns: 1fr !important;
    }

    .ob-setup-modal .ob-savings-row {
        flex-direction: column !important;
    }
}

@media screen and (max-width: 480px) {
    .ob-setup-modal {
        border-radius: 8px !important;
    }

    .ob-setup-modal .ob-modal-body {
        padding: 16px !important;
    }
}
