{
  "Type": "Window",
  "Id": "event_log",
  "Title": "Events Log",
  "Icon": "\ud83d\udccb",
  "Classes": [
    "ps-window-holo"
  ],
  "State": "Maximized",
  "DisplayLocation": "Taskbar",
  "WindowGroup": "static_menu",
  "IsRestorable": false,
  "IsMinimizable": false,
  "Width": "100%",
  "Height": "100%",
  "Background": "rgba(0,0,0,0.85)",
  "Padding": "16",
  "Children": [
    {
      "Type": "Grid",
      "Id": "event_log_layout",
      "Width": "100%",
      "Height": "100%",
      "HorizontalAlignment": "Stretch",
      "VerticalAlignment": "Stretch",
      "ColumnDefinitions": [
        "1fr"
      ],
      "RowDefinitions": [
        "Auto",
        "1fr"
      ],
      "Gap": 12,
      "Children": [
        {
          "Type": "StackPanel",
          "Id": "event_log_filters",
          "Grid.Row": 0,
          "Grid.Column": 0,
          "Orientation": "Horizontal",
          "Gap": 12,
          "Height": "Auto",
          "Children": [
            {
              "Type": "Select",
              "Id": "event_log_category_filter",
              "Width": "160px",
              "Placeholder": "All Categories",
              "Command": "core.event_log.set_filter",
              "Options": [
                {
                  "Value": "All",
                  "Label": "All"
                },
                {
                  "Value": "PopProduction",
                  "Label": "Production"
                },
                {
                  "Value": "Commander",
                  "Label": "Commander"
                },
                {
                  "Value": "PopMining",
                  "Label": "Mining"
                },
                {
                  "Value": "PopEnvironment",
                  "Label": "Environment"
                },
                {
                  "Value": "PopShipbuilding",
                  "Label": "Shipbuilding"
                },
                {
                  "Value": "PopGroundUnits",
                  "Label": "Ground Units"
                },
                {
                  "Value": "PopResearch",
                  "Label": "Research"
                },
                {
                  "Value": "CombatResults",
                  "Label": "Combat Results"
                },
                {
                  "Value": "Ship",
                  "Label": "Ship"
                },
                {
                  "Value": "Fleet",
                  "Label": "Fleet"
                },
                {
                  "Value": "JumpPoint",
                  "Label": "Jump Point"
                },
                {
                  "Value": "System",
                  "Label": "System"
                },
                {
                  "Value": "PopSummary",
                  "Label": "Summary"
                },
                {
                  "Value": "Intelligence",
                  "Label": "Intelligence"
                },
                {
                  "Value": "MissileSalvo",
                  "Label": "Missile Salvo"
                },
                {
                  "Value": "Combat",
                  "Label": "Combat"
                },
                {
                  "Value": "SYUpgrade",
                  "Label": "SY Upgrade"
                },
                {
                  "Value": "Diplomacy",
                  "Label": "Diplomacy"
                }
              ]
            },
            {
              "Type": "Select",
              "Id": "event_log_time_filter",
              "Width": "130px",
              "Placeholder": "All Time",
              "Command": "core.event_log.set_filter",
              "Options": [
                {
                  "Value": "all",
                  "Label": "All Time"
                },
                {
                  "Value": "5m",
                  "Label": "Last 5 min"
                },
                {
                  "Value": "15m",
                  "Label": "Last 15 min"
                },
                {
                  "Value": "1h",
                  "Label": "Last 1 hour"
                },
                {
                  "Value": "6h",
                  "Label": "Last 6 hours"
                },
                {
                  "Value": "24h",
                  "Label": "Last 24 hours"
                },
                {
                  "Value": "7d",
                  "Label": "Last 7 days"
                },
                {
                  "Value": "30d",
                  "Label": "Last 30 days"
                }
              ]
            },
            {
              "Type": "Input",
              "Id": "event_log_search",
              "Width": "260px",
              "Placeholder": "Search events...",
              "CommitOnInput": true,
              "ShowClearButton": true,
              "Command": "core.event_log.search_input"
            },
            {
              "Type": "Checkbox",
              "Id": "event_log_show_hidden",
              "Label": "Show Hidden",
              "IsChecked": false,
              "Command": "core.event_log.toggle_show_hidden"
            },
            {
              "Type": "Checkbox",
              "Id": "event_log_auto_scroll",
              "Label": "Auto-scroll",
              "IsChecked": true,
              "Command": "core.event_log.toggle_auto_scroll"
            }
          ]
        },
        {
          "Type": "DataGrid",
          "Id": "event_log_grid",
          "Classes": [
            "ps-grid--event-log"
          ],
          "Grid.Row": 1,
          "Grid.Column": 0,
          "Width": "100%",
          "Height": "100%",
          "SelectionMode": "Single",
          "OnSelectionChanged": "core.event_log.select_row",
          "HeadersVisible": true,
          "EnableVerticalScroll": true,
          "UseZebraStriping": false,
          "AllowSorting": true,
          "AutoScrollToEnd": true,
          "AutoScrollToggleCommand": "core.event_log.toggle_auto_scroll",
          "FooterLeftText": "",
          "Columns": [
            {
              "Header": "Race",
              "Field": "race",
              "Width": "auto"
            },
            {
              "Header": "Type",
              "Field": "type",
              "Width": "auto"
            },
            {
              "Header": "System",
              "Field": "system",
              "Width": "auto"
            },
            {
              "Header": "Time",
              "Field": "time",
              "Width": "auto"
            },
            {
              "Header": "Message",
              "Field": "message",
              "Flex": 1
            }
          ],
          "Rows": []
        },
        {
          "Type": "Modal",
          "Id": "event_log_color_modal",
          "Title": "Customize Event Colors",
          "IsVisible": false,
          "CloseOnEscape": true,
          "CloseOnBackdropClick": true,
          "CloseCommand": "core.event_log.close_color_picker",
          "DisplayMode": "Glow",
          "AccentVariant": "accent",
          "BadgeText": "Event Log",
          "BadgeVariant": "accent",
          "Children": [
            {
              "Type": "StackPanel",
              "Orientation": "Vertical",
              "Gap": 12,
              "Children": [
                {
                  "Type": "Label",
                  "Id": "event_log_color_modal_event_type",
                  "Text": "",
                  "Style": "Label.Subheading"
                },
                {
                  "Type": "Label",
                  "Id": "event_log_color_modal_hint",
                  "Text": "Custom colors apply only to this event type for your player profile.",
                  "Style": "Label.Small"
                },
                {
                  "Type": "StackPanel",
                  "Id": "event_log_color_modal_bg_row",
                  "Orientation": "Horizontal",
                  "Gap": 12,
                  "Children": [
                    {
                      "Type": "Label",
                      "Id": "event_log_color_modal_bg_label",
                      "Text": "Background",
                      "Width": "100px",
                      "VerticalAlignment": "Center"
                    },
                    {
                      "Type": "Input",
                      "Id": "event_log_color_bg_input",
                      "InputType": "color",
                      "Value": "#0b0d16",
                      "Width": "120px",
                      "AutoFocus": true,
                      "CommitOnInput": true,
                      "Command": "core.event_log.set_color_draft"
                    }
                  ]
                },
                {
                  "Type": "StackPanel",
                  "Id": "event_log_color_modal_fg_row",
                  "Orientation": "Horizontal",
                  "Gap": 12,
                  "Children": [
                    {
                      "Type": "Label",
                      "Id": "event_log_color_modal_fg_label",
                      "Text": "Text",
                      "Width": "100px",
                      "VerticalAlignment": "Center"
                    },
                    {
                      "Type": "Input",
                      "Id": "event_log_color_fg_input",
                      "InputType": "color",
                      "Value": "#e2e6f0",
                      "Width": "120px",
                      "CommitOnInput": true,
                      "Command": "core.event_log.set_color_draft"
                    }
                  ]
                }
              ]
            }
          ],
          "FooterChildren": [
            {
              "Type": "Grid",
              "ColumnDefinitions": [
                "Auto",
                "1fr"
              ],
              "Children": [
                {
                  "Type": "Button",
                  "Id": "event_log_color_reset_btn",
                  "Grid.Column": 0,
                  "Text": "Reset",
                  "Command": "core.event_log.reset_color"
                },
                {
                  "Type": "StackPanel",
                  "Grid.Column": 1,
                  "Orientation": "Horizontal",
                  "HorizontalAlignment": "Right",
                  "Gap": 8,
                  "Children": [
                    {
                      "Type": "Button",
                      "Id": "event_log_color_apply_btn",
                      "Text": "Apply",
                      "Style": "Primary",
                      "Command": "core.event_log.apply_color_picker"
                    },
                    {
                      "Type": "Button",
                      "Id": "event_log_color_cancel_btn",
                      "Text": "Cancel",
                      "Command": "core.event_log.close_color_picker"
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
