/* ================================
   Values Finder — App Styles
   Prefix: vf-
   Requires: mgy-tokens.css, mgy-components.css
   ================================ */


[v-cloak] { display: none; }


/* ---- Layout ---- */

.vf-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.vf-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--mgy-space-lg);
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}


/* ---- Intro Screen ---- */

.vf-intro {
    text-align: center;
    max-width: 440px;
}

.vf-intro h1 {
    font-size: var(--mgy-text-4xl);
    margin-bottom: var(--mgy-space-md);
}

.vf-intro p {
    color: var(--mgy-text-light);
    font-size: var(--mgy-text-lg);
    margin-bottom: var(--mgy-space-xl);
    line-height: 1.6;
}

.vf-start-btn {
    font-size: var(--mgy-text-lg);
    padding: 16px 48px;
}


/* ---- Progress Bar ---- */

.vf-progress-wrap {
    width: 100%;
    margin-bottom: var(--mgy-space-xl);
}

.vf-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: var(--mgy-text-sm);
    color: var(--mgy-text-muted);
    margin-bottom: var(--mgy-space-xs);
}


/* ---- Phase 1: Swipe Cards ---- */

.vf-swipe-area {
    position: relative;
    width: 100%;
    height: 320px;
    perspective: 1000px;
    margin-bottom: var(--mgy-space-xl);
}

.vf-card {
    position: absolute;
    inset: 0;
    background: var(--mgy-bg-card);
    border: 1px solid var(--mgy-border-light);
    border-radius: var(--mgy-radius-2xl);
    box-shadow: var(--mgy-shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--mgy-space-2xl);
    text-align: center;
    touch-action: none;
    user-select: none;
    cursor: grab;
    transition: box-shadow var(--mgy-transition-normal);
    will-change: transform;
}

.vf-card:active {
    cursor: grabbing;
}

.vf-card-name {
    font-family: var(--mgy-font-heading);
    font-size: var(--mgy-text-3xl);
    font-weight: var(--mgy-weight-semibold);
    color: var(--mgy-text-heading);
    margin-bottom: var(--mgy-space-md);
}

.vf-card-desc {
    font-size: var(--mgy-text-lg);
    color: var(--mgy-text-light);
    line-height: 1.5;
}

/* Card behind (next card preview) */
.vf-card-behind {
    transform: scale(0.95) translateY(8px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.vf-card-front {
    z-index: 1;
}

/* Swipe indicator overlays */
.vf-swipe-indicator {
    position: absolute;
    top: var(--mgy-space-lg);
    font-size: var(--mgy-text-xl);
    font-weight: var(--mgy-weight-bold);
    padding: var(--mgy-space-xs) var(--mgy-space-md);
    border-radius: var(--mgy-radius-lg);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    z-index: 2;
}

.vf-indicator-right {
    right: var(--mgy-space-lg);
    color: var(--mgy-success-text);
    background: var(--mgy-success-bg);
    border: 2px solid var(--mgy-success-text);
}

.vf-indicator-left {
    left: var(--mgy-space-lg);
    color: var(--mgy-text-muted);
    background: var(--mgy-bg-warm);
    border: 2px solid var(--mgy-border-medium);
}

.vf-indicator-up {
    left: 50%;
    transform: translateX(-50%);
    color: var(--mgy-warning-text);
    background: var(--mgy-warning-bg);
    border: 2px solid var(--mgy-warning-text);
}

/* Swipe exit animations */
.vf-exit-right {
    animation: vf-fly-right 0.35s ease-out forwards;
}
.vf-exit-left {
    animation: vf-fly-left 0.35s ease-out forwards;
}
.vf-exit-up {
    animation: vf-fly-up 0.35s ease-out forwards;
}

@keyframes vf-fly-right {
    to { transform: translateX(120%) rotate(20deg); opacity: 0; }
}
@keyframes vf-fly-left {
    to { transform: translateX(-120%) rotate(-20deg); opacity: 0; }
}
@keyframes vf-fly-up {
    to { transform: translateY(-120%) scale(0.9); opacity: 0; }
}

/* Swipe action buttons */
.vf-swipe-actions {
    display: flex;
    gap: var(--mgy-space-lg);
    align-items: center;
    justify-content: center;
}

.vf-action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--mgy-border-medium);
    background: var(--mgy-bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    transition:
        transform var(--mgy-transition-fast),
        border-color var(--mgy-transition-normal),
        background var(--mgy-transition-normal);
}

.vf-action-btn:hover {
    transform: scale(1.1);
}

.vf-action-skip {
    color: var(--mgy-text-muted);
}
.vf-action-skip:hover {
    border-color: var(--mgy-border-dark);
    background: var(--mgy-bg-warm);
}

.vf-action-maybe {
    color: var(--mgy-warning-text);
}
.vf-action-maybe:hover {
    border-color: var(--mgy-warning-text);
    background: var(--mgy-warning-bg);
}

.vf-action-yes {
    width: 64px;
    height: 64px;
    font-size: 26px;
    color: var(--mgy-success-text);
}
.vf-action-yes:hover {
    border-color: var(--mgy-success-text);
    background: var(--mgy-success-bg);
}

.vf-action-label {
    font-size: var(--mgy-text-xs);
    color: var(--mgy-text-faint);
    text-align: center;
    margin-top: var(--mgy-space-xs);
}


/* ---- Phase Transition ---- */

.vf-transition {
    text-align: center;
    animation: vf-fade-in 0.5s ease-out;
}

.vf-transition h2 {
    font-size: var(--mgy-text-3xl);
    margin-bottom: var(--mgy-space-md);
}

.vf-transition p {
    color: var(--mgy-text-light);
    font-size: var(--mgy-text-lg);
    margin-bottom: var(--mgy-space-xl);
}

@keyframes vf-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ---- Phase 2: Compare Pairs ---- */

.vf-compare-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mgy-space-md);
    width: 100%;
    margin-bottom: var(--mgy-space-xl);
}

