/* onboarding.css — Recovery24 Onboarding Flow */

/* ── Onboarding Overlay (intro slides) ── */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ── Back Button ── */
.ob-back-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 10001;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ob-back-btn:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.2);
}

/* ── Toggle Switch ── */
.ob-toggle {
    position: relative;
    width: 48px; height: 28px;
    display: inline-block;
    cursor: pointer;
}
.ob-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ob-toggle-track {
    position: absolute; inset: 0;
    background: #ccc;
    border-radius: 28px;
    transition: background 0.3s;
}
.ob-toggle input:checked + .ob-toggle-track {
    background: #2DA89B;
}
.ob-toggle-thumb {
    position: absolute;
    height: 22px; width: 22px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.ob-toggle input:checked + .ob-toggle-track .ob-toggle-thumb {
    transform: translateX(20px);
}

.ob-slide {
    display: none;
    text-align: center;
    max-width: 360px;
    animation: fadeInUp 0.4s ease;
}

.ob-slide.active {
    display: block;
}

.ob-slide .ob-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.ob-slide h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: #fff;
}

.ob-slide p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.ob-dots {
    display: flex;
    gap: 8px;
    margin: 20px 0;
}

.ob-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.ob-dots span.active {
    background: #2DA89B;
}

.ob-next {
    padding: 12px 48px;
    border: none;
    border-radius: 12px;
    background: #2DA89B;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Onboarding Overlay (main form screens) ── */
.onboarding-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--ap-bg);
    z-index: 10000;
    display: flex; flex-direction: column;
    overflow-y: auto;
}
.ob-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 24px 24px 32px;
    min-height: 100vh;
    animation: tabFadeIn 0.3s ease-out;
}
.ob-screen.active { display: flex; }
.ob-title {
    font-size: 28px; font-weight: 800; color: var(--ap-text);
    margin-bottom: 10px; text-align: center; text-wrap: balance;
}
.ob-subtitle {
    font-size: 16px; color: var(--ap-text-secondary);
    text-align: center; margin-bottom: 28px; line-height: 1.6;
}
.ob-option {
    width: 100%; max-width: 340px;
    padding: 16px 20px; margin-bottom: 12px;
    background: var(--ap-card); border: 2px solid var(--ap-border);
    border-radius: var(--ap-radius-md); cursor: pointer;
    transition: border-color 0.2s, background 0.15s;
    text-align: left;
    -webkit-tap-highlight-color: rgba(13,115,119,0.15);
    touch-action: manipulation;
    user-select: none;
}
.ob-option:active { background: rgba(13,115,119,0.08); }
.ob-option.selected { border-color: var(--ap-primary); background: rgba(13,115,119,0.05); }
.ob-option-title { font-size: 18px; font-weight: 700; color: var(--ap-text); }
.ob-option-desc { font-size: 14px; color: var(--ap-text-muted); margin-top: 4px; }
/* Circular progress ring */
.ob-circle-progress {
    position: relative; width: 56px; height: 56px; margin: 0 auto 20px;
}
.ob-circle-progress svg { width: 56px; height: 56px; }
.ob-circle-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 13px; font-weight: 700; color: var(--ap-text);
}
.ob-next-btn {
    width: 100%; max-width: 340px; height: 56px;
    border: none; border-radius: 14px;
    background: #2DA89B; color: #fff;
    font-size: 17px; font-weight: 800; cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    margin-top: auto;
}
.ob-next-btn:active { transform: scale(0.97); }
.ob-next-btn:disabled { opacity: 0.4; pointer-events: none; }
.ob-input {
    width: 100%; max-width: 340px; padding: 14px 16px;
    border: 2px solid var(--ap-border); border-radius: var(--ap-radius-sm);
    font-size: 16px; background: var(--ap-card); color: var(--ap-text);
    outline: none; transition: border-color 0.2s;
}
.ob-input:focus { border-color: var(--ap-primary); }
.ob-skip {
    margin-top: 12px; background: none; border: none;
    color: var(--ap-text-muted); font-size: 14px; cursor: pointer;
}

