change this style of codes (<?php
// File: doctors/add_health_record.php

session_start();
require_once '../db_connect.php';

// Ensure the doctor is logged in
if (!isset($_SESSION['doctor_id'])) {
    header("Location: login.php");
    exit();
}

$doctor_id = $_SESSION['doctor_id'];
$errors = [];

// Get the patient ID from GET parameters
$patient_id = isset($_GET['patient_id']) ? intval($_GET['patient_id']) : null;

if (!$patient_id) {
    echo "Invalid patient ID.";
    exit();
}

// Check if the doctor is associated with the patient
$relationship_stmt = $pdo->prepare("
    SELECT * FROM doctor_patient
    WHERE doctor_id = ? AND patient_id = ?
");
$relationship_stmt->execute([$doctor_id, $patient_id]);
$relationship = $relationship_stmt->fetch();

if (!$relationship) {
    echo "You are not authorized to add a health record for this patient.";
    exit();
}

// Initialize form variables
$blood_pressure = '';
$weight = '';
$bmi = '';
$cholesterol = '';
$prescription = '';
$treatment_progress = '';
$record_date = '';

if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    // Collect and sanitize inputs
    $blood_pressure = trim($_POST['blood_pressure']);
    $weight = trim($_POST['weight']);
    $bmi = trim($_POST['bmi']);
    $cholesterol = trim($_POST['cholesterol']);
    $prescription = trim($_POST['prescription']);
    $treatment_progress = trim($_POST['treatment_progress']);
    $record_date = trim($_POST['record_date']);

    // CSRF Protection
    if (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== $_SESSION['csrf_token']) {
        $errors[] = "Invalid CSRF token. Please try again.";
    }

    // Validate inputs
    if (empty($blood_pressure)) {
        $errors[] = "Blood pressure is required.";
    }

    if ($weight === '' || !is_numeric($weight) || $weight <= 0) {
        $errors[] = "Weight must be a positive number.";
    }

    if ($bmi === '' || !is_numeric($bmi) || $bmi <= 0) {
        $errors[] = "BMI must be a positive number.";
    }

    if ($cholesterol === '' || !is_numeric($cholesterol) || $cholesterol <= 0) {
        $errors[] = "Cholesterol level must be a positive number.";
    }

    if (empty($prescription)) {
        $errors[] = "Prescription is required.";
    }

    if (empty($treatment_progress)) {
        $errors[] = "Treatment progress notes are required.";
    }

    if (empty($record_date)) {
        $errors[] = "Record date is required.";
    } else {
        // Validate date format (YYYY-MM-DD)
        $d = DateTime::createFromFormat('Y-m-d', $record_date);
        if (!$d || $d->format('Y-m-d') !== $record_date) {
            $errors[] = "Invalid date format for record date.";
        }
    }

    if (empty($errors)) {
        // Insert the new health record
        $insert_stmt = $pdo->prepare("
            INSERT INTO health_records 
            (patient_id, blood_pressure, weight, bmi, cholesterol, prescription, treatment_progress, record_date)
            VALUES (?, ?, ?, ?, ?, ?, ?, ?)
        ");

        try {
            $insert_stmt->execute([
                $patient_id,
                $blood_pressure,
                $weight,
                $bmi,
                $cholesterol,
                $prescription,
                $treatment_progress,
                $record_date
            ]);

            // Redirect to patient's view page
            header("Location: view_patient.php?id=" . urlencode($patient_id) . "&msg=record_created");
            exit();

        } catch (PDOException $e) {
            // Log the error
            error_log("Database Insert Error: " . $e->getMessage());
            $errors[] = "Failed to add health record. Please try again.";
        }
    }
}

// Generate CSRF token
if (empty($_SESSION['csrf_token'])) {
    $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}
$csrf_token = $_SESSION['csrf_token'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Add Health Record - Patient ID <?= htmlspecialchars($patient_id) ?></title>
    <style>
        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            background-color: #eef2f3;
            padding: 40px;
            margin: 0;
        }
        .container {
            max-width: 800px;
            background: #ffffff;
            padding: 30px;
            margin: auto;
            border-radius: 10px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        }
        .header h2 {
            text-align: center;
            color: #2c3e50;
        }
        .error-messages {
            background: #f8d7da;
            color: #721c24;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 20px;
            border: 1px solid #f5c6cb;
        }
        .error-messages ul {
            list-style-type: square;
            padding-left: 20px;
            margin: 0;
        }
        .form-group {
            margin-bottom: 20px;
        }
        label {
            display: block;
            margin-bottom: 8px;
            color: #34495e;
        }
        input[type="text"],
        input[type="number"],
        input[type="date"],
        textarea {
            width: 100%;
            padding: 12px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            box-sizing: border-box;
        }
        textarea {
            resize: vertical;
        }
        input[type="submit"] {
            background: #3498db;
            color: #ffffff;
            border: none;
            padding: 14px 24px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        input[type="submit"]:hover {
            background: #2980b9;
        }
        .back-link {
            display: inline-block;
            margin-top: 20px;
            text-decoration: none;
            color: #3498db;
            font-weight: bold;
        }
        .back-link:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>Add Health Record for Patient ID <?= htmlspecialchars($patient_id) ?></h2>

        <?php if (!empty($errors)): ?>
            <div class="error-messages">
                <p>Please correct the following error(s):</p>
                <ul>
                    <?php foreach ($errors as $error): ?>
                        <li><?= htmlspecialchars($error) ?></li>
                    <?php endforeach; ?>
                </ul>
            </div>
        <?php endif; ?>

        <form method="POST" action="">
            <!-- CSRF Token -->
            <input type="hidden" name="csrf_token" value="<?= htmlspecialchars($csrf_token) ?>">

            <div class="form-group">
                <label for="blood_pressure">Blood Pressure:</label>
                <input type="text" id="blood_pressure" name="blood_pressure" value="<?= htmlspecialchars($blood_pressure) ?>" required>
            </div>
            <div class="form-group">
                <label for="weight">Weight (kg):</label>
                <input type="number" step="0.01" id="weight" name="weight" value="<?= htmlspecialchars($weight) ?>" required min="0">
            </div>
            <div class="form-group">
                <label for="bmi">BMI:</label>
                <input type="number" step="0.01" id="bmi" name="bmi" value="<?= htmlspecialchars($bmi) ?>" required min="0">
            </div>
            <div class="form-group">
                <label for="cholesterol">Cholesterol (mg/dL):</label>
                <input type="number" step="0.01" id="cholesterol" name="cholesterol" value="<?= htmlspecialchars($cholesterol) ?>" required min="0">
            </div>
            <div class="form-group">
                <label for="prescription">Prescription:</label>
                <textarea id="prescription" name="prescription" rows="4" required><?= htmlspecialchars($prescription) ?></textarea>
            </div>
            <div class="form-group">
                <label for="treatment_progress">Treatment Progress Notes:</label>
                <textarea id="treatment_progress" name="treatment_progress" rows="4" required><?= htmlspecialchars($treatment_progress) ?></textarea>
            </div>
            <div class="form-group">
                <label for="record_date">Record Date:</label>
                <input type="date" id="record_date" name="record_date" value="<?= htmlspecialchars($record_date) ?>" required>
            </div>
            <input type="submit" value="Add Health Record">
        </form>

        <a href="view_patient.php?id=<?= htmlspecialchars($patient_id) ?>" class="back-link">&larr; Back to Patient Record</a>
    </div>
</body>
</html>
)and use this styles (        /* Custom CSS for modern design */
        body {
            background-color: #f8f9fa;
            font-family: Arial, sans-serif;
        }

        .dashboard-header {
            background-color: #4F3F02; /* Brown color */
            color: #fff;
            padding: 20px;
            text-align: center;
            border-radius: 8px;
            margin-bottom: 30px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        h1, h2, h3 {
            font-weight: bold;
        }

        .btn-primary {
            background-color: #D1C287; /* Light golden color */
            border-color: #D1C287;
            color: #4F3F02; /* Brown color */
            font-weight: bold;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            border: none;
        }

        .btn-primary:hover {
            background-color: #4F3F02; /* Brown color */
            border-color: #D1C287;
            color: #fff;
        }

        .form-group {
            margin-bottom: 20px;
        }

        label {
            display: block;
            margin-bottom: 8px;
            color: #4F3F02; /* Brown color */
        }

        input[type="text"],
        input[type="number"],
        input[type="date"],
        textarea {
            width: 100%;
            padding: 12px;
            border: 1px solid #D1C287; /* Light golden */
            border-radius: 5px;
            box-sizing: border-box;
        }

        textarea {
            resize: vertical;
        }

        .error-messages {
            background: #f8d7da;
            color: #721c24;
            padding: 15px;
            border-radius: 5px;
            margin-bottom: 20px;
            border: 1px solid #f5c6cb;
        }

        .back-link {
            display: inline-block;
            margin-top: 20px;
            text-decoration: none;
            color: #D1C287; /* Light golden */
            font-weight: bold;
        }

        .back-link:hover {
            text-decoration: underline;
        }
    </style>
) and type full codes