All files / web/src/components/page-spots StartPracticeShowcase.tsx

0% Statements 0/760
0% Branches 0/1
0% Functions 0/1
0% Lines 0/760

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
'use client'

import { css } from '../../../styled-system/css'

/**
 * Static showcase of the StartPracticeModal for marketing page spots.
 * Recreates the visual appearance without context providers or interactivity.
 */
export function StartPracticeShowcase() {
  return (
    <div
      data-component="start-practice-showcase"
      className={css({
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        width: '100%',
        height: '100%',
        padding: '1rem',
      })}
    >
      <div
        className={css({
          width: '360px',
          maxWidth: '100%',
          borderRadius: '20px',
          boxShadow: '0 20px 50px -12px rgba(0, 0, 0, 0.25)',
          padding: '1.5rem',
          display: 'flex',
          flexDirection: 'column',
          gap: '1rem',
          position: 'relative',
        })}
        style={{
          background: 'linear-gradient(150deg, #ffffff 0%, #f8fafc 60%, #f0f9ff 100%)',
        }}
      >
        {/* Close button (decorative) */}
        <div
          className={css({
            position: 'absolute',
            top: '0.75rem',
            right: '0.75rem',
            width: '32px',
            height: '32px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            fontSize: '1rem',
            color: '#9ca3af',
            backgroundColor: 'rgba(0,0,0,0.04)',
            borderRadius: '50%',
          })}
        >

        </div>

        {/* Session Focus Info — maintenance mode variant */}
        <div
          className={css({
            borderRadius: '12px',
            padding: '0.875rem 1rem',
            display: 'flex',
            gap: '0.625rem',
            alignItems: 'flex-start',
          })}
          style={{
            background:
              'linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)',
            border: '1px solid rgba(59, 130, 246, 0.2)',
          }}
        >
          <span className={css({ fontSize: '1.5rem', lineHeight: 1 })}>✨</span>
          <div>
            <p className={css({ fontSize: '0.875rem', fontWeight: '600', color: '#1d4ed8' })}>
              Mixed review (8 skills)
            </p>
            <p className={css({ fontSize: '0.75rem', marginTop: '0.125rem', color: '#6b7280' })}>
              Keeping all your skills sharp
            </p>
          </div>
        </div>

        {/* Plan indicator pill */}
        <div
          className={css({
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
          })}
        >
          <span
            className={css({
              fontSize: '0.6875rem',
              fontWeight: '600',
              padding: '0.25rem 0.75rem',
              borderRadius: '9999px',
              color: '#2563eb',
            })}
            style={{
              background: 'rgba(59, 130, 246, 0.08)',
              border: '1px solid rgba(59, 130, 246, 0.15)',
            }}
          >
            Family Plan
          </span>
        </div>

        {/* Session Config Summary */}
        <div
          className={css({
            borderRadius: '12px',
            overflow: 'hidden',
          })}
          style={{
            background: 'rgba(0,0,0,0.03)',
            border: '1px solid rgba(0,0,0,0.06)',
          }}
        >
          <div
            className={css({
              width: '100%',
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'center',
              gap: '0.75rem',
              padding: '1rem',
            })}
          >
            {/* Duration */}
            <div className={css({ textAlign: 'center' })}>
              <div
                className={css({
                  fontSize: '1.5rem',
                  fontWeight: 'bold',
                  color: '#2563eb',
                  lineHeight: 1,
                })}
              >
                15
              </div>
              <div
                className={css({ fontSize: '0.6875rem', color: '#6b7280', marginTop: '0.125rem' })}
              >
                min
              </div>
            </div>

            <Dot />

            {/* Problems */}
            <div className={css({ textAlign: 'center' })}>
              <div
                className={css({
                  fontSize: '1.5rem',
                  fontWeight: 'bold',
                  color: '#16a34a',
                  lineHeight: 1,
                })}
              >
                ~24
              </div>
              <div
                className={css({ fontSize: '0.6875rem', color: '#6b7280', marginTop: '0.125rem' })}
              >
                problems
              </div>
            </div>

            <Dot />

            {/* Practice modes */}
            <div className={css({ display: 'flex', alignItems: 'center', gap: '0.375rem' })}>
              <ModeChip emoji="🧮" count={10} />
              <ModeChip emoji="🧠" count={8} />
              <ModeChip emoji="💭" count={6} />
            </div>

            <Dot />

            {/* Game break */}
            <div className={css({ textAlign: 'center' })}>
              <div className={css({ fontSize: '0.875rem', lineHeight: 1 })}>🎮</div>
              <div
                className={css({
                  fontSize: '0.6875rem',
                  fontWeight: '600',
                  color: '#d97706',
                  marginTop: '0.125rem',
                })}
              >
                5m
              </div>
            </div>

            {/* Expand indicator */}
            <span
              className={css({ fontSize: '0.625rem', color: '#9ca3af', marginLeft: '0.25rem' })}
            >

            </span>
          </div>
        </div>

        {/* Start button */}
        <button
          type="button"
          className={css({
            width: '100%',
            padding: '1rem',
            fontSize: '1.0625rem',
            fontWeight: 'bold',
            color: 'white',
            borderRadius: '12px',
            border: 'none',
            cursor: 'default',
            position: 'relative',
            overflow: 'hidden',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            gap: '0.5rem',
          })}
          style={{
            background: 'linear-gradient(135deg, #22c55e 0%, #16a34a 100%)',
            boxShadow: '0 6px 20px rgba(34, 197, 94, 0.35)',
          }}
        >
          <span>Let's Go!</span>
          <span>→</span>
        </button>
      </div>
    </div>
  )
}

