<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Marijuana Strains Info</title>
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: Arial, sans-serif;
            background: #f3f3f3;
            color: #333;
            line-height: 1.6;
        }

        header {
            background: #4caf50;
            color: white;
            padding: 20px;
            text-align: center;
        }

        header h1 {
            margin-bottom: 10px;
        }

        header p {
            font-size: 18px;
        }

        .container {
            width: 90%;
            max-width: 1200px;
            margin: 20px auto;
        }

        .strain {
            background: white;
            border: 1px solid #ddd;
            border-radius: 5px;
            margin: 10px 0;
            padding: 15px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .strain h2 {
            color: #4caf50;
            margin-bottom: 5px;
        }

        .strain p {
            margin-bottom: 10px;
        }

        .strain .type {
            font-weight: bold;
            color: #555;
        }

        .search-bar {
            margin: 20px 0;
            text-align: center;
        }

        .search-bar input {
            width: 80%;
            max-width: 400px;
            padding: 10px;
            font-size: 16px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }

        .no-results {
            text-align: center;
            color: #888;
            margin-top: 20px;
        }
    </style>
</head>

<body>

<header>
    <h1>Explore Marijuana Strains</h1>
    <p>Learn about different types of marijuana strains and their THC & CBD percentages.</p>
</header>

<div class="container">
    <div class="search-bar">
        <input type="text" id="search" placeholder="Search strains by name, type, or percentage...">
    </div>
    <div id="strain-list">
        <!-- Strains will be dynamically loaded here -->
    </div>
    <div class="no-results" id="no-results" style="display: none;">No strains found.</div>
</div>

<script>
    const strains = [
        {
            name: "Blue Dream",
            type: "Hybrid",
            thc: "18%",
            cbd: "2%",
            description: "A calming hybrid with sweet berry flavors and relaxing effects."
        },
        {
            name: "Sour Diesel",
            type: "Sativa",
            thc: "22%",
            cbd: "1%",
            description: "An energizing strain with citrus and diesel-like aroma."
        },
        {
            name: "Northern Lights",
            type: "Indica",
            thc: "16%",
            cbd: "1%",
            description: "A pure indica strain known for its sedative effects and earthy flavor."
        },
        {
            name: "OG Kush",
            type: "Hybrid",
            thc: "20%",
            cbd: "1%",
            description: "A legendary hybrid strain with a woody, pine flavor and strong relaxation."
        },
        {
            name: "Charlotte's Web",
            type: "CBD-Dominant",
            thc: "0.3%",
            cbd: "17%",
            description: "Known for its high CBD content, this strain is used for medical purposes."
        },
        {
            name: "Purple Haze",
            type: "Sativa",
            thc: "20%",
            cbd: "1%",
            description: "A visually stunning strain with purple hues, delivering euphoric and creative effects."
        },
        {
            name: "Maui Wowie",
            type: "Sativa",
            thc: "19%",
            cbd: "0.5%",
            description: "A tropical strain with pineapple flavor and uplifting, energizing effects."
        },
        {
            name: "Pinkman Goo",
            type: "Indica",
            thc: "22%",
            cbd: "0.8%",
            description: "An exotic strain known for its sweet, floral aroma and sticky resin."
        },
        {
            name: "Zkittlez",
            type: "Hybrid",
            thc: "18%",
            cbd: "0.7%",
            description: "A fruity strain with candy-like flavors and relaxing effects."
        },
        {
            name: "Durban Poison",
            type: "Sativa",
            thc: "21%",
            cbd: "0.3%",
            description: "A pure Sativa strain with an earthy, sweet flavor and energizing effects."
        },
        {
            name: "Snowcap",
            type: "Hybrid",
            thc: "17%",
            cbd: "0.6%",
            description: "A rare strain with a minty, lemon flavor that provides a balanced high."
        }
    ];

    const strainList = document.getElementById("strain-list");
    const noResults = document.getElementById("no-results");

    // Function to display strains
    function displayStrains(filter = "") {
        strainList.innerHTML = "";
        let filteredStrains = strains.filter(strain => {
            const search = filter.toLowerCase();
            return (
                strain.name.toLowerCase().includes(search) ||
                strain.type.toLowerCase().includes(search) ||
                strain.thc.includes(search) ||
                strain.cbd.includes(search)
            );
        });

        if (filteredStrains.length === 0) {
            noResults.style.display = "block";
            return;
        }

        noResults.style.display = "none";
        filteredStrains.forEach(strain => {
            const strainDiv = document.createElement("div");
            strainDiv.className = "strain";
            strainDiv.innerHTML = `
                <h2>${strain.name}</h2>
                <p class="type">Type: ${strain.type}</p>
                <p>THC: ${strain.thc}, CBD: ${strain.cbd}</p>
                <p>${strain.description}</p>
            `;
            strainList.appendChild(strainDiv);
        });
    }

    // Event listener for search
    document.getElementById("search").addEventListener("input", function () {
        const searchValue = this.value;
        displayStrains(searchValue);
    });

    // Initial display
    displayStrains();
</script>

</body>

</html>