/* ============================================================
   PastPersona - Quiz Flow CSS
   Vibrant light theme quiz experience with rich animations
   ============================================================ */

/* --- Quiz Intro --- */
.quiz-intro {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 120px 24px;
    background: var(--gradient-soft-bg);
}

.quiz-intro-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
    animation: scaleIn 0.8s ease-out;
    background: rgba(255,255,255,0.85);
    box-shadow: 0 20px 60px rgba(124,58,237,0.1);
}

.quiz-intro-card h1 {
    font-size: 2rem;
    margin-bottom: 16px;
    background: var(--gradient-hero);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

.quiz-intro-card .intro-text {
    font-size: 1rem;
    color: var(--color-text-dim);
    margin-bottom: 32px;
    line-height: 1.8;
}

/* --- Quiz Container --- */
.quiz-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 40px;
    position: relative;
    transition: opacity 0.5s ease;
}

/* --- Quiz Background Evolution --- */
.quiz-bg {
    position: fixed;
    inset: 0;
    transition: all 2s ease;
    z-index: -1;
}

.quiz-bg[data-stage="early"] {
    background: linear-gradient(135deg, #F5F0FF 0%, #EDE7FF 50%, #F8F4FF 100%);
}

.quiz-bg[data-stage="mid"] {
    background: linear-gradient(135deg, #FFF0F5 0%, #F0E6FF 50%, #E8F4FD 100%);
}

.quiz-bg[data-stage="late"] {
    background: linear-gradient(135deg, #FFF8F0 0%, #FFE8EE 50%, #F0E6FF 100%);
}

/* --- Progress Bar --- */
.quiz-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: rgba(124, 58, 237, 0.08);
    z-index: 100;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7C3AED, #3B82F6, #06B6D4, #10B981, #EAB308, #F97316, #EC4899);
    background-size: 300% 100%;
    animation: progressGlow 3s linear infinite;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 5px 5px 0;
    box-shadow: 0 0 15px rgba(124,58,237,0.3), 0 0 30px rgba(236,72,153,0.15);
}

@keyframes progressGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.quiz-progress-text {
    position: fixed;
    top: 14px; right: 24px;
    font-size: 0.85rem;
    color: var(--color-text-faint);
    font-weight: 600;
    z-index: 100;
    font-family: var(--font-display);
}

/* --- Question Card --- */
.question-wrapper {
    max-width: 680px;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.question-card { text-align: center; }

.question-card h2 {
    font-size: clamp(1.3rem, 3.5vw, 1.9rem);
    margin-bottom: 16px;
    line-height: 1.5;
    color: var(--color-text);
}

.question-card .question-subtext {
    color: var(--color-text-faint);
    font-size: 0.95rem;
    margin-bottom: 36px;
    font-style: italic;
}

/* --- Question enter/exit --- */
.question-enter { animation: questionSlideIn 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.question-exit { animation: questionSlideOut 0.3s ease; }

@keyframes questionSlideIn {
    from { opacity: 0; transform: translateX(60px) scale(0.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes questionSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-60px); }
}

/* --- Option Buttons --- */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 28px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(124, 58, 237, 0.08);
    border-radius: 18px;
    color: var(--color-text);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(124,58,237,0.04);
}

/* Shimmer on hover */
.option-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124,58,237,0.06), transparent);
    transition: left 0.6s ease;
}

.option-btn:hover::before { left: 100%; }

.option-btn:hover {
    background: rgba(245, 240, 255, 0.95);
    border-color: rgba(124, 58, 237, 0.25);
    transform: translateX(8px) scale(1.02);
    color: var(--color-text);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.12);
}

.option-btn.selected {
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(236,72,153,0.06));
    border-color: var(--color-purple);
    color: var(--color-text);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.18), inset 0 0 20px rgba(124,58,237,0.04);
    transform: scale(1.03);
}

.option-btn.just-selected {
    animation: optionGlow 0.6s ease;
}

@keyframes optionGlow {
    0% { box-shadow: 0 0 0 rgba(124,58,237,0); }
    50% { box-shadow: 0 0 40px rgba(124,58,237,0.25), 0 0 60px rgba(236,72,153,0.1); }
    100% { box-shadow: 0 8px 30px rgba(124,58,237,0.18); }
}

.option-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(236,72,153,0.06));
    border-radius: 14px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.option-btn:hover .option-icon {
    transform: scale(1.15) rotate(5deg);
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(236,72,153,0.1));
}

/* --- Quiz Navigation --- */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    max-width: 680px;
    width: 100%;
}

.btn-back {
    background: rgba(255,255,255,0.7);
    border: 2px solid rgba(124, 58, 237, 0.12);
    color: var(--color-text-dim);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back:hover:not(:disabled) {
    border-color: var(--color-purple);
    color: var(--color-purple);
    background: rgba(124,58,237,0.05);
}

.btn-back:disabled { opacity: 0.3; cursor: not-allowed; }

/* --- Loading Screen --- */
.loading-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px;
    background: var(--gradient-soft-bg);
}

.loading-orb {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg,
        rgba(124,58,237,0.3) 0%,
        rgba(236,72,153,0.2) 40%,
        rgba(249,115,22,0.15) 70%,
        rgba(59,130,246,0.1) 100%
    );
    box-shadow:
        0 0 40px rgba(124,58,237,0.2),
        0 0 80px rgba(236,72,153,0.1),
        0 0 120px rgba(249,115,22,0.05);
    animation: orbPulse 3s ease-in-out infinite, orbFloat 4s ease-in-out infinite;
    margin-bottom: 40px;
    position: relative;
}

.loading-orb::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--color-purple-light);
    border-right-color: var(--color-pink);
    animation: spin 3s linear infinite;
}

@keyframes orbPulse {
    0%, 100% { box-shadow: 0 0 40px rgba(124,58,237,0.2), 0 0 80px rgba(236,72,153,0.1); }
    50% { box-shadow: 0 0 60px rgba(124,58,237,0.35), 0 0 120px rgba(236,72,153,0.15), 0 0 160px rgba(249,115,22,0.08); }
}

@keyframes orbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.08); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-message {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--color-text-dim);
    margin-bottom: 36px;
    transition: opacity 0.3s ease;
    text-align: center;
}

.loading-progress {
    width: 280px;
    height: 4px;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #7C3AED, #EC4899, #F97316);
    transition: width 0.8s ease;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(124,58,237,0.3);
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .quiz-container { padding: 80px 16px 20px; }
    .option-btn { padding: 16px 20px; font-size: 0.95rem; }
    .option-icon { width: 40px; height: 40px; font-size: 1.2rem; }
    .question-card h2 { font-size: 1.2rem; }
    .loading-orb { width: 90px; height: 90px; }
}