function Dot() {
  return <span className={css({ fontSize: '0.5rem', color: '#d1d5db', lineHeight: 1 })}>●</span>
}

function ModeChip({ emoji, count }: { emoji: string; count: number }) {
  return (
    <div className={css({ textAlign: 'center' })}>
      <div className={css({ fontSize: '0.8125rem', lineHeight: 1 })}>{emoji}</div>
      <div
        className={css({
          fontSize: '0.625rem',
          fontWeight: '600',
          color: '#16a34a',
          marginTop: '0.125rem',
        })}
      >
        {count}
      </div>
    </div>
  )
}

/**
 * Expanded form of the StartPracticeModal showcase — shows the full settings panel.
 */
export function StartPracticeShowcaseExpanded() {
  return (
    <div
      data-component="start-practice-showcase-expanded"
      className={css({
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        width: '100%',
        height: '100%',
        padding: '1rem',
      })}
    >
      <div
        className={css({
          width: '360px',
          maxWidth: '100%',
          borderRadius: '20px',
          boxShadow: '0 20px 50px -12px rgba(0, 0, 0, 0.25)',
          padding: '1.5rem',
          display: 'flex',
          flexDirection: 'column',
          gap: '1rem',
          position: 'relative',
        })}
        style={{
          background: 'linear-gradient(150deg, #ffffff 0%, #f8fafc 60%, #f0f9ff 100%)',
        }}
      >
        {/* Close button (decorative) */}
        <div
          className={css({
            position: 'absolute',
            top: '0.75rem',
            right: '0.75rem',
            width: '32px',
            height: '32px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            fontSize: '1rem',
            color: '#9ca3af',
            backgroundColor: 'rgba(0,0,0,0.04)',
            borderRadius: '50%',
          })}
        >

        </div>

        {/* Session Focus Info */}
        <div
          className={css({
            borderRadius: '12px',
            padding: '0.875rem 1rem',
            display: 'flex',
            gap: '0.625rem',
            alignItems: 'flex-start',
          })}
          style={{
            background:
              'linear-gradient(135deg, rgba(59, 130, 246, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%)',
            border: '1px solid rgba(59, 130, 246, 0.2)',
          }}
        >
          <span className={css({ fontSize: '1.5rem', lineHeight: 1 })}>✨</span>
          <div>
            <p className={css({ fontSize: '0.875rem', fontWeight: '600', color: '#1d4ed8' })}>
              Mixed review (8 skills)
            </p>
            <p className={css({ fontSize: '0.75rem', marginTop: '0.125rem', color: '#6b7280' })}>
              Keeping all your skills sharp
            </p>
          </div>
        </div>

        {/* Plan indicator pill */}
        <div
          className={css({
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
          })}
        >
          <span
            className={css({
              fontSize: '0.6875rem',
              fontWeight: '600',
              padding: '0.25rem 0.75rem',
              borderRadius: '9999px',
              color: '#2563eb',
            })}
            style={{
              background: 'rgba(59, 130, 246, 0.08)',
              border: '1px solid rgba(59, 130, 246, 0.15)',
            }}
          >
            Family Plan
          </span>
        </div>

        {/* Session Settings Header with collapse indicator */}
        <div
          className={css({
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            padding: '0 0.25rem',
          })}
        >
          <span
            className={css({
              fontSize: '0.6875rem',
              fontWeight: '700',
              textTransform: 'uppercase',
              letterSpacing: '0.05em',
              color: '#6b7280',
            })}
          >
            Session Settings
          </span>
          <span className={css({ fontSize: '0.625rem', color: '#9ca3af' })}>▲</span>
        </div>

        {/* Duration Selector */}
        <SettingSection label="Duration">
          <div className={css({ display: 'flex', gap: '0.375rem' })}>
            <DurationPill minutes={5} problems="~8" selected={false} />
            <DurationPill minutes={10} problems="~16" selected={false} />
            <DurationPill minutes={15} problems="~24" selected />
            <DurationPill minutes={20} problems="~32" selected={false} />
          </div>
        </SettingSection>

        {/* Practice Modes Proportion Bar */}
        <SettingSection label="Practice Modes">
          <ProportionBarStatic
            segments={[
              {
                emoji: '🧮',
                label: 'Abacus',
                weight: 10,
                color: 'rgba(22, 163, 74, 0.15)',
                accent: '#16a34a',
              },
              {
                emoji: '🧠',
                label: 'Visual',
                weight: 8,
                color: 'rgba(22, 163, 74, 0.10)',
                accent: '#16a34a',
              },
              {
                emoji: '💭',
                label: 'Linear',
                weight: 6,
                color: 'rgba(22, 163, 74, 0.06)',
                accent: '#16a34a',
              },
            ]}
          />
        </SettingSection>

        {/* Purpose Distribution Bar */}
        <SettingSection label="Purpose">
          <ProportionBarStatic
            segments={[
              {
                emoji: '🎯',
                label: 'Focus',
                weight: 4,
                color: 'rgba(37, 99, 235, 0.10)',
                accent: '#2563eb',
              },
              {
                emoji: '🔁',
                label: 'Reinforce',
                weight: 3,
                color: 'rgba(234, 88, 12, 0.10)',
                accent: '#ea580c',
              },
              {
                emoji: '📖',
                label: 'Review',
                weight: 2,
                color: 'rgba(22, 163, 74, 0.10)',
                accent: '#16a34a',
              },
              {
                emoji: '⚡',
                label: 'Challenge',
                weight: 1,
                color: 'rgba(147, 51, 234, 0.10)',
                accent: '#9333ea',
              },
            ]}
          />
        </SettingSection>

        {/* Problem Length Selector */}
        <SettingSection label="Problem Length">
          <div className={css({ display: 'flex', gap: '0.375rem' })}>
            <LengthPill label="Shorter" selected={false} />
            <LengthPill label="Recommended" selected />
            <LengthPill label="Longer" selected={false} />
          </div>
          <div
            className={css({
              fontSize: '0.625rem',
              color: '#6b7280',
              textAlign: 'center',
              marginTop: '0.375rem',
            })}
          >
            2–3 terms per problem
          </div>
        </SettingSection>

        {/* Game Break Settings */}
        <div
          className={css({
            borderRadius: '10px',
            padding: '0.625rem',
          })}
          style={{
            background:
              'linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(6, 182, 212, 0.08) 100%)',
            border: '1px solid rgba(139, 92, 246, 0.2)',
          }}
        >
          <div
            className={css({
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'space-between',
            })}
          >
            <div className={css({ display: 'flex', alignItems: 'center', gap: '0.375rem' })}>
              <span className={css({ fontSize: '0.875rem' })}>🎮</span>
              <span
                className={css({
                  fontSize: '0.6875rem',
                  fontWeight: '700',
                  textTransform: 'uppercase',
                  letterSpacing: '0.03em',
                  color: '#7c3aed',
                })}
              >
                Game Breaks
              </span>
            </div>
            <span
              className={css({
                fontSize: '0.6875rem',
                fontWeight: '700',
                padding: '0.125rem 0.5rem',
                borderRadius: '6px',
                color: '#0891b2',
              })}
              style={{
                background: 'rgba(139, 92, 246, 0.15)',
              }}
            >
              ON
            </span>
          </div>
          {/* Duration track */}
          <div
            className={css({
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'center',
              gap: '0.5rem',
              marginTop: '0.5rem',
            })}
          >
            {['3m', '5m', '7m'].map((d, i) => (
              <span
                key={d}
                className={css({
                  fontSize: i === 1 ? '0.8125rem' : '0.6875rem',
                  fontWeight: '600',
                  padding: '0.25rem 0.5rem',
                  borderRadius: '6px',
                  color: i === 1 ? 'white' : '#7c3aed',
                })}
                style={{
                  background: i === 1 ? '#7c3aed' : 'transparent',
                  boxShadow: i === 1 ? '0 0 12px rgba(139, 92, 246, 0.6)' : 'none',
                  transform: i === 1 ? 'scale(1.1)' : 'none',
                  opacity: i === 1 ? 1 : 0.45 + i * 0.25,
                }}
              >
                {d}
              </span>
            ))}
          </div>
          <div
            className={css({
              fontSize: '0.625rem',
              fontStyle: 'italic',
              color: '#818cf8',
              textAlign: 'center',
              marginTop: '0.375rem',
            })}
          >
            5 min game break after practice
          </div>
        </div>

        {/* Start button */}
        <button
          type="button"
          className={css({
            width: '100%',
            padding: '1rem',
            fontSize: '1.0625rem',
            fontWeight: 'bold',
            color: 'white',
            borderRadius: '12px',
            border: 'none',
            cursor: 'default',
            position: 'relative',
            overflow: 'hidden',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            gap: '0.5rem',
          })}
          style={{
            background: 'linear-gradient(135deg, #22c55e 0%, #16a34a 100%)',
            boxShadow: '0 6px 20px rgba(34, 197, 94, 0.35)',
          }}
        >
          <span>Let&apos;s Go!</span>
          <span>→</span>
        </button>
      </div>
    </div>
  )
}