.vf-compare-card {
    background: var(--mgy-bg-card);
    border: 2px solid var(--mgy-border-light);
    border-radius: var(--mgy-radius-2xl);
    box-shadow: var(--mgy-shadow-card);
    padding: var(--mgy-space-xl) var(--mgy-space-lg);
    text-align: center;
    cursor: pointer;
    transition:
        border-color var(--mgy-transition-normal),
        box-shadow var(--mgy-transition-normal),
        transform var(--mgy-transition-fast),
        background var(--mgy-transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    animation: vf-slide-in 0.3s ease-out;
}

.vf-compare-card:hover {
    border-color: var(--mgy-brand);
    box-shadow: var(--mgy-shadow-card-hover);
    transform: translateY(-3px);
}

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

.vf-compare-card .vf-card-name {
    font-size: var(--mgy-text-2xl);
    margin-bottom: var(--mgy-space-sm);
}

.vf-compare-card .vf-card-desc {
    font-size: var(--mgy-text-sm);
}

.vf-compare-or {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--mgy-bg-page);
    color: var(--mgy-text-muted);
    font-size: var(--mgy-text-sm);
    font-weight: var(--mgy-weight-semibold);
    padding: var(--mgy-space-xs) var(--mgy-space-sm);
    border-radius: var(--mgy-radius-round);
    border: 1px solid var(--mgy-border-light);
    z-index: 1;
}

.vf-compare-wrap {
    position: relative;
    width: 100%;
    margin-bottom: var(--mgy-space-xl);
}

@keyframes vf-slide-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.vf-compare-prompt {
    text-align: center;
    color: var(--mgy-text-light);
    font-size: var(--mgy-text-lg);
    margin-bottom: var(--mgy-space-lg);
}


/* ---- Phase 3: Reveal ---- */

.vf-reveal {
    width: 100%;
    max-width: 500px;
    text-align: center;
}

.vf-reveal h2 {
    font-size: var(--mgy-text-3xl);
    margin-bottom: var(--mgy-space-xl);
    animation: vf-fade-in 0.6s ease-out;
}

.vf-reveal-cards {
    display: flex;
    flex-direction: column;
    gap: var(--mgy-space-md);
    margin-bottom: var(--mgy-space-2xl);
}

