/* ================================================================
   quiz.css — Travel Quiz & Persona Reveal
   Requires: Tailwind CDN (utility classes), Playfair Display font
   ================================================================ */

/* ── Quiz shell ──────────────────────────────────────────────────── */

.quiz-shell {
    min-height: calc(100vh - 56px);   /* below mobile header */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem 6rem;             /* extra bottom pad for mobile nav */
}

/* On desktop (sidebar present) push content right */
@media (min-width: 768px) {
    .quiz-shell {
        margin-left: 64px;            /* collapsed sidebar width */
        min-height: 100vh;
        padding-bottom: 2rem;
    }
}

/* ── Top bar ─────────────────────────────────────────────────────── */

.quiz-topbar {
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(to bottom, #0d1117 80%, transparent);
}

.quiz-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.quiz-progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 9999px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: #E05A2B;
    border-radius: 9999px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    min-width: 2.5rem;
    text-align: right;
}

.quiz-skip {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.35);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: color 0.15s;
    white-space: nowrap;
}

.quiz-skip:hover { color: rgba(255, 255, 255, 0.65); }

/* ── Slider container ────────────────────────────────────────────── */

.quiz-slider {
    width: 100%;
    max-width: 560px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* ── Question slide ──────────────────────────────────────────────── */

.quiz-question {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.quiz-prompt {
    font-size: clamp(1.125rem, 4vw, 1.375rem);
    font-weight: 600;
    color: #fff;
    text-align: center;
    line-height: 1.4;
    margin: 0;
}

/* Slide-in / slide-out animations */
.quiz-slide-enter {
    animation: quizSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.quiz-slide-exit {
    animation: quizSlideOut 0.22s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes quizSlideIn {
    from { transform: translateX(48px); opacity: 0; }
    to   { transform: none;             opacity: 1; }
}
@keyframes quizSlideOut {
    from { transform: none;              opacity: 1; }
    to   { transform: translateX(-48px); opacity: 0; }
}

/* ── Image-choice cards (2×2 grid) ──────────────────────────────── */

.quiz-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
}

.quiz-card {
    position: relative;
    aspect-ratio: 5 / 4;
    border-radius: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.quiz-card:hover {
    border-color: rgba(224, 90, 43, 0.5);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
}

.quiz-card:active { transform: translateY(0); }

.quiz-card.selected {
    border-color: #E05A2B;
    background: rgba(224, 90, 43, 0.12);
}

.quiz-card-check {
    position: absolute;
    top: 0.5rem;
    right: 0.625rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: #E05A2B;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quiz-card.selected .quiz-card-check { display: flex; }

.quiz-card-emoji {
    font-size: 2.25rem;
    line-height: 1;
}

.quiz-card-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.80);
    text-align: center;
    line-height: 1.3;
}

/* ── Multi-select chips ──────────────────────────────────────────── */

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: center;
    width: 100%;
    max-width: 480px;
}

.quiz-chip {
    padding: 0.625rem 1.125rem;
    border-radius: 9999px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.quiz-chip:hover {
    border-color: rgba(224, 90, 43, 0.5);
    color: #fff;
    background: rgba(224, 90, 43, 0.08);
}

.quiz-chip.selected {
    background: #E05A2B;
    border-color: #E05A2B;
    color: #fff;
}

.quiz-chip-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.30);
    text-align: center;
}

/* ── Slider (Q4 budget) ──────────────────────────────────────────── */

.quiz-slider-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.quiz-range-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #E05A2B;
    text-align: center;
}

.quiz-range-input {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
}

.quiz-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E05A2B;
    cursor: pointer;
    border: 3px solid #0d1117;
    box-shadow: 0 0 0 2px #E05A2B;
}

.quiz-range-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #E05A2B;
    cursor: pointer;
    border: 3px solid #0d1117;
    box-shadow: 0 0 0 2px #E05A2B;
}

.bucket-labels {
    display: flex;
    justify-content: space-between;
}

.bucket-label {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    flex: 1;
}

.bucket-label.active {
    color: #E05A2B;
    font-weight: 600;
}

/* ── Rank-order drag list (Q8) ───────────────────────────────────── */

.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 420px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.875rem;
    cursor: grab;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rank-item:hover { border-color: rgba(255, 255, 255, 0.18); }

.rank-item.drag-over {
    border-color: #E05A2B;
    background: rgba(224, 90, 43, 0.10);
}

