/* ============================================================= */
/* YuviLab 720 · Learner Mapping — Playful-Premium Redesign       */
/* RTL · Hebrew · modern, friendly, inviting                      */
/* ============================================================= */

:root {
    --m-primary: #6F5BFF;
    --m-primary-2: #9f7afe;
    --m-secondary: #4CC9F0;
    --m-soft-bg: #F5F2FF;
    --m-card: #FFFFFF;
    --m-text: #2F2F44;
    --m-text-soft: #6b6880;
    --m-text-light: #9893ab;
    --m-border: #E8E2F7;
    --m-gradient: linear-gradient(135deg, #6F5BFF 0%, #9f7afe 55%, #4CC9F0 130%);
    --m-gradient-soft: linear-gradient(135deg, #7c5cff 0%, #9f7afe 100%);
    --m-shadow-sm: 0 2px 10px rgba(111, 91, 255, 0.08);
    --m-shadow-md: 0 12px 36px rgba(111, 91, 255, 0.12), 0 3px 10px rgba(47, 47, 68, 0.04);
    --m-shadow-lg: 0 24px 60px rgba(111, 91, 255, 0.16);
    --font-family: 'Rubik', 'Heebo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-family);
    color: var(--m-text);
    direction: rtl;
    min-height: 100vh;
    background:
        radial-gradient(1100px 600px at 88% -8%, rgba(76, 201, 240, 0.12), transparent 60%),
        radial-gradient(900px 600px at 6% 12%, rgba(111, 91, 255, 0.14), transparent 55%),
        linear-gradient(168deg, #F7F5FF 0%, #F1EEFC 48%, #EFEAFB 100%);
}

/* ============================================================= */
/* TOP APP BAR                                                    */
/* ============================================================= */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 26px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(232, 226, 247, 0.8);
}

.app-bar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--m-gradient-soft);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(111, 91, 255, 0.3);
    border: 2px solid #fff;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: 14.5px; font-weight: 700; color: var(--m-text); }
.user-sub { font-size: 11.5px; color: var(--m-text-light); }

.app-bar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-name {
    font-size: 19px;
    font-weight: 800;
    background: var(--m-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.3px;
}
.brand-badge {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: var(--m-gradient-soft);
    padding: 3px 9px;
    border-radius: 9px;
    box-shadow: 0 3px 10px rgba(111, 91, 255, 0.28);
}

/* ============================================================= */
/* STEPPER                                                        */
/* ============================================================= */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 22px 20px 6px;
    max-width: 640px;
    margin: 0 auto;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}
.step-dot {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--m-border);
    color: var(--m-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.4s cubic-bezier(.34,1.56,.64,1);
    box-shadow: var(--m-shadow-sm);
}
.step-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--m-text-light);
    transition: color 0.3s;
}
.step-line {
    flex: 1;
    max-width: 64px;
    height: 3px;
    border-radius: 3px;
    background: var(--m-border);
    margin-bottom: 26px;
    transition: background 0.4s;
}
.step.active .step-dot {
    background: var(--m-gradient-soft);
    border-color: transparent;
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(111, 91, 255, 0.35);
}
.step.active .step-label { color: var(--m-primary); }
.step.done .step-dot {
    background: var(--m-soft-bg);
    border-color: var(--m-primary);
    color: var(--m-primary);
}
.step.done .step-label { color: var(--m-text-soft); }

/* ============================================================= */
/* STAGE / SCREENS                                                */
/* ============================================================= */
.stage {
    display: flex;
    justify-content: center;
    padding: 14px 22px 56px;
}
.screen { display: none; width: 100%; }
.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================= */
/* INTRO SCREEN — two columns                                     */
/* ============================================================= */
.intro-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 28px;
    width: 100%;
    max-width: 940px;
    align-items: stretch;
}

/* ---- Chat side ---- */
.chat-side {
    background: var(--m-card);
    border-radius: 28px;
    padding: 26px 26px 20px;
    box-shadow: var(--m-shadow-md);
    border: 1px solid rgba(232, 226, 247, 0.7);
    display: flex;
    flex-direction: column;
    min-height: 540px;
    position: relative;
}
.chat-side::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: var(--m-gradient);
    border-radius: 28px 28px 0 0;
}

