/* =============================================
   InviteBuilder — Onboarding System CSS
   Welcome modal, empty state, tour, banner, help
   ============================================= */

/* ─────────── 1. WELCOME MODAL (Dashboard) ─────────── */
.onb-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.onb-overlay.active {
    opacity: 1;
    visibility: visible;
}

.onb-welcome {
    background: #fff;
    border-radius: 20px;
    padding: 48px 40px 36px;
    max-width: 460px;
    width: 92%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    transform: translateY(30px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
.onb-overlay.active .onb-welcome {
    transform: translateY(0) scale(1);
}

.onb-welcome__emoji {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    animation: onb-bounce 0.6s ease 0.3s both;
}

@keyframes onb-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.onb-welcome__title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.onb-welcome__desc {
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.65;
    margin-bottom: 32px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.onb-welcome__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    width: 100%;
    justify-content: center;
}
.onb-welcome__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45);
}
.onb-welcome__cta:active {
    transform: translateY(0);
}

.onb-welcome__gallery-link {
    display: block;
    margin-top: 16px;
    font-size: 0.82rem;
    color: #6366f1;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.onb-welcome__gallery-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ─────────── 2. EMPTY STATE (Dashboard) ─────────── */
.onb-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px 48px;
    text-align: center;
}

.onb-empty-state__icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.9;
    animation: onb-float 3s ease-in-out infinite;
}

@keyframes onb-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.onb-empty-state__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.onb-empty-state__desc {
    font-size: 0.88rem;
    color: #94a3b8;
    margin-bottom: 28px;
    max-width: 320px;
}

.onb-empty-state__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 280px;
}

.onb-empty-state__btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    width: 100%;
    justify-content: center;
}
.onb-empty-state__btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.onb-empty-state__btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
    justify-content: center;
}
.onb-empty-state__btn-secondary:hover {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.35);
}

/* ─────────── 3. FREE PLAN BANNER (Dashboard) ─────────── */
.onb-plan-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    border-radius: 10px;
    margin: 0 0 16px 0;
    font-size: 0.82rem;
    color: #92400e;
    animation: onb-slide-down 0.4s ease both;
}
.onb-plan-banner.hidden {
    display: none;
}

@keyframes onb-slide-down {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

.onb-plan-banner__text {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-weight: 500;
}
.onb-plan-banner__text i {
    font-size: 1rem;
    color: #d97706;
}

.onb-plan-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.onb-plan-banner__upgrade {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: #d97706;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.onb-plan-banner__upgrade:hover {
    background: #b45309;
}

.onb-plan-banner__close {
    background: none;
    border: none;
    color: #92400e;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.6;
    padding: 4px;
    transition: opacity 0.2s;
}
.onb-plan-banner__close:hover {
    opacity: 1;
}

/* ─────────── 4. EDITOR TOUR (Guided tooltips) ─────────── */
.onb-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.onb-tour-overlay.active {
    opacity: 1;
    visibility: visible;
}

.onb-tour-highlight {
    position: fixed;
    z-index: 99999;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    border: 2px solid #6366f1;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: onb-pulse-border 2s ease-in-out infinite;
}

@keyframes onb-pulse-border {
    0%, 100% { border-color: #6366f1; }
    50% { border-color: #a78bfa; }
}

.onb-tour-tooltip {
    position: fixed;
    z-index: 100000;
    background: #fff;
    border-radius: 14px;
    padding: 20px 24px 16px;
    max-width: 320px;
    width: 90vw;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.onb-tour-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.onb-tour-tooltip__step {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.onb-tour-tooltip__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.onb-tour-tooltip__desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.55;
    margin-bottom: 16px;
}

.onb-tour-tooltip__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.onb-tour-tooltip__next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.onb-tour-tooltip__next:hover {
    background: #4f46e5;
}

.onb-tour-tooltip__skip {
    font-size: 0.76rem;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
}
.onb-tour-tooltip__skip:hover {
    color: #64748b;
}

/* Progress dots */
.onb-tour-tooltip__progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 12px;
}
.onb-tour-tooltip__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: background 0.3s;
}
.onb-tour-tooltip__dot.active {
    background: #6366f1;
    width: 20px;
    border-radius: 3px;
}

/* ─────────── 5. TEMPLATE HELP POPUP ─────────── */
.onb-tpl-help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.onb-tpl-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    margin-left: 6px;
    flex-shrink: 0;
}
.onb-tpl-help-btn:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
}

.onb-tpl-help-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    width: 280px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.onb-tpl-help-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.onb-tpl-help-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}

.onb-tpl-help-popup p {
    margin: 0 0 8px;
}
.onb-tpl-help-popup p:last-child {
    margin-bottom: 0;
}
.onb-tpl-help-popup strong {
    color: #1a1a2e;
}

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 600px) {
    .onb-welcome {
        padding: 36px 24px 28px;
    }
    .onb-welcome__title {
        font-size: 1.3rem;
    }
    .onb-tour-tooltip {
        max-width: 280px;
        padding: 16px 18px 14px;
    }
    .onb-plan-banner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .onb-plan-banner__actions {
        width: 100%;
        justify-content: center;
    }
    .onb-tpl-help-popup {
        width: 240px;
    }
}