function SettingSection({ label, children }: { label: string; children: React.ReactNode }) {
  return (
    <div>
      <div
        className={css({
          fontSize: '0.6875rem',
          fontWeight: '600',
          textTransform: 'uppercase',
          letterSpacing: '0.05em',
          color: '#9ca3af',
          marginBottom: '0.5rem',
        })}
      >
        {label}
      </div>
      {children}
    </div>
  )
}

function DurationPill({
  minutes,
  problems,
  selected,
}: {
  minutes: number
  problems: string
  selected: boolean
}) {
  return (
    <div
      className={css({
        flex: 1,
        textAlign: 'center',
        padding: '0.5rem 0.25rem',
        borderRadius: '8px',
        transition: 'all 0.15s ease',
      })}
      style={{
        background: selected ? 'rgba(59, 130, 246, 0.08)' : 'rgba(0,0,0,0.03)',
        border: selected ? '2px solid #3b82f6' : '2px solid rgba(0,0,0,0.06)',
      }}
    >
      <div
        className={css({
          fontSize: '0.9375rem',
          fontWeight: '600',
        })}
        style={{ color: selected ? '#2563eb' : '#334155' }}
      >
        {minutes}m
      </div>
      <div className={css({ fontSize: '0.625rem', color: '#94a3b8' })}>{problems}</div>
    </div>
  )
}