.yubi-mark {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    margin-bottom: 4px;
}
.yubi-word {
    font-size: 34px;
    font-weight: 800;
    background: var(--m-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.yubi-swoosh {
    position: absolute;
    bottom: -7px;
    right: 0;
    width: 84px;
    height: 12px;
}
.yubi-spark {
    font-size: 13px;
    color: var(--m-secondary);
    margin-inline-start: 4px;
    animation: twinkle 2.4s ease-in-out infinite;
}
.spark-a { color: var(--m-primary); }
.spark-b { font-size: 9px; color: var(--m-secondary); animation-delay: .8s; }
@keyframes twinkle {
    0%, 100% { opacity: .4; transform: scale(.8); }
    50% { opacity: 1; transform: scale(1.15); }
}

.chat-presence {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 14px 0 12px;
    font-size: 12.5px;
    color: var(--m-text-light);
    font-weight: 500;
}
.presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16);
    animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .55; transform: scale(.82); }
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 2px;
    min-height: 200px;
    max-height: 460px;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: #e2dcf3; border-radius: 6px; }

/* chat rows */
.chat-row.bot { display: flex; align-items: flex-start; gap: 10px}
.bot-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--m-soft-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--m-shadow-sm);
}
.bot-avatar svg { width: 30px; height: 30px; }

.chat-bubble {
    max-width: 84%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(6px);
    animation: bubbleIn 0.35s ease forwards;
}
@keyframes bubbleIn { to { opacity: 1; transform: translateY(0); } }
.chat-bubble.bot {
    background: var(--m-soft-bg);
    color: var(--m-text);
    border-top-left-radius: 6px;
    direction: rtl;
    text-align: right;
}
.chat-bubble.typing {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: var(--m-soft-bg);
    border-top-right-radius: 6px;
    opacity: 1;
    transform: none;
    animation: none;
}
.typing-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--m-primary-2);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .6; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.chat-row.user { display: flex; justify-content: flex-start; direction: ltr; }
.chat-bubble.user {
    background: var(--m-gradient-soft);
    color: #fff;
    border-radius: 18px;
    border-top-right-radius: 6px;
    padding: 10px 16px;
    font-size: 14.5px;
    max-width: 80%;
    direction: rtl;
    text-align: right;
}

/* footer / CTA */
.chat-footer {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px solid #f1edfa;
    display: flex;
    justify-content: center;
}
.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 34px;
    background: var(--m-gradient-soft);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 10px 26px rgba(111, 91, 255, 0.32);
}
.chat-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(111, 91, 255, 0.42);
}
.chat-action-btn:active { transform: scale(0.97); }

.trust-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--m-text-light);
}
.trust-line svg { color: var(--m-primary-2); }

/* summary footer (free text) */
.summary-footer { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.free-text-row { display: flex; gap: 8px; align-items: center; }
.free-text-input {
    flex: 1;
    padding: 11px 15px;
    border: 1.5px solid var(--m-border);
    border-radius: 14px;
    font-family: var(--font-family);
    font-size: 13.5px;
    outline: none;
    transition: border-color .2s;
    direction: rtl;
}
.free-text-input:focus { border-color: var(--m-primary); }
.send-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--m-gradient-soft);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s;
    flex-shrink: 0;
}
.send-btn:hover { transform: scale(1.08); }

