/* AI-PlantMatcher.css - Masterpiece White Theme */

:root {
    --matcher-bg: #fdfdfd;
    --matcher-accent: #00A651;
    --matcher-accent-soft: rgba(0, 166, 81, 0.1);
    --matcher-text-prime: #1a1a1a;
    --matcher-text-sub: #64748b;
    --matcher-glass: rgba(255, 255, 255, 0.8);
    --matcher-border: rgba(0, 0, 0, 0.05);
    --matcher-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    --ease-master: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Base & Reset --- */
.matcher-v2-white {
    margin: 0;
    padding: 0;
    background-color: var(--matcher-bg);
    color: var(--matcher-text-prime);
    font-family: 'Poppins', sans-serif;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 1.2s var(--ease-master);
    -webkit-font-smoothing: antialiased;
}

.matcher-v2-white.loaded {
    opacity: 1;
}

/* --- Immersive White Background --- */
.matcher-bg-abstract {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at top right, #fff, #f8fafc);
}

.blob {
    position: absolute;
    filter: blur(100px);
    opacity: 0.2;
    border-radius: 50%;
    animation: blobMove 30s infinite alternate linear;
    will-change: transform;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #dcfce7;
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #f0fdf4;
    bottom: 0;
    right: 0;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #ecfdf5;
    top: 40%;
    left: 40%;
}

@keyframes blobMove {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 50px) scale(1.2);
    }
}

/* --- Professional Nav --- */
.matcher-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    z-index: 100;
}

.back-link {
    background: white;
    border: 1px solid var(--matcher-border);
    padding: 10px 20px;
    border-radius: 100px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s var(--ease-master);
}

.nav-left {
    color: #1a1a1a;
}

.back-link:hover {
    transform: translateX(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--matcher-text-sub);
}

.status-pulse {
    width: 6px;
    height: 6px;
    background: var(--matcher-accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--matcher-accent);
    animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {
    50% {
        opacity: 0.3;
        transform: scale(1.5);
    }
}

/* --- Screens --- */
.matcher-content {
    flex: 1;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen {
    position: absolute;
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(0.96) translateY(40px);
    pointer-events: none;
    transition: transform 1s var(--ease-master), opacity 0.8s var(--ease-master), visibility 0.8s;
    visibility: hidden;
    will-change: transform, opacity;
}

.screen.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0.2s;
}

.screen.exit {
    opacity: 0;
    transform: scale(1.05) translateY(-40px);
    filter: blur(10px);
}

/* --- Welcome --- */
.premium-orb {
    width: 100px;
    height: 100px;
    background: var(--matcher-bg);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--matcher-accent);
    box-shadow: 0 20px 50px rgba(0, 166, 81, 0.15);
    margin-bottom: 40px;
    animation: morphOrb 10s infinite alternate ease-in-out;
}

@keyframes morphOrb {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    }

    100% {
        border-radius: 50% 50% 20% 80% / 25% 80% 20% 75%;
    }
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(40px, 8vw, 70px);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 20px;
}

.hero-desc {
    font-size: 18px;
    color: var(--matcher-text-sub);
    max-width: 500px;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 60px;
}

.masterpiece-btn {
    background: var(--matcher-accent);
    color: white;
    border: none;
    padding: 22px 50px;
    border-radius: 100px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 40px rgba(0, 166, 81, 0.25);
    transition: all 0.4s var(--ease-master);
}

.masterpiece-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 166, 81, 0.35);
}

/* --- Layout --- */
.matcher-layout {
    display: flex;
    width: 100%;
    gap: 80px;
    align-items: stretch;
}

.matcher-sidebar {
    width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.progress-vertical {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
}

.progress-node {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #94a3b8;
    background: white;
    transition: all 0.5s var(--ease-master);
    position: relative;
    z-index: 2;
}

.progress-node.active {
    border-color: var(--matcher-accent);
    color: var(--matcher-accent);
    box-shadow: 0 0 20px var(--matcher-accent-soft);
    transform: scale(1.2);
}

.progress-node.completed {
    background: var(--matcher-accent);
    border-color: var(--matcher-accent);
    color: white;
}

.question-canvas {
    flex: 1;
    background: white;
    border-radius: 40px;
    padding: 60px;
    box-shadow: var(--matcher-shadow);
    text-align: left;
    min-height: 500px;
}

.step-label {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--matcher-accent);
    margin-bottom: 20px;
}

.question-text {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--matcher-text-prime);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.premium-option {
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s var(--ease-master);
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInOption 0.6s var(--ease-master) forwards;
}

@keyframes slideInOption {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.premium-option:nth-child(1) {
    animation-delay: 0.1s;
}

.premium-option:nth-child(2) {
    animation-delay: 0.2s;
}

.premium-option:nth-child(3) {
    animation-delay: 0.3s;
}

.premium-option:nth-child(4) {
    animation-delay: 0.4s;
}

.option-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--matcher-text-sub);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.4s var(--ease-master);
}

.option-details h4 {
    margin: 0 0 5px;
    font-size: 18px;
}