interface Segment {
  emoji: string
  label: string
  weight: number
  color: string
  accent: string
}

function ProportionBarStatic({ segments }: { segments: Segment[] }) {
  const totalWeight = segments.reduce((sum, s) => sum + s.weight, 0)
  return (
    <div
      className={css({
        display: 'flex',
        height: '56px',
        borderRadius: '12px',
        overflow: 'hidden',
        gap: '2px',
      })}
      style={{ background: 'rgba(0,0,0,0.04)' }}
    >
      {segments.map((seg) => (
        <div
          key={seg.label}
          className={css({
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'center',
            justifyContent: 'center',
            gap: '2px',
            padding: '0 0.25rem',
            position: 'relative',
          })}
          style={{
            flex: seg.weight,
            background: seg.color,
          }}
        >
          {/* Problem count badge */}
          <div
            className={css({
              position: 'absolute',
              top: '2px',
              right: '4px',
              height: '20px',
              minWidth: '20px',
              display: 'flex',
              alignItems: 'center',
              justifyContent: 'center',
              fontSize: '0.6875rem',
              fontWeight: 'bold',
              color: 'white',
              borderRadius: '10px',
              padding: '0 4px',
            })}
            style={{ background: '#22c55e' }}
          >
            {seg.weight}
          </div>
          <div className={css({ fontSize: '1.25rem', lineHeight: 1 })}>{seg.emoji}</div>
          {totalWeight > 3 && (
            <div
              className={css({
                fontSize: '0.625rem',
                fontWeight: '600',
                whiteSpace: 'nowrap',
                overflow: 'hidden',
                textOverflow: 'ellipsis',
                maxWidth: '100%',
              })}
              style={{ color: seg.accent }}
            >
              {seg.label}
            </div>
          )}
        </div>
      ))}
    </div>
  )
}

function LengthPill({ label, selected }: { label: string; selected: boolean }) {
  return (
    <div
      className={css({
        flex: 1,
        textAlign: 'center',
        padding: '0.5rem 0.25rem',
        borderRadius: '6px',
        fontSize: '0.75rem',
        fontWeight: '600',
      })}
      style={{
        background: selected ? '#7c3aed' : 'rgba(0,0,0,0.04)',
        color: selected ? 'white' : '#6b7280',
      }}
    >
      {label}
    </div>
  )
}