@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap');

:root {
  /* color-variables */
  --contrast-green: #50ff90;
  --contrast-grey: #1c1c1c;
  --contrast-red: #ee5040;

  --antiflash-white: #eef0f2;

  --secondary-grey: #272829;
  --secondary-grey-highlight: #313233;

  --main-bg: transparent;
  --header-bg: var(--contrast-grey);
  font-family: "Lexend", sans-serif;
  background-color: #3a3b3c;
}

html,
body {
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
}

/* --- SCROLLBAR RESKIN --- */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.35);
}

/* --- HEADER --- */

header {
  width: 100%;
  min-height: 50px;
  height: 50px;
  background: var(--contrast-grey);
  display: flex;
  align-items: center;
  justify-content: center;
}

header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}
header a {
  color: var(--contrast-green);
  font-weight: 600;
  text-decoration: none;
}
header a:hover {
  text-decoration: underline;
}

/* --- CONTAINER --- */
#root-container {
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
}
#root-container > aside {
  width: 25%;
  min-width: 14rem;
  height: 100%;
  background: #f4f4f4;
}

#root-container > main {
  flex: 1 1 auto; /* grow to fill, can shrink if needed */
  height: 100%;
  overflow: hidden; /* hide any overflow */
}

div.centered-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- EDITOR in Editor.css --- */

/* --- DIAGRAM --- */
#diagram-container {
  width: 100%;
  height: 100%;
}

#diagram-container > svg {
  outline: none;
}

/* --- CARD --- */
.card > p:nth-child(1) {
  font-weight: 600;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--contrast-green);
}

.card {
  background: var(--contrast-grey);
  color: var(--antiflash-white);

  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  border-radius: 8px;

  -webkit-box-shadow: 4px 5px 7px rgba(0, 0, 3, 0.2);
  -moz-box-shadow: 4px 5px 7px rgba(0, 0, 3, 0.2);
  box-shadow: 4px 5px 7px rgba(0, 0, 3, 0.2);
  height: 15em;
  width: 30em;
  padding: 1rem;
  margin: 1rem;

  -webkit-animation: scaleout 1s cubic-bezier(0.79, -0.01, 0.19, 0.65) forwards;
  -moz-animation: scaleout 1s cubic-bezier(0.79, -0.01, 0.19, 0.65) forwards;
  -o-animation: scaleout 1s cubic-bezier(0.79, -0.01, 0.19, 0.65) forwards;
  animation: scaleout 1s cubic-bezier(0.79, -0.01, 0.19, 0.65) forwards;
}

.card * {
  opacity: 0;
  -webkit-animation: fade-in-child 1s cubic-bezier(0.79, -0.01, 0.19, 0.65)
    forwards;
  -moz-animation: fade-in-child 1s cubic-bezier(0.79, -0.01, 0.19, 0.65)
    forwards;
  -o-animation: fade-in-child 1s cubic-bezier(0.79, -0.01, 0.19, 0.65) forwards;
  animation: fade-in-child 1s cubic-bezier(0.79, -0.01, 0.19, 0.65) forwards;
}

/* --- BUTTONS --- */

.btn {
  background: var(--contrast-green);
  text-decoration: none;
  color: var(--secondary-grey);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.35s ease-in-out;
}
.btn:hover {
  background: var(--secondary-grey);
  color: var(--contrast-green);
  transform: scale(1.05);
}

/* --- SPINNER --- */
.router-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--contrast-green);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 100px auto;
  display: block;
}

/* --- ANIMATIONS --- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade-in-child {
  0% {
    opacity: 0;
  }
  80% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes scaleout {
  0% {
    transform: scaleX(0.1) scaleY(0.1);
  }
  40% {
    transform: scaleX(1) scaleY(0.1);
  }
  80% {
  }
  100% {
    transform: scaleX(1) scaleY(1);
  }
}

/* --- PRINT: hide header --- */
@media print {
  header {
    display: none !important;
  }
}
@media screen and (max-width: 768px) {
  #root-container > aside,
  #root-container > main > * {
    display: none;
  }
  #root-container > main {
    display: block;
    background: var(--contrast-grey);
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    height: 50%;
    margin-top: 2em;
    padding: 2em;
    flex-grow: 1;
}
#root-container > main::after{
    color: var(--contrast-green);
    font-size: 1.6em;
    font-weight: 600;
    content: "Device is too small to display the editor.";
  }

  .card {
    width: 100%;
    text-overflow: ellipsis;
  }
}

@media screen and (max-width: 480px) {
  header {
    height: auto;
    padding: 0.5rem;
  }

  header a {
    font-size: 0.9rem;
  }
}