.option-details p {
    margin: 0;
    font-size: 13px;
    color: var(--matcher-text-sub);
}

.premium-option:hover {
    background: white;
    border-color: #e2e8f0;
    transform: translateY(-3px);
}

.premium-option.selected {
    border-color: var(--matcher-accent);
    background: var(--matcher-accent-soft);
}

.premium-option.selected .option-icon {
    background: var(--matcher-accent);
    color: white;
}

/* --- Results Premium --- */
#resultsScreen {
    max-width: 1200px;
}

.results-header {
    margin-bottom: 50px;
    text-align: center;
}

.results-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
    padding: 10px;
    overflow-y: auto;
    max-height: 65vh;
}

/* Override product-card for white theme context */
.matcher-v2-white .product-card {
    background: white !important;
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04) !important;
}

.matcher-v2-white .product-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08) !important;
}

/* --- Navigation Floor --- */
.navigation-nav {
    margin-top: 40px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-btn {
    background: white;
    border: 1px solid var(--matcher-border);
    padding: 15px 30px;
    border-radius: 100px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #f8fafc;
}

/* Analysis Visuals */
.analysis-visual {
    margin-bottom: 40px;
}

.core-node {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--matcher-accent);
    box-shadow: 0 20px 60px rgba(0, 166, 81, 0.2);
    position: relative;
    z-index: 5;
}

.neural-rings .ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--matcher-accent-soft);
    border-radius: 50%;
    animation: ringPulse 3s infinite;
}

.ring:nth-child(1) {
    width: 160px;
    height: 160px;
    animation-delay: 0s;
}

.ring:nth-child(2) {
    width: 220px;
    height: 220px;
    animation-delay: 0.5s;
}

.ring:nth-child(3) {
    width: 280px;
    height: 280px;
    animation-delay: 1s;
}

@keyframes ringPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* Custom Scrollbar for Results */
.results-grid-premium::-webkit-scrollbar {
    width: 6px;
}

.results-grid-premium::-webkit-scrollbar-track {
    background: transparent;
}

.results-grid-premium::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.results-grid-premium::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 166, 81, 0.2);
}

/* Animations & Interactions */
.premium-option:active {
    transform: scale(0.97);
}

.progress-node:hover {
    border-color: var(--matcher-accent);
    cursor: pointer;
}

.log-line {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    color: var(--matcher-text-sub);
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* --- ULTRA MOBILE RESPONSIVE SYSTEM --- */
@media (max-width: 800px) {
    .matcher-nav {
        padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
        position: fixed;
        top: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(15px);
        border-bottom: 1px solid var(--matcher-border);
        z-index: 1000;
    }

    .back-link {
        padding: 8px 15px;
        font-size: 13px;
    }

    .ai-status {
        display: none;
        /* Hide on small mobile to save space */
    }

    .matcher-content {
        padding: calc(85px + env(safe-area-inset-top)) 15px calc(110px + env(safe-area-inset-bottom)) 15px;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .screen {
        max-width: 100%;
        transform: translateY(20px);
    }

    .matcher-layout {
        flex-direction: column;
        gap: 20px;
        width: 100%;
        margin-bottom: 150px;
    }

    .matcher-sidebar {
        width: 100%;
        order: -1;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--matcher-border);
    }

    .progress-vertical {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        gap: 5px;
    }

    .progress-node {
        width: 32px;
        height: 32px;
        font-size: 9px;
    }

    .question-canvas {
        padding: 25px 20px;
        border-radius: 24px;
        min-height: auto;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    }

    .question-text {
        font-size: 20px;
        margin-bottom: 25px;
        line-height: 1.4;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .premium-option {
        padding: 18px;
        gap: 15px;
    }

    .option-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        border-radius: 12px;
    }

    .option-details h4 {
        font-size: 15px;
    }

    /* Fixed Navigation Floor for Mobile */
    .navigation-nav {
        position: fixed;
        bottom: 60px;
        left: 0;
        width: 100%;
        padding: 15px 20px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--matcher-border);
        margin-top: 0;
        z-index: 1000;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    }

    .step-indicator {
        font-size: 11px;
        font-weight: 700;
        color: var(--matcher-text-sub);
        background: var(--matcher-accent-soft);
        padding: 6px 12px;
        border-radius: 20px;
    }

    .nav-btn {
        padding: 12px 25px;
        font-size: 14px;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.05);
    }

    .hero-title {
        font-size: 32px;
        margin-top: 40px;
    }

    .hero-desc {
        font-size: 14px;
        margin-bottom: 30px;
    }

    .results-grid-premium {
        grid-template-columns: 1fr;
        gap: 20px;
        max-height: none;
        overflow: visible;
    }

    .results-header h2 {
        font-size: 24px;
    }
}

/* Extra Small Devices */
@media (max-width: 400px) {
    .hero-title {
        font-size: 28px;
    }

    .masterpiece-btn {
        padding: 18px 30px;
        font-size: 16px;
        width: 100%;
        justify-content: center;
    }
}
