/* style.css */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&display=swap");
:root {
  --color-bg: #151414;
  --color-fg: #e9e9e9;
  --color-border: #3e3e3e;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-muted: #64748b;
  --color-muted-2: #97bfe6;
  --radius: 0.75rem;
  --font: "Roboto", sans-serif;
  --font-size: calc(14px + 0.2vw);
  --font-size-label: calc(12px + 0.2vw);
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-fg);
  margin: 0;
  padding: 1rem 2rem 2rem 2rem;
  line-height: 1.6;
  box-sizing: border-box;
  font-size: var(--font-size);
  color-scheme: dark;
}

h1,
h2,
h3 {
  font-weight: 600;
  margin: 0.5rem;
  color: var(--color-fg);
}

h4 {
  font-weight: 600;
  margin: 0rem;
  color: var(--color-fg);
}

h1 {
  font-size: 1.2rem;
}

h2 {
  font-size: 1.25rem;
}

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

#floating-buttons {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
  max-height: 80vh;
}

#nodes-index {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1rem;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#nodes-index h4 {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--color-fg);
}

.node-index {
  display: block;
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
  color: var(--color-fg);
  font-size: 0.875rem;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background-color 0.2s;
}


.node-index:hover {
  background-color: var(--color-primary);
}

.node-index.active {
  background-color: var(--color-primary);
  font-weight: 600;
  color: var(--color-fg);
}

#tree-container {
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
  max-width: 60vw;
}

input,
textarea {
  width: 100%;
  padding: 1rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--font-size);
  background-color: var(--color-bg);
  color: var(--color-fg);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 1rem;
  font-family: var(--font);
  box-sizing: border-box;
}

input:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  outline: none;
}

label {
  font-size: var(--font-size-label);
  font-weight: 500;
  color: var(--color-muted);
  display: block;
  margin-bottom: 0.25rem;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: var(--color-primary-hover);
}

button.delete-option {
  background-color: #270000;
  border: 1px solid var(--color-border);
  margin-left: 0.5rem;
  color: var(--color-fg);
}

button.delete-option:hover {
  background-color: #dc2626;
}

.node {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.node-header code {
  color: var(--color-muted-2);
  padding: 0.25rem 0.5rem;
}

.node-header button {
  background: #0f172a;
  border: none;
  cursor: pointer;
}

.node-message {
  width: 100%;
  resize: vertical;
  margin-top: 0.5rem;
  font-family: var(--font);
}
.options {
  margin-top: 0.2rem;
}

.option-box {
  background-color: var(--color-bg);
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

form {
  background-color: var(--color-bg);
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-top: 2rem;
}

select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: var(--font-size);
  background-color: var(--color-bg);
  color: var(--color-fg);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 1rem;
  font-family: var(--font);
  box-sizing: border-box;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}

dialog {
  border: none;
  border-radius: 0.75rem;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  background-color: var(--color-bg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  font-family: system-ui, sans-serif;
  animation: fadeIn 0.2s ease-in-out;
}

dialog h2 {
  margin-top: 0;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--color-fg);
}

.close-dialog {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #334155;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.close-dialog:hover {
  color: #0f172a;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .node,
  form {
    padding: 1rem;
  }

  input,
  textarea {
    font-size: 0.875rem;
  }

  button {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }

  #tree-container {
    grid-template-columns: 1fr;
  }
}
