<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<VBox minHeight="-Infinity" minWidth="-Infinity" spacing="20.0" style="-fx-font-size: 14px;" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.example.petshopdesktop.controllers.ProductController">
   <padding>
      <Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
   </padding>
   <children>
      <HBox alignment="CENTER_LEFT" prefHeight="100.0" prefWidth="200.0" spacing="20.0">
         <children>
            <Label text="Products" textFill="#2c3e50">
               <font>
                  <Font name="System Bold" size="30.0" />
               </font>
               <HBox.margin>
                  <Insets />
               </HBox.margin>
            </Label>
            <Region prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS" />
            <Button fx:id="btnAdd" mnemonicParsing="false" onAction="#btnAddClicked" style="-fx-background-color: #FF6b6b; -fx-cursor: hand; -fx-background-radius: 8;" text="Add New" textFill="WHITE">
               <font>
                  <Font name="System Bold" size="14.0" />
               </font>
               <padding>
                  <Insets bottom="12.0" left="24.0" right="24.0" top="12.0" />
               </padding>
            </Button>
            <Button fx:id="btnEdit" layoutX="391.0" layoutY="38.0" mnemonicParsing="false" onAction="#btnEditClicked" style="-fx-background-color: #4ECDC4; -fx-cursor: hand; -fx-background-radius: 8;" text="Edit" textFill="WHITE">
               <font>
                  <Font name="System Bold" size="14.0" />
               </font>
               <padding>
                  <Insets bottom="12.0" left="24.0" right="24.0" top="12.0" />
               </padding>
            </Button>
            <Button fx:id="btnDelete" layoutX="520.0" layoutY="38.0" mnemonicParsing="false" onAction="#btnDeleteClicked" style="-fx-background-color: #E74c3c; -fx-cursor: hand; -fx-background-radius: 8;" text="Delete" textFill="WHITE">
               <font>
                  <Font name="System Bold" size="14.0" />
               </font>
               <padding>
                  <Insets bottom="12.0" left="24.0" right="24.0" top="12.0" />
               </padding>
            </Button>
             <Button fx:id="btnRefresh" mnemonicParsing="false" onAction="#btnRefresh" style="-fx-background-color: #4ECDC4; -fx-cursor: hand; -fx-background-radius: 8;" text="Refresh" textFill="WHITE">
                <font>
                   <Font name="System Bold" size="14.0" />
                </font>
                <padding>
                   <Insets bottom="12.0" left="24.0" right="24.0" top="12.0" />
                </padding>
             </Button>
         </children>
      </HBox>
      <HBox alignment="CENTER_LEFT" prefHeight="37.0" prefWidth="727.0" spacing="10.0" style="-fx-background-color: white; -fx-background-radius: 14; -fx-border-width: 2; -fx-border-radius: 14;">
         <padding>
            <Insets bottom="10.0" left="15.0" right="15.0" top="10.0" />
         </padding>
         <children>
             <TextField fx:id="txtSearch" prefHeight="31.0" prefWidth="150.0" promptText="Search products..." style="-fx-border-width: 0; -fx-background-color: transparent;" HBox.hgrow="ALWAYS">
                <font>
                   <Font size="15.0" />
                </font>
             </TextField>
             <ComboBox fx:id="cbCategoryFilter" prefWidth="180.0" promptText="Category" />
          </children>
       </HBox>
       <Label fx:id="lblStatus" text="" textFill="#64748b" visible="false" managed="true">
          <font>
             <Font size="13.0" />
          </font>
       </Label>

      <TableView fx:id="tvProducts" prefHeight="362.0" prefWidth="752.0" style="-fx-background-color: white; -fx-background-radius: 12;" VBox.vgrow="ALWAYS">
        <columns>
           <TableColumn fx:id="colProductId" prefWidth="55.0" text="ID" />
             <TableColumn fx:id="colProductImage" prefWidth="80.0" text="Image" />
           <TableColumn fx:id="colProductName" prefWidth="150.0" text="Name" />
             <TableColumn fx:id="colProductCategory" prefWidth="160.0" text="Category" />
             <TableColumn fx:id="colProductDesc" prefWidth="195.0" text="Description" />
             <TableColumn fx:id="colProductPrice" prefWidth="110.0" text="Price" />
         </columns>
      </TableView>
   </children>
</VBox>
