<?php
session_start();

$host = 'localhost';
$user = 'ahmeuesz_dino';
$pwd  = 'X39IW2ho3^5h6d_5';
$db   = 'ahmeuesz_myapp';

$conn = mysqli_connect($host, $user, $pwd, $db);

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $name = $_POST['name'];
    $_SESSION['name'] = $name;
    header('Location: form.html'); 
    exit();
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Login - Namaz Tracker</title>
    <link rel="stylesheet" href="style.css">
    <style>
        /* --- Modern YouTube Section --- */
        .youtube-section {
            margin-top: 60px;
            background: linear-gradient(135deg, #d9f2ff, #a6e1ff);
            padding: 25px;
            border-radius: 20px;
            box-shadow: 0 10px 25px rgba(0, 140, 255, 0.25);
            width: 420px;
            max-width: 90%;
            margin-left: auto;
            margin-right: auto;
            text-align: center;
            transition: all 0.3s ease;
        }

        .youtube-section:hover {
            transform: translateY(-4px);
            box-shadow: 0 14px 35px rgba(0, 150, 255, 0.35);
        }

        .youtube-section h3 {
            color: #004b8e;
            font-family: 'Poppins', sans-serif;
            margin-bottom: 20px;
            font-size: 1.4rem;
            letter-spacing: 0.5px;
        }

        .youtube-card iframe {
            width: 100%;
            height: 240px;
            border-radius: 16px;
            border: none;
            box-shadow: 0 8px 25px rgba(0, 128, 255, 0.3);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .youtube-card iframe:hover {
            transform: scale(1.03);
            box-shadow: 0 12px 35px rgba(0, 128, 255, 0.45);
        }
    </style>
</head>
<body>

    <div class="page-container">

        <div class="form-container">
            <h1>Login</h1>
            <form action="login.php" method="post">
                <label for="name">Enter Your Name:</label>
                <input type="text" name="name" id="name" required>
                <button type="submit">Login</button>
            </form>
        </div>

        <!-- YouTube Section -->
        <div class="youtube-section">
            <h3>📺 Watch Tutorial</h3>
            <div class="youtube-card">
                <iframe 
                    src="https://www.youtube.com/embed/0qXaYAMGmtk"
                    title="Tutorial"
                    frameborder="0"
                    allowfullscreen>
                </iframe>
            </div>
        </div>

    </div>

</body>
</html>