/* ---- Robot side ---- */
.robot-side {
    position: relative;
    border-radius: 28px;
    background:
        radial-gradient(120% 90% at 50% 18%, rgba(255,255,255,0.55), transparent 60%),
        linear-gradient(160deg, #efe9ff 0%, #e7e0fe 50%, #dcf2fb 130%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: var(--m-shadow-md);
    min-height: 460px;
}
.robot-glow {
    position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(111,91,255,0.22), transparent 65%);
    filter: blur(10px);
    animation: glowPulse 5s ease-in-out infinite;
}
@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: .8; }
    50% { transform: scale(1.1); opacity: 1; }
}
.hero-robot { position: relative; z-index: 2; }
.robot-3d {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.robot-3d canvas { display: block; width: 100% !important; height: 100% !important; }

/* robot animations */
.robot-float { animation: floaty 4.5s ease-in-out infinite; transform-origin: center; }
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.robot-shadow { animation: shadowPulse 4.5s ease-in-out infinite; }
@keyframes shadowPulse {
    0%, 100% { transform: scaleX(1); opacity: .14; }
    50% { transform: scaleX(.86); opacity: .1; }
}
.robot-wave {
    transform-box: fill-box;
    transform-origin: bottom center;
    animation: wave 2.6s ease-in-out infinite;
}
@keyframes wave {
    0%, 60%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-16deg); }
    40% { transform: rotate(8deg); }
}
.antenna-ball { animation: antglow 2s ease-in-out infinite; }
@keyframes antglow {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

/* floating decorative shapes */
.float-shape, .float-star {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}
.float-shape { border-radius: 50%; opacity: .5; }
.shape-1 { width: 18px; height: 18px; background: var(--m-secondary); top: 14%; right: 16%; animation: bob 5s ease-in-out infinite; }
.shape-2 { width: 12px; height: 12px; background: var(--m-primary-2); bottom: 20%; left: 14%; animation: bob 6s ease-in-out infinite .5s; }
.shape-3 { width: 26px; height: 26px; border-radius: 9px; background: rgba(111,91,255,.18); top: 24%; left: 12%; animation: bob 7s ease-in-out infinite 1s; }
.float-star { color: var(--m-primary); font-size: 16px; animation: twinkle 3s ease-in-out infinite; }
.star-1 { top: 12%; left: 24%; }
.star-2 { bottom: 16%; right: 18%; color: var(--m-secondary); animation-delay: .6s; }
.star-3 { top: 40%; right: 10%; font-size: 12px; animation-delay: 1.2s; }
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ============================================================= */
/* QUESTION SCREEN                                                */
/* ============================================================= */
.q-shell { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; }

.progress-section {
    display: none;
    width: 100%;
    max-width: 480px;
    margin-bottom: 26px;
}
.progress-section.visible { display: block; }
.progress-track {
    height: 8px;
    background: #e9e4f6;
    border-radius: 20px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 20px;
    background: var(--m-gradient);
    transition: width .5s cubic-bezier(.4,0,.2,1);
}
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}
.progress-label { font-size: 12px; color: var(--m-text-soft); font-weight: 500; }
.progress-counter { font-size: 12px; color: var(--m-primary); font-weight: 700; }

.question-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 18px;
}
.question-part-badge {
    position: absolute;
    top: -8px;
    right: 50%;
    transform: translateX(50%);
    padding: 5px 16px;
    background: #fff;
    color: var(--m-primary);
    border: 1.5px solid var(--m-border);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: var(--m-shadow-sm);
    z-index: 3;
}

.single-question-card {
    position: relative;
    background: var(--m-card);
    border-radius: 26px;
    box-shadow: var(--m-shadow-md);
    border: 1px solid rgba(232, 226, 247, 0.7);
    padding: 42px 32px 30px;
    width: 100%;
    max-width: 480px;
    text-align: center;
}
.q-buddy {
    position: absolute;
    top: -18px;
    left: 22px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--m-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--m-shadow-sm);
    animation: floaty 4s ease-in-out infinite;
}

.question-number-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--m-gradient-soft);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 18px;
    box-shadow: 0 8px 18px rgba(111, 91, 255, 0.3);
}
.question-text-display {
    font-size: 20px;
    font-weight: 700;
    color: var(--m-text);
    line-height: 1.6;
    margin: 0 0 26px;
}

