:global(:root) {
  --bg-primary: #131314;
  --bg-secondary: #1e1f20;
  --bg-border: #36393d;
  --bg-button: #3d4145;
  --bg-button-hover: #585f67;
  --text-primary: #f0f0f0;
  --text-muted: #ccc;
  --accent-green: #82c997;
  --accent-blue: #7fb9e8;
  --accent-dark-blue: #1d78bd;
  --accent-link: #a5b8c4;
  --resizer-line-width: 2px;
  --resizer-line-width-active: 6px;
}

:global(body) {
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  overflow: hidden;
}

.app {
  height: 100vh;
  width: 100vw;
}

.splashContainer {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.dropZone {
  border: 2px dashed var(--bg-border);
  border-radius: 8px;
  padding: 4rem 6rem;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;

  &.active,
  &:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-blue);
  }

  h2,
  p {
    pointer-events: none;
    margin: 0;
  }
  h2 {
    margin-bottom: 0.5rem;
  }
  p {
    color: var(--text-muted);
  }
}

input[type="file"] {
  display: none;
}

.mainLayout {
  width: 100%;
  height: 100%;
  display: grid;
  position: relative;
  grid-template-areas: "panel main";

  .resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--resizer-line-width-active);
    cursor: col-resize;
    transform: translateX(-50%);
    z-index: 10;
    user-select: none;

    &::after {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: var(--resizer-line-width);
      transform: translateX(-50%);
      background-color: var(--bg-border);
      transition:
        background-color 0.2s ease,
        width 0.2s ease;
    }

    &:hover::after, &:active::after {
      background-color: var(--accent-dark-blue);
      width: var(--resizer-line-width-active);
    }
  }

  &.mobile {
    grid-template-areas:
      "main"
      "panel";

    .resizer {
      top: auto;
      left: 0;
      right: 0;
      width: 100%;
      height: var(--resizer-line-width-active);
      cursor: row-resize;
      transform: translateY(-50%);

      &::after {
        top: 50%;
        bottom: auto;
        left: 0;
        right: 0;
        height: var(--resizer-line-width);
        width: 100%;
        transform: translateY(-50%);
      }

      &:hover::after, &:active::after {
        width: 100%;
        height: var(--resizer-line-width-active);
      }
    }
  }
}

.panel {
  grid-area: panel;
  background-color: var(--bg-primary);
  padding: 1rem;
  overflow-y: auto;
}

.svgContainer {
  grid-area: main;
  width: 100%;
  height: 100%;
  background-color: var(--bg-secondary);
  min-height: 0;

  svg {
    width: 100%;
    height: 100%;
  }
}

.urlLoader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;

  p {
    margin: 0;
    color: var(--text-muted);
  }

  input[type="text"] {
    background-color: var(--bg-secondary);
    border: 1px solid var(--bg-border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    width: 300px;
  }

  button {
    background: var(--bg-button);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 14px;
    border: none;
    &:hover {
      background: var(--bg-button-hover);
    }
  }
}

@supports selector(::-webkit-scrollbar) {
  // fix ugly chrome scrollbar
  *::-webkit-scrollbar-track {
    border-radius:  4px;
    background-color: var(--bg-border);
  }

  *::-webkit-scrollbar {
    width: 4px;
    background-color: var(--bg-button);
  }

  *::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: var(--bg-button-hover);
  }
}