/* ── Dark Mode Readability ── */
[data-theme="dark"] .ob-option {
    background: var(--ap-surface-1);
    border-color: rgba(255,255,255,0.1);
    color: var(--ap-text);
}
[data-theme="dark"] .ob-option.selected {
    border-color: var(--ap-primary);
    background: rgba(61,188,192,0.1);
}
[data-theme="dark"] .ob-option-desc {
    color: var(--ap-text-secondary);
}
[data-theme="dark"] .ob-subtitle {
    color: var(--ap-text-secondary);
}
[data-theme="dark"] .ob-skip {
    color: var(--ap-text-secondary);
}
[data-theme="dark"] .ob-next-btn {
    background: #2DA89B;
    color: #fff;
}
[data-theme="dark"] .ob-input {
    background: var(--ap-surface-1);
    border-color: rgba(255,255,255,0.1);
    color: var(--ap-text);
}
/* Emoji row for pain/VAS sliders */
.ob-emoji-row {
    display: flex; justify-content: space-between; width: 100%;
    font-size: 12px; color: var(--ap-text-muted); padding: 2px 0 0;
}
.ob-emoji-row span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ob-emoji-row span em { font-style: normal; font-size: 11px; }

/* ── Wheel Picker (iOS-style scroll) ── */
.wheel-picker-container {
    position: relative;
    width: 100%;
    max-width: 140px;
    height: 200px;
    overflow: hidden;
    margin: 0 auto;
    border-radius: 16px;
    background: var(--ap-bg-secondary);
    perspective: 300px;
}
.wheel-picker-container::before,
.wheel-picker-container::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 70px;
    z-index: 1;
    pointer-events: none;
}
.wheel-picker-container::before {
    top: 0;
    background: linear-gradient(to bottom, var(--ap-bg-secondary) 20%, rgba(var(--ap-bg-secondary-rgb, 245,245,250), 0));
}
.wheel-picker-container::after {
    bottom: 0;
    background: linear-gradient(to top, var(--ap-bg-secondary) 20%, rgba(var(--ap-bg-secondary-rgb, 245,245,250), 0));
}
.wheel-picker {
    height: 200px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    overscroll-behavior-y: contain;
}
.wheel-picker::-webkit-scrollbar { display: none; }
.wheel-item {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    font-size: 20px;
    color: var(--ap-text-muted);
    transition: transform 0.2s ease, font-size 0.2s ease, opacity 0.2s ease, color 0.2s ease;
    cursor: pointer;
    opacity: 0.3;
    transform: rotateX(25deg) scale(0.85);
    transform-origin: center center;
}
.wheel-item.near {
    opacity: 0.5;
    transform: rotateX(12deg) scale(0.92);
    font-size: 22px;
}
.wheel-item.active {
    font-size: 34px;
    font-weight: 800;
    color: var(--ap-primary);
    opacity: 1;
    transform: rotateX(0deg) scale(1);
}
.wheel-highlight {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 8px; right: 8px;
    height: 50px;
    border-top: 2px solid rgba(13,115,119,0.3);
    border-bottom: 2px solid rgba(13,115,119,0.3);
    border-radius: 10px;
    background: rgba(13,115,119,0.06);
    pointer-events: none;
    z-index: 0;
}
.wheel-label {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-secondary);
    margin-bottom: 8px;
}

/* ── Functional Assessment & PHQ-4 horizontal button groups ── */
.ob-func-row {
    width: 100%; max-width: 340px;
    margin-bottom: 12px;
}
.ob-func-label {
    font-size: 13px; font-weight: 600;
    color: var(--ap-text); margin-bottom: 6px;
}
.ob-func-btns {
    display: flex; gap: 4px; flex-wrap: wrap;
}
.ob-func-btns .ob-option {
    flex: 1; min-width: 52px; text-align: center;
    padding: 8px 4px; margin: 0; font-size: 11px;
    border-radius: var(--ap-radius-sm);
}

/* ── NRS dual slider styling ── */
.ob-pain-group {
    width: 100%; max-width: 340px; margin-bottom: 16px;
}
.ob-pain-group label {
    font-size: 13px; font-weight: 600;
    color: var(--ap-text-secondary); display: block; margin-bottom: 4px;
}
/* Smooth range slider for mobile */
.ob-pain-group input[type="range"],
#obHealthVas {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--ap-border);
    outline: none;
    touch-action: pan-x;
}
.ob-pain-group input[type="range"]::-webkit-slider-thumb,
#obHealthVas::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2DA89B;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(13,115,119,0.4);
}

/* ── VAS slider ── */
.ob-vas-display {
    font-family: 'Outfit', sans-serif;
    font-size: 64px; font-weight: 800;
    color: var(--ap-primary);
    text-align: center;
    margin: 16px 0 8px;
}

/* ── Keyframes ── */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.8); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes popIn {
    0% { transform: scale(0.3); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}
@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}