.options-grid { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid var(--m-border);
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
    transition: all .18s ease;
    font-family: var(--font-family);
    font-size: 15px;
    color: var(--m-text);
    font-weight: 600;
    text-align: right;
}
.option-emoji {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.option-label { flex: 1; }
.option-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--m-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    transition: all .18s ease;
}
.option-btn:hover {
    border-color: var(--m-primary-2);
    background: var(--m-soft-bg);
    transform: translateY(-1px);
    box-shadow: var(--m-shadow-sm);
}
.option-btn:focus-visible {
    outline: none;
    border-color: var(--m-primary);
    box-shadow: 0 0 0 4px rgba(111, 91, 255, 0.16);
}
.option-btn.selected {
    border-color: var(--m-primary);
    background: var(--m-soft-bg);
    color: var(--m-primary);
}
.option-btn.selected .option-check {
    background: var(--m-gradient-soft);
    border-color: transparent;
    color: #fff;
}
.option-btn:active { transform: scale(.985); }

/* nav arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--m-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
    color: var(--m-text-light);
    box-shadow: var(--m-shadow-sm);
    z-index: 3;
}
.nav-arrow:hover {
    border-color: var(--m-primary);
    color: var(--m-primary);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 18px rgba(111, 91, 255, 0.18);
}
.nav-arrow-right { right: -66px; }
.nav-arrow-left { left: -66px; }
.nav-arrow.disabled { opacity: .25; pointer-events: none; }

.q-microcopy {
    margin-top: 22px;
    font-size: 13px;
    color: var(--m-text-light);
    text-align: center;
    font-weight: 500;
}

/* question transition animations */
.question-enter-left { animation: qLeft .3s ease forwards; }
.question-enter-right { animation: qRight .3s ease forwards; }
@keyframes qLeft {
    from { opacity: 0; transform: translateX(-26px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes qRight {
    from { opacity: 0; transform: translateX(26px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================= */
/* COMPLETION SCREEN                                              */
/* ============================================================= */
.complete-card {
    position: relative;
    text-align: center;
    padding: 52px 38px;
    background: var(--m-card);
    border-radius: 28px;
    box-shadow: var(--m-shadow-md);
    border: 1px solid rgba(232, 226, 247, 0.7);
    max-width: 460px;
    width: 100%;
    overflow: hidden;
}
.complete-confetti {
    position: absolute;
    color: var(--m-primary);
    font-size: 18px;
    animation: twinkle 2.6s ease-in-out infinite;
}
.c1 { top: 20px; right: 34px; color: var(--m-secondary); }
.c2 { top: 40px; left: 30px; font-size: 13px; animation-delay: .5s; }
.c3 { bottom: 30px; right: 44px; font-size: 14px; color: var(--m-primary-2); animation-delay: 1s; }

.complete-icon-svg { margin-bottom: 22px; }
.complete-title {
    font-size: 23px;
    font-weight: 800;
    color: var(--m-text);
    margin: 0 0 10px;
}
.complete-subtitle {
    font-size: 14.5px;
    color: var(--m-text-soft);
    line-height: 1.7;
    margin: 0 0 28px;
}
.complete-cta { margin: 0 auto; }

.loading-animation { display: flex; justify-content: center; margin-bottom: 22px; }
.loading-dots { display: flex; gap: 7px; }
.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--m-primary);
    animation: dotPulse 1.4s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(.5); opacity: .3; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================================= */
/* RESPONSIVE                                                     */
/* ============================================================= */
@media (max-width: 860px) {
    .intro-grid { grid-template-columns: 1fr; gap: 20px; max-width: 540px; }
    .robot-side { order: -1; min-height: 300px; }
    .hero-robot { width: 210px; height: 242px; }
    .chat-side { min-height: 380px; }
    .stepper { gap: 2px; }
    .step-line { max-width: 40px; }
}

@media (max-width: 560px) {
    .stage { padding: 10px 14px 44px; }
    .app-bar { padding: 10px 16px; }
    .user-sub { display: none; }
    .stepper { padding: 16px 12px 4px; }
    .step-dot { width: 36px; height: 36px; font-size: 14px; }
    .step-label { font-size: 11px; }
    .step-line { max-width: 26px; margin-bottom: 24px; }
    .nav-arrow-right { right: -4px; }
    .nav-arrow-left { left: -4px; }
    .nav-arrow { width: 38px; height: 38px; }
    .single-question-card { padding: 36px 20px 24px; }
    .question-text-display { font-size: 18px; }
    .yubi-word { font-size: 30px; }
}
