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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HeartGuard - Heart Disease Prediction</title>
    <style>
        :root {
            --primary: #e74c3c;
            --primary-light: #ff6b6b;
            --primary-dark: #c0392b;
            --secondary: #3498db;
            --secondary-dark: #2980b9;
            --white: #ffffff;
            --light: #f8f9fa;
            --dark: #343a40;
            --gray: #6c757d;
            --light-gray: #e9ecef;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--light);
            color: var(--dark);
            line-height: 1.6;
        }

        /* Header Styles */
        header {
            background-color: var(--white);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
        }

        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 5%;
            max-width: 1400px;
            margin: 0 auto;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .logo img {
            height: 40px;
        }

        .logo h1 {
            font-size: 1.8rem;
            color: var(--primary);
            font-weight: 600;
        }

        .logo span {
            color: var(--secondary);
        }

        nav ul {
            display: flex;
            list-style: none;
            gap: 2rem;
        }

        nav a {
            text-decoration: none;
            color: var(--dark);
            font-weight: 500;
            transition: all 0.3s ease;
            padding: 0.5rem 1rem;
            border-radius: 4px;
        }

        nav a:hover, nav a.active {
            color: var(--primary);
        }

        nav a.active {
            background-color: rgba(231, 76, 60, 0.1);
        }

        .mobile-toggle {
            display: none;
            cursor: pointer;
            font-size: 1.5rem;
        }

        /* Hero Section */
        .hero {
            background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/api/placeholder/1200/600') center/cover no-repeat;
            height: 70vh;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 0 1rem;
            color: var(--white);
            margin-top: 73px;
        }

        .hero-content {
            max-width: 800px;
        }

        .hero h2 {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        .hero p {
            font-size: 1.2rem;
            margin-bottom: 2rem;
        }

        .btn {
            display: inline-block;
            background-color: var(--primary);
            color: var(--white);
            padding: 0.8rem 1.8rem;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            transition: all 0.3s ease;
            border: none;
            cursor: pointer;
            font-size: 1rem;
        }

        .btn:hover {
            background-color: var(--primary-dark);
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }

        .btn-secondary {
            background-color: var(--secondary);
        }

        .btn-secondary:hover {
            background-color: var(--secondary-dark);
        }

        .btn-outline {
            background-color: transparent;
            border: 2px solid var(--white);
            margin-left: 1rem;
        }

        .btn-outline:hover {
            background-color: var(--white);
            color: var(--primary);
        }

        /* Sections */
        section {
            padding: 5rem 1rem;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .section-title {
            text-align: center;
            margin-bottom: 3rem;
        }

        .section-title h2 {
            font-size: 2.5rem;
            color: var(--dark);
            position: relative;
            display: inline-block;
            margin-bottom: 1rem;
        }

        .section-title h2::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 50px;
            height: 3px;
            background-color: var(--primary);
        }

        .section-title p {
            color: var(--gray);
            max-width: 700px;
            margin: 0 auto;
        }

        /* About Section */
        .about {
            background-color: var(--white);
        }

        .about-content {
            display: flex;
            align-items: center;
            gap: 3rem;
        }

        .about-image {
            flex: 1;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .about-image img {
            width: 100%;
            height: auto;
            transition: transform 0.5s ease;
        }

        .about-image:hover img {
            transform: scale(1.05);
        }

        .about-text {
            flex: 1;
        }

        .about-text h3 {
            font-size: 1.8rem;
            margin-bottom: 1rem;
            color: var(--primary);
        }

        .about-text p {
            margin-bottom: 1.5rem;
        }

        .features {
            margin-top: 2rem;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
        }

        .feature {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
        }

        .feature-icon {
            width: 40px;
            height: 40px;
            background-color: rgba(231, 76, 60, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 1.2rem;
        }

        .feature-text h4 {
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
        }

        .feature-text p {
            color: var(--gray);
            font-size: 0.9rem;
            margin-bottom: 0;
        }

        /* Prediction Section */
        .prediction {
            background-color: var(--light);
        }

        .form-container {
            background-color: var(--white);
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }

        .form-title {
            margin-bottom: 1.5rem;
            text-align: center;
        }

        .form-title h3 {
            font-size: 1.8rem;
            color: var(--primary);
        }

        .form-group {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .input-group {
            margin-bottom: 1rem;
        }

        .input-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }

        .input-group .hint {
            display: block;
            font-size: 0.8rem;
            color: var(--gray);
            margin-bottom: 0.5rem;
        }

        .input-group input, .input-group select {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 1px solid var(--light-gray);
            border-radius: 4px;
            transition: all 0.3s ease;
        }

        .input-group input:focus, .input-group select:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
        }

        .form-actions {
            display: flex;
            justify-content: center;
            margin-top: 2rem;
        }

        /* Contact Section */
        .contact {
            background-color: var(--white);
        }

        .contact-info {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .contact-card {
            text-align: center;
            padding: 2rem;
            background-color: var(--light);
            border-radius: 10px;
            transition: all 0.3s ease;
        }

        .contact-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }

        .contact-icon {
            width: 60px;
            height: 60px;
            background-color: rgba(231, 76, 60, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 1.5rem;
            margin: 0 auto 1rem;
        }

        .contact-card h4 {
            font-size: 1.2rem;
            margin-bottom: 0.5rem;
        }

        .contact-card p, .contact-card a {
            color: var(--gray);
            text-decoration: none;
        }

        .contact-card a:hover {
            color: var(--primary);
        }

        .contact-form {
            background-color: var(--light);
            padding: 2rem;
            border-radius: 10px;
        }

        .form-row {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .contact-form textarea {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 1px solid var(--light-gray);
            border-radius: 4px;
            resize: vertical;
            min-height: 150px;
            transition: all 0.3s ease;
        }

        .contact-form textarea:focus {
            border-color: var(--primary);
            outline: none;
            box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
        }

        /* Footer */
        footer {
            background-color: var(--dark);
            color: var(--white);
            padding: 3rem 1rem 1rem;
        }

        .footer-content {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .footer-logo {
            margin-bottom: 1rem;
        }

        .footer-logo h2 {
            font-size: 1.5rem;
            color: var(--white);
        }

        .footer-logo span {
            color: var(--primary);
        }

        .footer-about p {
            color: #adb5bd;
            margin-bottom: 1.5rem;
        }

        .social-links {
            display: flex;
            gap: 1rem;
        }

        .social-link {
            width: 35px;
            height: 35px;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--white);
            transition: all 0.3s ease;
        }

        .social-link:hover {
            background-color: var(--primary);
            transform: translateY(-3px);
        }

        .footer-links h3, .footer-contact h3, .footer-newsletter h3 {
            font-size: 1.2rem;
            margin-bottom: 1.5rem;
            position: relative;
            padding-bottom: 0.8rem;
        }

        .footer-links h3::after, .footer-contact h3::after, .footer-newsletter h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 30px;
            height: 2px;
            background-color: var(--primary);
        }

        .footer-links ul {
            list-style: none;
        }

        .footer-links li {
            margin-bottom: 0.8rem;
        }

        .footer-links a {
            color: #adb5bd;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .footer-links a:hover {
            color: var(--primary);
            padding-left: 5px;
        }

        .footer-contact p {
            color: #adb5bd;
            margin-bottom: 1rem;
            display: flex;
            align-items: flex-start;
            gap: 1rem;
        }

        .footer-contact i {
            color: var(--primary);
        }

        .newsletter-form {
            display: flex;
            margin-top: 1.5rem;
        }

        .newsletter-form input {
            flex: 1;
            padding: 0.8rem 1rem;
            border: none;
            border-radius: 4px 0 0 4px;
            outline: none;
        }

        .newsletter-form button {
            background-color: var(--primary);
            color: var(--white);
            border: none;
            border-radius: 0 4px 4px 0;
            padding: 0 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .newsletter-form button:hover {
            background-color: var(--primary-dark);
        }

        .footer-bottom {
            text-align: center;
            padding-top: 2rem;
            margin-top: 3rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: #adb5bd;
            font-size: 0.9rem;
        }

        /* Responsive */
        @media (max-width: 992px) {
            .about-content {
                flex-direction: column;
            }

            .form-group, .contact-info {
                grid-template-columns: repeat(2, 1fr);
            }

            .footer-content {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 768px) {
            .navbar {
                padding: 1rem;
            }

            .mobile-toggle {
                display: block;
            }

            nav ul {
                display: none;
                position: absolute;
                top: 73px;
                left: 0;
                width: 100%;
                background-color: var(--white);
                flex-direction: column;
                padding: 1rem;
                box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
                gap: 0;
            }

            nav ul.show {
                display: flex;
            }

            nav ul li {
                width: 100%;
            }

            nav ul a {
                display: block;
                padding: 1rem;
                width: 100%;
            }

            .hero h2 {
                font-size: 2.5rem;
            }

            .form-group, .contact-info, .form-row {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 576px) {
            .features {
                grid-template-columns: 1fr;
            }

            .footer-content {
                grid-template-columns: 1fr;
            }

            .btn-outline {
                margin-left: 0;
                margin-top: 1rem;
            }
        }

        /* Animations */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .animate {
            animation: fadeIn 0.6s ease forwards;
        }
    </style>
</head>

<body>
    <!-- Header -->
    <header>
        <div class="navbar">
            <div class="logo">
                <svg width="40" height="40" viewBox="0 0 40 40" fill="none">
                    <path d="M20 5C11.7157 5 5 11.7157 5 20C5 28.2843 11.7157 35 20 35C28.2843 35 35 28.2843 35 20C35 11.7157 28.2843 5 20 5Z" stroke="#e74c3c" stroke-width="2" fill="none" />
                    <path d="M20 12C15.5817 12 12 15.5817 12 20C12 24.4183 15.5817 28 20 28C24.4183 28 28 24.4183 28 20C28 15.5817 24.4183 12 20 12Z" fill="#e74c3c" />
                    <path d="M20 5V12" stroke="#e74c3c" stroke-width="2" />
                    <path d="M27.5 8.5L23 15" stroke="#e74c3c" stroke-width="2" />
                    <path d="M12.5 8.5L17 15" stroke="#e74c3c" stroke-width="2" />
                </svg>
                <h1>Heart<span>Guard</span></h1>
            </div>
            <div class="mobile-toggle">☰</div>
            <nav>
                <ul>
                    <li><a href="#home" class="active">Home</a></li>
                    <li><a href="#about">About</a></li>
                    <li><a href="#prediction">Prediction</a></li>
                    <li><a href="#contact">Contact</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <!-- Hero Section -->
    <section class="hero" id="home">
        <div class="hero-content animate">
            <h2>Heart Disease Prediction Using Machine Learning</h2>
            <p>Take control of your heart health with our advanced predictive analytics. Early detection can save lives.</p>
            <div>
                <a href="#prediction" class="btn">Get Started</a>
                <a href="#about" class="btn btn-outline">Learn More</a>
            </div>
        </div>
    </section>

    <!-- About Section -->
    <section class="about" id="about">
        <div class="container">
            <div class="section-title animate">
                <h2>About Our Project</h2>
                <p>Using advanced machine learning algorithms to predict heart disease risk based on medical parameters.</p>
            </div>
            <div class="about-content">
                <div class="about-image animate">
                    <img src="/api/placeholder/600/400" alt="Heart Health" />
                </div>
                <div class="about-text animate">
                    <h3>Why Heart Disease Prediction Matters</h3>
                    <p>Cardiovascular diseases are the number one cause of death globally. Early detection and prevention can significantly reduce the risk of heart-related complications.</p>
                    <p>Our machine learning model analyzes various health parameters to assess your risk of heart disease, enabling you to take proactive measures for your heart health.</p>
                    <div class="features">
                        <div class="feature">
                            <div class="feature-icon">
                                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                    <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>
                                </svg>
                            </div>
                            <div class="feature-text">
                                <h4>Early Detection</h4>
                                <p>Identify potential heart problems before they become serious.</p>
                            </div>
                        </div>
                        <div class="feature">
                            <div class="feature-icon">
                                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                    <path d="M22 12h-4l-3 9L9 3l-3 9H2"></path>
                                </svg>
                            </div>
                            <div class="feature-text">
                                <h4>Risk Assessment</h4>
                                <p>Get personalized risk assessment based on your health data.</p>
                            </div>
                        </div>
                        <div class="feature">
                            <div class="feature-icon">
                                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                    <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
                                </svg>
                            </div>
                            <div class="feature-text">
                                <h4>Preventive Measures</h4>
                                <p>Take informed actions to protect your heart health.</p>
                            </div>
                        </div>
                        <div class="feature">
                            <div class="feature-icon">
                                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                    <circle cx="12" cy="12" r="10"></circle>
                                    <line x1="12" y1="8" x2="12" y2="12"></line>
                                    <line x1="12" y1="16" x2="12" y2="16"></line>
                                </svg>
                            </div>
                            <div class="feature-text">
                                <h4>Health Awareness</h4>
                                <p>Better understand factors affecting your heart health.</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Prediction Section -->
    <section class="prediction" id="prediction">
        <div class="container">
            <div class="section-title animate">
                <h2>Heart Disease Prediction</h2>
                <p>Enter your health parameters below to get a heart disease risk assessment.</p>
            </div>
            <div class="form-container animate">
                <div class="form-title">
                    <h3>Enter Your Health Parameters</h3>
                </div>
                <form action="/predict" method="post">
                    <div class="form-group">
                        <div class="input-group">
                            <label for="age">Age</label>
                            <span class="hint">Enter your age in years</span>
                            <input type="number" step="0.01" name="age" id="age" required>
                        </div>
                        <div class="input-group">
                            <label for="sex">Sex</label>
                            <span class="hint">Male = 1, Female = 0</span>
                            <select name="sex" id="sex" required>
                                <option value="">Select</option>
                                <option value="1">Male</option>
                                <option value="0">Female</option>
                            </select>
                        </div>
                        <div class="input-group">
                            <label for="cp">Chest Pain Type</label>
                            <span class="hint">0 to 3</span>
                            <select name="cp" id="cp" required>
                                <option value="">Select</option>
                                <option value="0">Typical Angina (0)</option>
                                <option value="1">Atypical Angina (1)</option>
                                <option value="2">Non-anginal Pain (2)</option>
                                <option value="3">Asymptomatic (3)</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="input-group">
                            <label for="trestbps">Resting Blood Pressure</label>
                            <span class="hint">In mm Hg</span>
                            <input type="number" step="0.01" name="trestbps" id="trestbps" required>
                        </div>
                        <div class="input-group">
                            <label for="chol">Cholesterol</label>
                            <span class="hint">In mg/dl</span>
                            <input type="number" step="0.01" name="chol" id="chol" required>
                        </div>
                        <div class="input-group">
                            <label for="fbs">Fasting Blood Sugar</label>
                            <span class="hint">Above 120 mg/dl = 1, Below = 0</span>
                            <select name="fbs" id="fbs" required>
                                <option value="">Select</option>
                                <option value="1">Yes (>120 mg/dl)</option>
                                <option value="0">No (≤120 mg/dl)</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="input-group">
                            <label for="restecg">Resting ECG Results</label>
                            <span class="hint">0 to 2</span>
                            <select name="restecg" id="restecg" required>
                                <option value="">Select</option>
                                <option value="0">Normal (0)</option>
                                <option value="1">ST-T Wave Abnormality (1)</option>
                                <option value="2">Left Ventricular Hypertrophy (2)</option>
                            </select>
                        </div>
                        <div class="input-group">
                            <label for="thalach">Maximum Heart Rate</label>
                            <span class="hint">Achieved during exercise</span>
                            <input type="number" step="0.01" name="thalach" id="thalach" required>
                        </div>
                        <div class="input-group">
                            <label for="exang">Exercise Induced Angina</label>
                            <span class="hint">Yes = 1, No = 0</span>
                            <select name="exang" id="exang" required>
                                <option value="">Select</option>
                                <option value="1">Yes</option>
                                <option value="0">No</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="input-group">
                            <label for="oldpeak">ST Depression</label>
                            <span class="hint">Induced by exercise relative to rest</span>
                            <input type="number" step="0.01" name="oldpeak" id="oldpeak" required>
                        </div>
                        <div class="input-group">
                            <label for="slope">Slope of Peak Exercise ST</label>
                            <span class="hint">0 to 2</span>
                            <select name="slope" id="slope" required>
                                <option value="">Select</option>
                                <option value="0">Upsloping (0)</option>
                                <option value="1">Flat (1)</option>
                                <option value="2">Downsloping (2)</option>
                            </select>
                        </div>
                        <div class="input-group">
                            <label for="ca">Number of Major Vessels</label>
                            <span class="hint">Colored by fluoroscopy (0-3)</span>
                            <select name="ca" id="ca" required>
                                <option value="">Select</option>
                                <option value="0">0</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="input-group">
                            <label for="thal">Thalassemia</label>
                            <span class="hint">1 = Normal, 2 = Fixed Defect, 3 = Reversible Defect</span>
                            <select name="thal" id="thal" required>
                                <option value="">Select</option>
                                <option value="1">Normal (1)</option>
                                <option value="2">Fixed Defect (2)</option>
                                <option value="3">Reversible Defect (3)</option>
                            </select>
                        </div>


complete this code