.rank-item.dragging {
    opacity: 0.45;
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.rank-badge {
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.50);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.rank-item:nth-child(1) .rank-badge { background: #E05A2B; color: #fff; }
.rank-item:nth-child(2) .rank-badge { background: rgba(224, 90, 43, 0.60); color: #fff; }
.rank-item:nth-child(3) .rank-badge { background: rgba(224, 90, 43, 0.35); color: rgba(255,255,255,0.85); }

.rank-grip {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.20);
    margin-left: auto;
}

.rank-item-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.80);
    flex: 1;
}

/* ── Continue / confirm buttons ──────────────────────────────────── */

.quiz-continue-btn {
    width: 100%;
    max-width: 420px;
    background: #E05A2B;
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    border-radius: 0.875rem;
    padding: 0.9375rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin-top: 0.5rem;
}

.quiz-continue-btn:hover { background: #c44d22; transform: translateY(-1px); }
.quiz-continue-btn:active { transform: none; }
.quiz-continue-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Loading state ───────────────────────────────────────────────── */

.quiz-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.875rem;
}

.quiz-loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 2.5px solid rgba(255, 255, 255, 0.12);
    border-top-color: #E05A2B;
    border-radius: 50%;
    animation: quizSpin 0.7s linear infinite;
}

@keyframes quizSpin { to { transform: rotate(360deg); } }

/* ── Persona reveal ──────────────────────────────────────────────── */

.persona-reveal {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 3rem;
    gap: 1.5rem;
}
.persona-reveal.hidden { display: none; }

.reveal-scene {
    perspective: 1400px;
}

.reveal-card {
    position: relative;
    width: 340px;
    max-width: 92vw;
    height: 520px;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-card.flipped {
    transform: rotateY(180deg);
}

.reveal-face {
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Front face */
.reveal-front {
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transform: rotateY(0deg);
}

.reveal-front-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.30);
}

/* Shimmer animation on front */
.reveal-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.00) 0%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.10) 50%,
        rgba(255, 255, 255, 0.06) 60%,
        rgba(255, 255, 255, 0.00) 100%
    );
    background-size: 200% 100%;
    animation: shimmerMove 1.6s ease-in-out infinite;
}

@keyframes shimmerMove {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* Back face */
.reveal-back {
    background: linear-gradient(145deg, #1B3A5C 0%, #0d1117 100%);
    border: 1.5px solid rgba(224, 90, 43, 0.30);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.75rem 1.5rem 1.5rem;
    overflow-y: auto;
    gap: 0;
    scroll-behavior: smooth;
}

/* Scrollbar inside reveal card */
.reveal-back::-webkit-scrollbar { width: 3px; }
.reveal-back::-webkit-scrollbar-track { background: transparent; }
.reveal-back::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 9999px; }

.reveal-emoji {
    font-size: 3.75rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    animation: revealBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.65s both;
}

@keyframes revealBounce {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: none;       opacity: 1; }
}

.reveal-you-are {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 0.125rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.reveal-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.625rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0 0 0.75rem;
    line-height: 1.25;
}

.reveal-desc {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    line-height: 1.65;
    margin: 0 0 0.875rem;
}

.reveal-hybrid {
    background: rgba(224, 90, 43, 0.12);
    border: 1px solid rgba(224, 90, 43, 0.30);
    border-radius: 0.625rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.60);
    text-align: center;
    margin-bottom: 0.875rem;
    line-height: 1.5;
}

.reveal-hybrid strong { color: #E05A2B; }

.reveal-divider {
    width: 40%;
    height: 1px;
    background: rgba(255, 255, 255, 0.10);
    margin: 0.25rem 0 0.875rem;
}

.reveal-section-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.30);
    margin: 0 0 0.5rem;
}

.reveal-destinations {
    display: flex;
    gap: 0.4375rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.dest-chip {
    padding: 0.3125rem 0.75rem;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 9999px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer;
}

.dest-chip:hover {
    background: rgba(224, 90, 43, 0.20);
    border-color: #E05A2B;
    color: #fff;
}

.reveal-tags {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
}

.reveal-tag {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.40);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    padding: 0.1875rem 0.5625rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.reveal-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.reveal-cta {
    width: 100%;
    background: #E05A2B;
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    border-radius: 0.875rem;
    padding: 0.875rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.reveal-cta:hover { background: #c44d22; transform: translateY(-1px); }
.reveal-cta:active { transform: none; }

.reveal-retake {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0.25rem;
    transition: color 0.15s;
}

.reveal-retake:hover { color: rgba(255, 255, 255, 0.55); }
