/* =========================
GOOGLE FONT IMPORT
========================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* =========================
RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg,
            #0f2027,
            #203a43,
            #2c7744);
    min-height: 100vh;
    overflow-x: hidden;
    color: white;
    position: relative;
    transition: .5s;
}

body.light {
    background: linear-gradient(135deg,
            #d4fc79,
            #96e6a1);
    color: #222;
}

/* =========================
PARALLAX BACKGROUND
========================= */

.parallax-bg {
    position: fixed;
    width: 120%;
    height: 120%;
    top: 0;
    left: 0;
    background:
        radial-gradient(circle, #8fffaa22 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    animation: moveBg 40s linear infinite;
}

@keyframes moveBg {

    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(300px);
    }

}

/* =========================
FLOATING LEAVES
========================= */

.leaf {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: .5;
    animation: floatLeaf linear infinite;
}

@keyframes floatLeaf {

    0% {
        transform:
            translateY(-100px) rotate(0deg);
    }

    100% {
        transform:
            translateY(120vh) rotate(360deg);
    }

}

/* =========================
HEADER
========================= */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
}

.logo {
    font-size: 30px;
    font-weight: 800;
}

.toggle {
    font-size: 28px;
    cursor: pointer;
    transition: .3s;
}

.toggle:hover {
    transform: rotate(20deg) scale(1.2);
}

/* =========================
HERO SECTION
========================= */

.hero {
    text-align: center;
    padding: 80px 20px;
    animation: fadeUp 1s;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.typing {
    border-right: 4px solid white;
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    margin: auto;
    animation:
        typing 4s steps(30, end) forwards,
        blink .7s infinite;
}

@keyframes typing {

    from {
        width: 0;
    }

    to {
        width: 100%;
    }

}

@keyframes blink {

    50% {
        border-color: transparent;
    }

}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: auto;
    opacity: .9;
    line-height: 1.8;
}

.start-btn {
    margin-top: 35px;
    padding: 18px 45px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    background: #8cff9f;
    color: #0d3f20;
    transition: .4s;
    box-shadow:
        0 10px 30px rgba(140, 255, 159, .4);
}

.start-btn:hover {
    transform:
        translateY(-5px) scale(1.05);
}

/* =========================
QUIZ
========================= */

.quiz-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
    display: none;
}

.glass-card {
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 30px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, .3);
    animation: fadeUp .8s;
}

.question {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

.options {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.option {
    padding: 25px;
    border-radius: 20px;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    background: rgba(255, 255, 255, .15);
    transition: .4s;
}

.option:hover {
    background: #8cff9f;
    color: #123d20;
    transform:
        translateY(-10px) scale(1.05);
}

/* =========================
PROGRESS BAR
========================= */

.progress-wrapper {
    margin-bottom: 30px;
}

.progress-bar {
    height: 18px;
    background: #ffffff22;
    border-radius: 30px;
    overflow: hidden;
}

.progress {
    height: 100%;
    width: 0%;
    background:
        linear-gradient(90deg,
            #84fab0,
            #8fd3f4);
    transition: .5s;
}

.eco-score {
    margin-top: 10px;
    text-align: right;
    font-weight: 700;
}

/* =========================
RECOMMENDATION METER
========================= */

.meter-box {
    margin: 30px 0;
}

.meter-label {
    font-weight: 700;
    margin-bottom: 10px;
}

.meter {
    height: 16px;
    background: #ffffff22;
    border-radius: 30px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0;
    background:
        linear-gradient(90deg,
            #84fab0,
            #8fd3f4);
    transition: .6s;
}

/* =========================
RESULTS
========================= */

.results-section {
    display: none;
    max-width: 1200px;
    margin: auto;
    padding: 30px;
    animation: fadeUp 1s;
}

.result-title {
    font-size: 3rem;
    text-align: center;
    font-weight: 800;
    margin-bottom: 10px;
}

.result-subtitle {
    text-align: center;
    opacity: .85;
    margin-bottom: 50px;
}

/* =========================
PLANT GROWTH
========================= */

.growth-area {
    height: 250px;
    position: relative;
    margin-bottom: 40px;
}

.soil {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60px;
    background: #5a3d2b;
    border-radius: 30px;
}

.plant {
    position: absolute;
    left: 50%;
    bottom: 50px;
    font-size: 140px;
    transform:
        translateX(-50%) scale(0);
    transition: 2s;
    animation:
        plantFloat 3s infinite ease-in-out;
}

@keyframes plantFloat {

    0% {
        transform:
            translateX(-50%) translateY(0);
    }

    50% {
        transform:
            translateX(-50%) translateY(-15px);
    }

    100% {
        transform:
            translateX(-50%) translateY(0);
    }

}

/* =========================
CROP CARDS
========================= */

.results-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.crop-card {
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    transition: .5s;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, .25);
}

.crop-card:hover {
    transform:
        translateY(-15px) rotate(1deg) scale(1.03);
}

.crop-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            transparent,
            rgba(255, 255, 255, .15),
            transparent);
    transform: translateX(-100%);
    transition: 1s;
}

.crop-card:hover::before {
    transform: translateX(100%);
}

.crop-card img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    transition: .6s;
}

.crop-card:hover img {
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
}

.crop-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.crop-reason {
    line-height: 1.7;
    opacity: .9;
    margin-bottom: 20px;
}

.grow-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    background: #8cff9f;
    color: #0c3f1e;
    transition: .3s;
}

.grow-btn:hover {
    transform: scale(1.08);
}

/* =========================
RESTART BUTTON
========================= */

.restart-btn {
    display: block;
    margin: 60px auto;
    padding: 18px 40px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    background: white;
    color: #1f6f3d;
    transition: .3s;
}

.restart-btn:hover {
    transform:
        translateY(-5px);
}

/* =========================
CONFETTI
========================= */

.confetti {
    position: fixed;
    width: 12px;
    height: 12px;
    top: -20px;
    z-index: 9999;
    animation: fall linear forwards;
}

@keyframes fall {

    0% {
        transform:
            translateY(-20px) rotate(0deg);
    }

    100% {
        transform:
            translateY(120vh) rotate(720deg);
    }

}

/* =========================
ANIMATIONS
========================= */

@keyframes fadeUp {

    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}

@keyframes pulse {

    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }

}

@keyframes glow {

    0% {
        box-shadow:
            0 0 10px rgba(140, 255, 159, .2);
    }

    50% {
        box-shadow:
            0 0 30px rgba(140, 255, 159, .8);
    }

    100% {
        box-shadow:
            0 0 10px rgba(140, 255, 159, .2);
    }

}

/* =========================
LIGHT MODE
========================= */

body.light .glass-card {
    background: rgba(255, 255, 255, .6);
    color: #222;
}

body.light .crop-card {
    background: rgba(255, 255, 255, .7);
    color: #222;
}

body.light .option {
    background: rgba(255, 255, 255, .7);
}

/* =========================
RESPONSIVE
========================= */

@media(max-width:768px) {

    .header {
        padding: 20px;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .question {
        font-size: 1.5rem;
    }

    .result-title {
        font-size: 2rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

}

@media(max-width:500px) {

    .hero {
        padding: 50px 15px;
    }

    .hero p {
        font-size: 1rem;
    }

    .start-btn {
        width: 100%;
    }

    .option {
        padding: 18px;
    }

}