/*
 * Copyright (c) 2025 Brian Kircher
 *
 * Open Source Software: you can modify and/or share it under the terms of the
 * BSD license file in the root directory of this project.
 */

body
{
  background-color: #000000;
  margin: 0;
  position: fixed;
}

.frame
{
  display: grid;
  grid-template-rows: 3em 1fr 3em;
  height: 100dvh;
  width: 100dvw;
}

#controls
{
  align-items: center;
  background-color: #000000;
  color: #ffffff;
  display: flex;
  grid-row: 1;
  overflow-x: scroll;
  width: 100%;

  button
  {
    background-color: #000000;
    border-color: #00ff00;
    border-width: 2px;
    color: #00ff00;
    height: 2em;
    margin: 0 0 0 10px;
    padding: 1px;
    width: 2em;

    i
    {
      font-size: 1.5em;
    }

    img
    {
      height: calc(2em - 6px);
      width: calc(2em - 6px);
    }
  }

  label
  {
    color: #00ff00;
    font-size: 1.5em;
    margin: 0 0 0 10px;
  }

  span
  {
    border-left: 1px solid #00ff00;
    height: 2em;
    margin: 0 0 0 10px;
  }
}

#content
{
  display: grid;
  grid-row: 2;
  grid-template-columns: 1fr 12px 1fr;
  overflow: hidden;

  #field
  {
    grid-column: 1;
    overflow: hidden;
    position: relative;

    #c_wall, #c_model, #c_game_piece
    {
      align-items: center;
      background-color: #ff0000;
      color: #ffffff;
      display: none;
      font-size: 1.5em;
      font-weight: bold;
      height: 2em;
      justify-content: center;
      position: absolute;
      width: 100%;
    }
  }

  #vsizer
  {
    background-color: #005f00;
    border-left: 2px solid #007f00;
    border-right: 2px solid #003f00;
    cursor: col-resize;
    grid-column: 2;
  }

  #dev
  {
    display: grid;
    flex: 1;
    grid-column: 3;
    grid-template-rows: 3fr 12px 1fr;
    height: 100%;
    overflow: hidden;
    width: 100%;

    #editor
    {
      display: grid;
      grid-row: 1;
      grid-template-rows: 2em 1fr;
      overflow: hidden;

      .nav
      {
        background-color: #001f00;
        display: flex;
        grid-row: 1;
        margin: 0;
        overflow-x: scroll;
        padding: 0;

        li
        {
          align-items: center;
          background-color: #001f00;
          border-left: 1px solid #007f00;
          border-right: 1px solid #007f00;
          border-bottom: 3px solid #00000000;
          color: #00bf00;
          display: flex;
          padding: 0 10px;

          button
          {
            background-color: #001f00;
            border: 0;
            color: #00bf00;
            margin: 0 5px;
            padding: 5px;

            &:hover
            {
              background-color: #3f3f3f;
            }
          }

          &.active
          {
            border-bottom: 3px solid #007f00;
            color: #00ff00;

            button
            {
              color: #00ff00;
            }
          }
        }
      }

      #ace_editor
      {
        grid-row: 2;
      }
    }

    #hsizer
    {
      background-color: #005f00;
      border-bottom: 2px solid #003f00;
      border-top: 2px solid #007f00;
      cursor: row-resize;
    }

    #console
    {
      background-color: #000000;
      color: #00ff00;
      display: grid;
      font: 12px monospace;
      grid-row: 3;
      grid-template-rows: 2em 1fr;
      overflow: hidden;

      #heading
      {
        align-items: center;
        background-color: #001f00;
        display: flex;
        grid-row: 1;
        padding: 0 10px;
      }

      #output
      {
        grid-row: 2;
        margin: 10px;
        overflow-y: scroll;

        p
        {
          margin: 0px;
        }
      }
    }
  }
}

