<?php

require_once __DIR__ . '/../vendor/autoload.php';

use PHPNative\Framework\Application;
use PHPNative\Ui\Window;
use PHPNative\Ui\Widget\Container;
use PHPNative\Ui\Widget\Label;

$app = new Application();
$window = new Window('Flex-Col Test', 800, 600);

// Main container mit flex-col
$mainContainer = new Container('flex flex-col p-4 bg-gray-100');

// Container 1 - Feste Höhe
$container1 = new Container('bg-red-500 h-20 p-4');
$label1 = new Label('Container 1 - Fixed Height (h-20)', 'text-white text-xl');
$container1->addComponent($label1);
$mainContainer->addComponent($container1);

// Container 2 - Mit flex-grow (sollte verfügbaren Platz einnehmen)
$container2 = new Container('flex-grow bg-blue-500 p-4');
$label2 = new Label('Container 2 - Flex Grow (flex-grow)', 'text-white text-xl');
$container2->addComponent($label2);
$mainContainer->addComponent($container2);

// Container 3 - Natürliche Höhe (basierend auf Inhalt)
$container3 = new Container('bg-green-500 p-4');
$label3 = new Label('Container 3 - Natural Height', 'text-white text-xl');
$container3->addComponent($label3);
$mainContainer->addComponent($container3);

$window->setRoot($mainContainer);
$app->addWindow($window);

echo "Flex-Col Test started!\n";
echo "- Red: Fixed height (80px)\n";
echo "- Blue: Should grow to fill available space\n";
echo "- Green: Natural height based on content\n\n";

$app->run();
