* {
  margin: 0;
  padding: 0;
  color: white;
  code {
    font-size: 1.2em;
    padding: 3px 8px 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    outline: 1px solid rgba(255, 255, 255, 0.7);
  }
  button {
    font-size: 1.5em;
    background: rgba(255, 255, 255, 0.3);
    outline: 2px solid rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
  }
  select {
    color: black;
  }
}

*:not(code) {
  font-family: "Poppins", sans-serif;
}

body {
  height: 100vh;
  background-color: rgba(200, 0, 0, 0.4);
  div.resolution {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 450px;
    outline: 2px solid white;
    border-radius: 10px;
    background: #222222;
    > * {
      pointer-events: all;
      margin: 10px;
      padding: 10px;
      text-align: center;
      font-weight: 300;
      div.select_resolution {
        code:first-child {
          font-weight: 900;
        }
        input[type="text"] {
          width: 60px;
          color: black;
        }
        > * {
          margin: 10px;
        }
      }
    }
    h3 {
      font-weight: 300;
    }
    div.field_selector_box {
      margin: 0;
      padding: 0;
      width: 600px;
      display: flex;
      height: 50px;
      justify-content: center;
      div.field_selector {
        position: relative;
        width: 120px;
        height: 50px;
        background: #222222;
        border-radius: 10px;
        outline: 2px solid white;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        flex-direction: row;
        code {
          width: 60px;
          height: 50px;
          outline: none;
          border-radius: 0;
          display: flex;
          justify-content: center;
          align-items: center;
          padding: 0;
          font-size: 1.5em;
          cursor: pointer;
          transition: all 0.3s ease-in-out;
          &.active {
            background: rgb(50, 200, 50);
          }
          &:first-child {
            border-radius: 10px 0 0 10px;
          }
          &:last-child {
            border-radius: 0 10px 10px 0;
          }
        }
      }
    }
  }
  canvas#canvas {
    position: absolute;
    top: 0;
    z-index: 1;
  }
  > div {
    z-index: 4;
  }

  div#python_menu_box {
    position: absolute;
    backdrop-filter: none;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    &.active {
      pointer-events: all;
      backdrop-filter: blur(2px);
      div#toggle_python_menu {
        filter: blur(2px);
        pointer-events: none;
      }
      div#python_menu_content {
        display: flex;
        align-items: center;
        flex-direction: column;
        div.body {
          min-height: 300px;
          min-width: 300px;
          display: flex;
          justify-content: center;
          align-items: center;
          textarea {
            min-height: 200px;
            min-width: 500px;
            background: transparent;
            outline: solid white;
          }
        }
      }
    }
    div#toggle_python_menu {
      position: absolute;
      top: 0;
      right: 0;
      width: 150px;
      height: 50px;
      background-color: #222222;
      border-radius: 0 0 0 10px;
      outline: 1px solid white;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      pointer-events: all;
      h3 {
        font-size: 1.3em;
        font-weight: 400;
      }
    }
    div#python_menu_content {
      backdrop-filter: none;
      display: none;
      position: absolute;
      width: 800px;
      min-height: 500px;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background-color: #222222;
      border-radius: 10px;
      outline: 1px solid white;
      * {
        font-weight: 400;
      }
      div.header {
        text-align: center;
        margin: 20px;
      }
    }
  }
  div.greeterbox,
  div.settingsbox {
    width: 100vw;
    height: 100vh;
    display: none;
    pointer-events: none;
    position: absolute;
    top: 0;
    &.active {
      display: flex;
      justify-content: center;
      align-items: center;
      backdrop-filter: blur(2px);
    }
    > div {
      pointer-events: all;
      position: absolute;

      outline: solid;
      color: white;
      background: #222222;
      border-radius: 10px;
    }
  }
  div.greeterbox {
    div.greeter {
      width: 800px;
      max-height: 600px;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      overflow-y: auto;
      div.header {
        margin: 20px;
        text-align: center;
        h1,
        h3 {
          font-weight: 300;
        }
        h1 {
          font-size: 2.5em;
        }
      }
      div {
        margin: 10px;
        text-align: center;
        h1,
        h2 {
          font-weight: 300;
        }
      }
    }
    div.footer {
      text-align: center;
    }
  }
  div#shape_box {
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    user-select: none;
    position: absolute;
    top: 0;
    left: 0;
    h2#shape_button {
      position: absolute;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      font-size: 1.5em;
      padding: 10px;
      background: #222222;
      outline: solid white;
      border-radius: 0 0 5px 5px;
      pointer-events: all;
      cursor: pointer;
      font-weight: 300;
    }
    div#shape_menu {
      display: none;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      pointer-events: none;
      width: 820px;
      min-height: 780px;
      background: #222222;
      border-radius: 5px;
      outline: solid white;
    }
    &.active {
      backdrop-filter: blur(10px);
      h2#shape_button {
        filter: blur(10px);
      }
      div#shape_menu {
        display: block;
        pointer-events: all;
        div.header {
          text-align: center;
          margin: 10px;
          h2 {
            font-weight: 300;
          }
        }
        div.box {
          width: calc(100% - 20px);
          margin: 10px;
          height: 600px;
          display: flex;
          div.create_new_shape,
          div.list_existing_shapes {
            min-height: 400px;
            margin: 10px;
            width: calc(50% - 10px);
            > div.shape_list,
            > div.shape_list_new {
              border-radius: 5px;
              outline: 2px solid white;
              max-height: 80%;
              padding: 5px;
              overflow-y: scroll;
              div.shape {
                height: 50px;
                width: 350px;
                margin: 10px;
                border-radius: 5px;
                outline: 1px solid white;
                display: flex;
                align-items: center;
                justify-content: space-between;
                cursor: pointer;
                &.active div.edit_shape_menu {
                  display: block !important;
                }
                &.surface {
                  background-color: rgba(50, 200, 50, 0.2);
                }
                &.volume {
                  background-color: rgba(200, 50, 50, 0.2);
                }
                &.line {
                  background-color: rgba(50, 50, 200, 0.2);
                }
                div.shape_symbol {
                  width: 50px;
                  height: 50px;
                  border-radius: 5px 0 0 5px;
                  outline: 1px solid white;
                  background-color: rgba(
                    255,
                    255,
                    255,
                    0.1
                  );
                  &.sphere:before {
                    content: "";
                    display: block;
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                    background: white;
                    position: relative;
                    transform: translate(5px, 5px);
                  }
                  &.custom_sphere:before {
                    content: "";
                    display: block;
                    width: 40px;
                    height: 40px;
                    border-radius: 50%;
                    background: white;
                    position: relative;
                    transform: translate(5px, 5px);
                  }
                  &.hollow_sphere {
                    &:before {
                      content: "";
                      display: block;
                      width: 40px;
                      height: 40px;
                      border-radius: 50%;
                      outline: 1px solid white;
                      position: relative;
                      background: rgba(255, 255, 255, 0.7);
                      transform: translate(5px, 5px);
                    }
                    &:after {
                      content: "";
                      display: block;
                      width: 30px;
                      height: 30px;
                      border-radius: 50%;
                      outline: 1px solid white;
                      position: relative;
                      background: #432525;
                      transform: translate(10px, -30px);
                    }
                  }
                  &.cylinder {
                    &:before {
                      content: "";
                      display: block;
                      width: 30px;
                      height: 10px;
                      border-radius: 50%;
                      outline: 1px solid white;
                      background: rgba(255, 255, 255, 0.7);
                      position: relative;
                      transform: translate(10px, 10px);
                    }
                    &:after {
                      display: block;
                      content: "";
                      width: 30px;
                      height: 35px;
                      transform: translate(9px, 5px);
                      border-left: 1px solid white;
                      border-right: 1px solid white;
                      position: relative;
                      background: rgba(255, 255, 255, 0.5);
                    }
                  }
                  &.custom_cylinder {
                    &:before {
                      content: "";
                      display: block;
                      width: 30px;
                      height: 10px;
                      border-radius: 50%;
                      outline: 1px solid white;
                      background: rgba(255, 255, 255, 0.7);
                      position: relative;
                      transform: translate(10px, 10px);
                    }
                    &:after {
                      display: block;
                      content: "";
                      width: 30px;
                      height: 35px;
                      transform: translate(9px, 5px);
                      border-left: 1px solid white;
                      border-right: 1px solid white;
                      position: relative;
                      background: rgba(255, 255, 255, 0.5);
                    }
                  }
                  &.disc:before {
                    content: "";
                    display: block;
                    height: 30px;
                    width: 30px;
                    border-radius: 50%;
                    outline: 1px solid white;
                    transform: translate(10px, 10px);
                    background-color: rgba(
                      255,
                      255,
                      255,
                      0.5
                    );
                  }
                }
                h3 {
                  margin-left: 10px;
                  font-weight: 300;
                }
                div.delete_shape {
                  width: 50px;
                  height: 50px;
                  border-radius: 0 5px 5px 0;
                  background-color: rgba(
                    255,
                    255,
                    255,
                    0.1
                  );
                  display: flex;
                  justify-content: center;
                  align-items: center;
                  font-size: 1.5em;
                  &:hover {
                    background-color: rgba(
                      250,
                      50,
                      50,
                      0.4
                    );
                  }
                }
                div.edit {
                  width: 50px;
                  height: 50px;
                  border-radius: 0 5px 5px 0;
                  background-color: rgba(
                    255,
                    255,
                    255,
                    0.1
                  );
                  outline: 1px solid white;
                  svg {
                    transform: scale(0.8);
                  }
                  .edit_shape_menu {
                    display: none;
                    position: absolute;
                    min-width: 320px;
                    height: 210px;
                    overflow-y: scroll;
                    outline: solid white;
                    background: #222222;
                    transform: translate(60px, -60px);
                    border-radius: 5px;
                    div.body {
                      > div {
                        padding: 10px;
                        display: flex;
                        &.E_field,
                        &.B_field {
                          display: none;
                          &.active {
                            display: flex;
                          }
                        }
                        > p {
                          padding: 5px;
                        }
                        input[type="number"],
                        input[type="text"] {
                          background: rgba(
                            255,
                            255,
                            255,
                            0.1
                          );
                          border: none;
                          border-bottom: 1px solid;
                          &:focus-visible {
                            outline: none;
                          }
                        }
                      }
                    }
                    div.footer {
                      button {
                        margin: 10px;
                        padding: 2px;
                        font-size: 1em;
                      }
                    }
                  }
                }
              }
            }
          }
        }
        div.footer {
          width: 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          h2 {
            font-weight: 300;
            padding: 10px;
            margin: 15px;
            background-color: #222222;
            outline: 2px solid white;
            border-radius: 5px;
            cursor: pointer;
          }
        }
      }
    }
  }
}