#status
{
  align-items: center;
  background-color: #001f00;
  color: #00ff00;
  display: grid;
  grid-row: 3;
  grid-template-columns: repeat(7, 1fr);

  img
  {
    height: 2em;
    width: 2em;
    padding: 0 0.5em;
  }

  span
  {
    font-size: 1.5em;
  }

  .sensor
  {
    align-items: center;
    border: 1px solid #00ff00;
    display: flex;
    height: 2em;
    margin: 2px 4px;
    padding: 2px 4px;
  }

  .gyro
  {
    grid-column: 1;
  }

  .porta
  {
    grid-column: 2;
  }

  .portb
  {
    grid-column: 3;
  }

  .portc
  {
    grid-column: 4;
  }

  .portd
  {
    grid-column: 5;
  }

  .porte
  {
    grid-column: 6;
  }

  .portf
  {
    grid-column: 7;
  }
}

#forkme
{
  display: none;

  img
  {
    height: 124px;
    position: absolute;
    right: 0;
    top: 0;
    width: 124px;
    z-index: 10000;
  }
}

dialog
{
  background-color: #000000;
  border: 1px solid #00ff00;
  border-radius: 1em;
  color: #00ff00;
  max-height: 80%;
  max-width: 80%;
  overflow-y: scroll;
  padding: 1em;

  &::backdrop
  {
    background-color: #000000c0;
  }

  a
  {
    color: #00bf00;
    cursor: pointer;
    text-decoration: underline;
  }

  button
  {
    background-color: #000000;
    border-color: #00ff00;
    color: #00ff00;

    &:disabled
    {
      border-color: #007f00;
      color: #007f00;
    }
  }

  hr
  {
    border: 1px solid #00ff00;
  }

  select
  {
    background-color: #000000;
    border-color: #00ff00;
    color: #00ff00;
  }
}

#alert div,
#confirm div
{
  #message
  {
    display: block;
    text-align: center;
  }

  #buttons
  {
    margin-top: 1em;
    text-align: center;
  }
}

#config
{
  .heading
  {
    font-size: 1.5em;
  }

  br
  {
    clear: both;
  }

  #c_wall_yes, #c_model_yes, #c_game_piece_yes
  {
    border: 0;
    border-bottom: 2px solid #00ff00;
    border-right: 2px solid #00ff00;
    border-top: 2px solid #00ff00;
    color: #003f00;
    float: right;
    margin-bottom: 2px;
    transition: all 0.2s ease-in-out;
  }

  #c_wall_no, #c_model_no, #c_game_piece_no
  {
    border: 0;
    border-bottom: 2px solid #00ff00;
    border-left: 2px solid #00ff00;
    border-top: 2px solid #00ff00;
    color: #003f00;
    float: right;
    margin-bottom: 2px;
    transition: all 0.2s ease-in-out;
  }

  .selected
  {
    background-color: #00ff00;
    color: #000000;
  }
}

#about
{
  div
  {
    align-items: center;
    display: grid;
    grid-template-rows: 4em 2em 2em 2em;

    .title
    {
      font-size: 2em;
      font-weight: bold;
      grid-row: 1;
      text-align: center;
    }

    .copyright
    {
      grid-row: 2;
      text-align: center;
    }

    .powered
    {
      font-size: 1em;
      grid-row: 3;
      text-align: center;

      a
      {
        color: #3fbf3f;
      }
    }

    .buttons
    {
      display: flex;
      grid-row: 4;
      justify-content: center;

      button
      {
        background-color: #000000;
        border-color: #00ff00;
        color: #00ff00;
      }
    }
  }
}

.license
{
  hr
  {
    border: 1px solid #00ff00;
    margin: 0 0 1em 0;
  }

  p
  {
    margin: 0 0 1em 0;
  }
}

#load_progress
{
  border: 1px solid #00ff00;
  border-radius: 1em;
  padding: 1em;

  span
  {
    background-color: #00000000;
    border: 0;
    color: #00ff00;
    font-size: 3em;
    margin: 0;
    padding: 0;
  }
}

.popup
{
  div
  {
    display: grid;
    grid-template-rows: 1fr 1fr;

    .message
    {
      grid-row: 1;
    }

    .buttons
    {
      display: flex;
      grid-row: 2;
      justify-content: center;
      margin-top: 10px;

      .danger
      {
        background-color: #ff0000;
        color: #ffffff;
        margin: 0 10px;
      }

      .safe
      {
        background-color: #00ff00;
        color: #000000;
        margin: 0 10px;
      }
    }
  }
}