.vf-reveal-card {
    background: var(--mgy-bg-card);
    border: 1px solid var(--mgy-border-light);
    border-radius: var(--mgy-radius-xl);
    box-shadow: var(--mgy-shadow-card);
    padding: var(--mgy-space-lg);
    display: flex;
    align-items: center;
    gap: var(--mgy-space-md);
    animation: vf-reveal-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.vf-reveal-card:nth-child(1) { animation-delay: 0.1s; }
.vf-reveal-card:nth-child(2) { animation-delay: 0.4s; }
.vf-reveal-card:nth-child(3) { animation-delay: 0.7s; }
.vf-reveal-card:nth-child(4) { animation-delay: 1.0s; }
.vf-reveal-card:nth-child(5) { animation-delay: 1.3s; }

@keyframes vf-reveal-pop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.vf-reveal-rank {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--mgy-brand);
    color: #FFF;
    font-weight: var(--mgy-weight-bold);
    font-size: var(--mgy-text-base);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vf-reveal-info {
    text-align: left;
    flex: 1;
}

.vf-reveal-name {
    font-family: var(--mgy-font-heading);
    font-size: var(--mgy-text-xl);
    font-weight: var(--mgy-weight-semibold);
    color: var(--mgy-text-heading);
}

.vf-reveal-desc {
    font-size: var(--mgy-text-sm);
    color: var(--mgy-text-light);
}


/* ---- Insight Block ---- */

.vf-insight {
    background: var(--mgy-bg-warm);
    border-radius: var(--mgy-radius-xl);
    padding: var(--mgy-space-xl);
    margin-bottom: var(--mgy-space-2xl);
    text-align: left;
    animation: vf-fade-in 0.8s ease-out 1.8s both;
}

.vf-insight p {
    font-size: var(--mgy-text-lg);
    line-height: 1.7;
    color: var(--mgy-text-body);
    margin: 0;
    font-style: italic;
}

.vf-insight-loading {
    text-align: center;
    color: var(--mgy-text-muted);
    font-style: italic;
}

.vf-insight-loading .vf-dots::after {
    content: '';
    animation: vf-dots 1.5s steps(4, end) infinite;
}

@keyframes vf-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}


/* ---- Actions (Share/Restart) ---- */

.vf-final-actions {
    display: flex;
    gap: var(--mgy-space-md);
    justify-content: center;
    flex-wrap: wrap;
    animation: vf-fade-in 0.5s ease-out 2.2s both;
}


/* ---- Keyboard Hints ---- */

.vf-keyboard-hint {
    display: none;
    gap: var(--mgy-space-xl);
    justify-content: center;
    margin-top: var(--mgy-space-lg);
    color: var(--mgy-text-faint);
    font-size: var(--mgy-text-xs);
}

.vf-keyboard-hint kbd {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--mgy-border-light);
    border-radius: var(--mgy-radius-sm);
    background: var(--mgy-bg-card);
    font-family: inherit;
    font-size: var(--mgy-text-xs);
    margin-right: 4px;
}

@media (hover: hover) and (pointer: fine) {
    .vf-keyboard-hint {
        display: flex;
    }
}


/* ---- Responsive ---- */

@media (max-width: 500px) {
    .vf-main {
        padding: var(--mgy-space-md);
    }

    .vf-intro h1 {
        font-size: var(--mgy-text-3xl);
    }

    .vf-swipe-area {
        height: 280px;
    }

    .vf-card-name {
        font-size: var(--mgy-text-2xl);
    }

    .vf-compare-card {
        padding: var(--mgy-space-lg) var(--mgy-space-md);
        min-height: 160px;
    }

    .vf-compare-card .vf-card-name {
        font-size: var(--mgy-text-xl);
    }
}


/* ---- Minimal Navbar ---- */

.vf-navbar {
    padding: var(--mgy-space-md) var(--mgy-page-padding);
    border-bottom: 1px solid var(--mgy-border-light);
    background: var(--mgy-bg-card);
}

.vf-navbar a {
    font-family: var(--mgy-font-brand);
    font-size: var(--mgy-text-lg);
    color: var(--mgy-text-heading);
    text-decoration: none;
}

.vf-navbar a:hover {
    color: var(--mgy-brand);
}


/* ---- Background Grain (matches MGY brand) ---- */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}
