:root {
  --dimmed: 0.7;
  --nav-bar-height: 74px;
  --white: whitesmoke;
  --primary: #858d3f;
  /* --secondary: #473f8d; */
  /* --secondary: #064D94; */
  --secondary: #074d93;
  --teal: teal;
  --board-background: #3f5e8d;
  --bg: #8d6e3f;
  --bg-alt: #6a532f;
  --bg-active: #c6b79f;
  --bg-dark: #352a18;
  --dark-gray: #333;
  --darkest-gray: #222;
  --blackish: #111;
  --disabled-bg: #ccc;
  --disabled-fg: #666;
  --dimmed: dimgray;
  --success: #48a660;
  --info: #3f80c0;
  --warn: #ad921c;
  --error: #bf4240;
  --container-width: 100vw;
  --container-height: calc(100vh - var(--nav-bar-height));
}

.title-font {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 400;
  font-style: normal;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}


h1,
h2,
h3,
h4,
h5 {
  font-family: "Josefin Sans", sans-serif;
  font-weight: 400;
  font-style: italic;
}

*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: 'Ubuntu', sans-serif;
}

a {
  text-decoration: none;
  color: var(--white);
}

svg:focus-visible {
  outline: initial;
}

body {
  overflow: hidden;
}

#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  color: var(--white);
  font-family: 'Ubuntu', sans-serif;

  main {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;

    #overview {
      position: relative;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background-color: var(--board-background);

      &.panning {
        cursor: grabbing;
      }

      &:focus {
        outline: none;
      }
    }

    #canvas {
      outline: none;
      border: none;
      position: absolute;
      top: 0;
      left: 0;
      pointer-events: all;

      &:focus {
        outline: none;
        border: none;
      }
    }

    #node-container {
      position: absolute;
      top: 0;
      left: 0;
      width: var(--container-width);
      height: var(--container-height);
      transform-origin: left top;

      &.zooming {
        .node-view {
          cursor: zoom-out;
        }
      }

      .grayout {
        filter: grayscale(80%);

        &:hover {
          filter: unset;
        }
      }
    }
  }
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.gap-md {
  gap: 1em;
}

.ml-2 {
  margin-left: 2em;
}

.gap-sm {
  gap: 0.5em;
}

.align-center {
  align-items: center;
}

.space-between {
  justify-content: space-between;
}

.cursor-pointer {
  cursor: pointer;
}

.button {
  font-size: 1em;
  color: var(--white);
  cursor: pointer;
  border: 1px solid black;
  transition: transform 0.2s ease;

  &.squared {
    padding: 5px 8px;
    border-radius: 5px;
    display: flex;
    gap: 0.4em;
    align-items: center;

    .left-icon {
      width: 1em;
      display: flex;
      justify-content: center;
      align-items: center;

      svg {
        display: block;
        width: 90%;
        height: 90%;
      }
    }
  }

  &.rounded {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    min-width: 2em;
    width: 2em;
    min-height: 2em;
    height: 2em;
    border-radius: 50%;

    &:focus-within {
      outline: unset;
    }

    &.primary svg {
      color: var(--darkest-gray);
    }

    svg {
      display: inline-block;
      min-width: 1.2em;
      min-height: 1.2em;
      width: 1.2em;
      height: 1.2em;
      max-width: 1.2em;
      max-height: 1.2em;
      
    }
  }

  &.rounded-expandable {
    overflow: hidden;
    display: flex;
    align-items: center;
    flex-direction: row;
    border-radius: 50%;
    gap: 0;
    transition: all 300ms ease;

    .expandable-text {
      white-space: nowrap;
      overflow: hidden;
      max-width: 0;
      transition: all 300ms ease-out;
    }

    &:active {
      transform: scale(1.03);
      filter: contrast(1.5);
    }

    &.expanded {
      border-radius: 0.5em;
      gap: 0.3em;

      .expandable-text {
        max-width: 300px;
        margin-right: 0.4em;
      }
    }

    &.collapsed {
      border-radius: 50%;
      gap: 0;

      .expandable-text {
        max-width: 0;
        margin-right: 0;
      }
    }

    .svg-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 2em;
      height: 2em;

      svg {
        display: block;
        width: 1.2em;
        height: 1.2em;
        color: var(--darkest-gray);
      }
    }

    &.info svg,
    &.neutral svg {
      color: unset;
    }
  }

  &.shadow {
    box-shadow: 1px 1px 6px #1f291f;
  }

  &:hover {
    transform: scale(1.03);
  }

  &.primary {
    background-color: var(--primary);

    .left-icon svg {
      color: var(--blackish);
    }
  }

  &.secondary {
    background-color: var(--secondary);

    svg {
      color: var(--blackish);
    }
  }

  &.alert {
    background-color: var(--error);

    svg {
      color: var(--darkest-gray);
    }
  }

  &.warning {
    background-color: var(--warn);

    svg {
      color: var(--darkest-gray);
    }
  }

  &.select {
    background-color: var(--teal);

    svg {
      color: var(--blackish);
    }
  }

  &.info,
  &.neutral {
    background-color: var(--darkest-gray);
  }

  &:disabled {
    cursor: default;
    color: var(--disabled-fg);
    background-color: var(--disabled-bg);
    user-select: none;

    &:hover {
      transform: unset;
      filter: unset;
    }
  }
}

.divider {
  margin-top: 1em;
  margin-bottom: 1em;
  background: #584527;
  height: 1px;
}

input {
  padding: 2px 4px;
  outline: 1px solid black;
  border: unset;
  border-bottom-left-radius: 5px;
  border-top-right-radius: 5px;

  &:focus {
    box-shadow: 1px 1px 6px 0px black;
  }
}

ul {
  list-style: none;
}

.selected-point {
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 0.5em;
  border-radius: 50%;
  color: black;
}

&:disabled *,
&[disabled] * {
  cursor: default;
  color: var(--disabled-fg);
  background-color: var(--disabled-bg);
  user-select: none;
  pointer-events: none;
}
