<?php
// Dynamically generate UCF logo as PNG
header("Content-Type: image/png");

// Create image canvas
$width = 300;
$height = 100;
$image = imagecreatetruecolor($width, $height);

// Define colors
$bgColor   = imagecolorallocate($image, 255, 255, 255); // White background
$ucfGreen  = imagecolorallocate($image, 90, 139, 72);   // #5A8B48
$darkGreen = imagecolorallocate($image, 64, 109, 62);   // #406D3E

// Fill background
imagefilledrectangle($image, 0, 0, $width, $height, $bgColor);

// ✅ Path to font file (ensure it exists)
$font = __DIR__ . '/../fonts/Poppins-Bold.ttf';
if (!file_exists($font)) {
    // Fallback to a system font if not found
    $font = __DIR__ . '/../fonts/arial.ttf';
}

// Shadow / depth effect (slightly offset darker text)
imagettftext($image, 48, 0, 22, 70, $darkGreen, $font, "UCF");

// Foreground text in main color
imagettftext($image, 48, 0, 20, 68, $ucfGreen, $font, "UCF");

// Output PNG
imagepng($image);
imagedestroy($image);
?>
