:root {
  font-family: Inter, sans-serif;
  font-feature-settings: 'liga' 1, 'calt' 1; /* fix for Chrome */
  /* colors */
  --bg-color-secondary: #374151;
  --fg-color: #f9fafb;
  --link-color: #3b82f6;
  --danger-color: #dc2626;
  --info-color: #2563eb;
  --success-color: #22c55e;
  --warning-color: #eab308;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
  --color-gray-950: #030712;
  --color-red-50: #fef2f2;
  --color-red-100: #fee2e2;
  --color-red-200: #fecaca;
  --color-red-300: #fca5a5;
  --color-red-400: #f87171;
  --color-red-500: #ef4444;
  --color-red-600: #dc2626;
  --color-red-700: #b91c1c;
  --color-red-800: #991b1b;
  --color-red-900: #7f1d1d;
  --color-red-950: #450a0a;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;


  --neutral-50: #F8FAFC;

  --purple-600: #6839EE;

  --text-brand: #9B8AFB;
  --text-base: var(--neutral-50);
  --text-subtle: #CDD5DF;
  --bg-brand: var(--purple-600);
  --bg-base: #212A3A;
  --bg-container: #151B27;
  --bg-page: #10141F;

  --border-subtle: #212A3A;
  --border-base: #374152;
  --border-brand: var(--purple-600);

  --text-error: #F97066;
  --border-error: #F97066;

  /* breakpoints */
  --world-layout-breakpoint: 900px;
}

@supports (font-variation-settings: normal) {
    :root { font-family: InterVariable, sans-serif; }
}

html {
    height: 100%;
}

body {
    height: 100%;
    background-color: var(--bg-page);
    color: var(--text-base);
    margin: auto;
}

.container {
    margin-top: 1rem;
    padding: 1rem 0;
    width: min(95vw, 100rem);
    margin: auto;
}

/* alpine */
[x-cloak] {
    display: none !important;
}

/* htmx related styles */
.htmx-show {
    display: none;
}

.htmx-request.htmx-show {
    display: inline;
}

.htmx-request.htmx-hide {
    display: none !important;
}

.htmx-scroll-indicator {
    opacity: 0;
    margin-bottom: 5rem;
    transition: opacity 500ms ease-in;
}

.htmx-request.htmx-scroll-indicator {
    opacity: 1;
}

/* legacy layouts */
.row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.row.--wrap {
  flex-wrap: wrap;
}
.row.--spaced {
  justify-content: space-between;
}
.row .column {
  display: flex;
  flex-direction: row;
  align-items: center;
}

/* form styles */
label {
    display: block;
}

input,
select,
textarea {
    padding: 0.5rem;
    border-radius: 0.25rem;
    border-width: 0;
    background-color: var(--bg-color-secondary);
    color: var(--fg-color);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

/* text styles */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

.text-title {
    color: var(--text-base);

}
.text-title.--size-4 {
    font-size: 1rem;
    line-height: 1.25rem;
    font-weight: 500;
}

.text-subtle {
    color: var(--text-subtle);
    font-size: .875rem;
    line-height: 1.25rem;
}

/*
  Components
*/
/* alert */
.alert {
  background-color: var(--bg-color-secondary);
  border-radius: 0.5rem;
  padding: 1rem 1rem;
  border-width: 2px 0 0;
  border-style: solid;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.alert.danger {
  border-top-color: var(--danger-color);
}
.alert.info {
  border-top-color: var(--info-color);
}
.alert.success {
  border-top-color: var(--success-color);
}
.alert.error {
  border-top-color: var(--warning-color);
}


/* tabs */
.tabs {
  padding-top: 2rem;
}
.tabs > [data-tab-state="show"] {
  display: block;
}
.tabs > [data-tab-state="hide"] {
  display: none;
}
.tabs > .tab {
  background: none;
  border-width: 0;
  color: var(--fg-color);
  padding: 0 1rem 0 1rem;
}
.tabs > .tab:hover {
  cursor: pointer;
}
.tabs > .tab[data-tab-state="active"] {
  text-decoration: underline;
}

/* spash page */
.splash-page {
  min-height: 100vh;
  background: var(--bg-page);
}
.splash-page .content {
  flex-direction: column;
  gap: 1.5rem;
  display: flex;
  align-items: center;
  padding: 5rem 1rem;
}
@media (max-width: 600px) {
  .splash-page .content {
    padding: 1rem 0.5rem;
  }
}
.splash-page .content > .subtitle {
  border: 1px solid var(--bg-brand);
  padding: 1rem;
  border-radius: 2rem;
  margin-bottom: 1rem;
}
.splash-page .content > .feature-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  max-width: 750px;
}
@media (max-width: 600px) {
  .splash-page .content > .feature-cards {
    grid-template-columns: 1fr;
  }
}
.splash-page .content > .feature-cards > .feature-card {
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border-radius: 0.5rem;
  gap: 1rem;
  background-color: var(--bg-container);
}

/* world-card */
.world-card {
  padding: 1rem;
  background-color: var(--bg-container);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
}
.world-card > .image {
  width: 300px;
  height: 100px;
  border-radius: 0.5rem;
}

/* link */
.link {
    font-weight: 500;
    text-decoration-line: underline;
    display: inline-block;
    color: var(--text-brand);
    cursor: pointer;
    background-color: transparent;
    border: none;
}

/* navigation */
#site_navigation {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
}

#navigation_title {
    display: flex;
    align-items: center;
}

#navigation_icon {
    font-size: 2rem;
    padding-left: .5rem;
}

#logout_form {
    display: inline;
}

#logout_form button {
    display: inline;
}

/* world nav */
.world-navigation {
  background-color: var(--bg-container);
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
}
.world-navigation .world-name {
  display: flex;
  align-items: center;
  color: var(--text-base);
}
.world-navigation .section {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
}
.world-navigation .section:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}
@media (max-width: 900px) {
  .world-navigation .section {
    flex-direction: row;
  }
}
.world-navigation .section.--spaced {
  justify-content: space-between;
}
.world-navigation .nav-link {
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  color: var(--text-subtle);
  cursor: pointer;
  width: 152px;
}
@media (max-width: 900px) {
  .world-navigation .nav-link {
    width: 120px;
  }
}
.world-navigation .nav-link.--active {
  border: 1px solid var(--border-brand);
  color: var(--text-brand);
  background: var(--bg-base);
}
.world-layout {
  display: grid;
  grid-template-columns: 225px 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .world-layout {
    grid-template-columns: 100%;
  }
}
#world_content_hx_target {
  height: 100%;
}
.world-content-loading-spinner {
  display: flex;
  height: 100%;
  justify-content: center;
  align-items: center;
}

/* tags */
.tag {
  font-size: var(--font-size-xs);
  color: var(--fg-color);
  background-color: var(--color-gray-700);
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  display: inline-block;
}
.tag.--clickable {
  text-decoration: underline;
  cursor: pointer;
}
.tag.--primary {
  background-color: var(--bg-brand);
}

/* buttons */
.button {
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
  border-width: 0;
  background-color: var(--color-gray-700);
  text-align: center;
  color: var(--fg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}
.button:disabled {
  opacity: 0.5;
}
.button:hover {
  filter: brightness(0.9);
}
.button:active {
  filter: brightness(0.8);
}
.button.--primary {
  background-color: var(--bg-brand);
}
.button.--small {
  padding: 0.25rem 0.5rem;
  font-size: var(--font-size-sm);
}
.button.--danger {
  background-color: var(--danger-color);
}
.button.--inline {
  display: inline;
  margin: 0;
}
.button.--wide {
  width: 20rem;
}
.button.--full-width {
  width: 100%;
}
.button.--ghost {
  background-color: inherit;
  border: 1px solid var(--border-subtle);
}

/* preview */
.item-preview {
  border-bottom: 2px solid;
  padding: 1rem 0;
}
.item-preview > .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.item-preview > .tags {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* markdown */
.markdown {
  line-height: 1.25;
}
.markdown > blockquote {
  border-left: 4px solid var(--bg-color-secondary);
  padding-left: 1rem;
}
.markdown pre {
  background-color: var(--bg-color-secondary);
  padding: 0.5rem;
  border-radius: 0.25rem;
}
.markdown-preview * {
  font-size: 0.75rem;
  font-weight: normal;
  display: inline;
}

/* calendar */
.calendar {
  border: 2px solid var(--color-gray-700);
}
.calendar td {
  border-top: 2px solid var(--color-gray-600);
}
.calendar .calendar__item {
  color: var(--color-gray-400);
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.calendar__item.selected {
  background-color: var(--color-gray-800);
}

/* pricing table */
#tier_table {
  border-collapse: collapse;
}
#tier_table td, #tier_table th {
  border: 1px solid var(--color-gray-600);
  padding: 8px;
  /* Optional: Add padding for better spacing */
}
#table_container {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* note drawer */
.note-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  padding: 1rem;
  width: 300px;
  /* Adjust the width as needed */
  background-color: var(--color-gray-800);
  /* Set the background color as needed */
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
  /* Optional: Add shadow for visual effect */
  border-left: 2px solid var(--color-gray-500);
  overflow-y: scroll;
}
.note {
  background-color: var(--color-gray-700);
  padding: 0.25rem 1rem;
  border-radius: 0.5rem;
}
#notes {
  display: flex;
  gap: 1rem;
  flex-direction: column;
  margin-bottom: 4rem;
}

/* images */
.fullscreen-image {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.fullscreen-image > .background {
  position: absolute;
  inset: 0;
  background-color: var(--color-gray-950);
  display: flex;
  justify-content: center;
  align-items: center;
}
.fullscreen-image > .image {
  max-width: 100%;
  max-height: 100%;
  cursor: pointer;
  z-index: 60;
}
.fullscreen-image .close {
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 0 1rem 1rem 0;
}

/* info box */
.info-box {
  background-color: var(--color-gray-800);
  border: 1px solid var(--color-gray-600);
  display: flex;
  flex-wrap: wrap;
}
.info-box > .section {
  padding: 0.5rem;
  border: 1px solid var(--color-gray-600);
  flex-grow: 1;
}
.info-box > .section > .header {
  font-weight: bold;
}
.info-box > .section.-full-width {
  flex-basis: 100%;
}

/* cards */
.cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.legacy-card {
    background-color: var(--color-gray-700);
    padding: 0.25rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    gap: 1rem;
}

/* stack */
.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
}

/* search results */
.search-widget {
  display: flex;
}
.search-widget .form {
  position: relative;
  display: inline-block;
}
.search-widget .form > .results {
  position: absolute;
  background-color: var(--color-gray-600);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.search-widget .form > .results > .result {
  align-items: center;
  justify-content: space-between;
  display: flex;
  padding: 0 1rem 1rem 1rem;
}
.search-widget .form > .results > .result > .resultname {
  padding-right: 0.5rem;
}
.search-widget .form > .results > .result:first-child {
  padding-top: 1rem;
}
.search-widget .form > .results > .result:not(:last-child) {
  border-bottom: 1px solid white;
}

/* error message */
.error-message {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--color-gray-700);
    border-radius: 0.25rem;
    border-bottom: 0.25rem solid var(--color-red-600);
    color: var(--color-red-100);
}

/* forms */
.form.--full-width {
  display: flex;
  gap: 1rem;
}
.form.--full-width input {
  width: 100%;
  box-sizing: border-box;
}
.form .input-group {
  display: flex;
  flex-wrap: wrap;
  padding: 1rem 0 0 0;
  gap: 1rem;
}
.form .input-group > .input-container {
  flex-grow: 1;
}
.form .input-group > .input-container > .label-row {
  display: flex;
  padding-bottom: 0.5rem;
  justify-content: space-between;
}
.form .input-group > .input-container > .input-errors {
  color: var(--text-error);
}
.form .input-group > .input-container > .input {
  width: 100%;
  box-sizing: border-box;
  background-color: var(--bg-base);
  border: 1px solid var(--border-base);
}
.form .input-group > .input-container > .input[aria-invalid='true'] {
  border: 1px solid var(--border-error);
}
.form .input-group > .input-container.--checkbox {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.form .input-group > .input-container.--checkbox label {
  display: inline;
}
.form .input-group > .input-container.--checkbox > .input {
  height: 1.5rem;
  width: 1.5rem;
  accent-color: var(--text-brand);
  border: 1px solid var(--border-base);
}

/* world search */
.search-results {
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
}
.search-results .result {
  text-decoration: none;
  color: inherit;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--color-gray-950);
}
.search-results .result:hover, .search-results .result:focus {
  background-color: var(--color-gray-400);
}
.world-search-placeholder-input {
  width: 100%;
  box-sizing: border-box;
}

/* thing list */
.thing-list {
  display: flex;
  flex-direction: column;
}
.thing-list > .thing {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-gray-500);
  display: flex;
  gap: 1rem;
}
.thing-list > .thing > .info {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}
.thing-list .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* content panel */
.content-panel {
  background-color: var(--bg-container);
  border-radius: 1rem;
  border: 1px solid var(--border-subtle);
  min-height: 100%;
}
.content-panel > .section {
  padding: 1rem 2rem;
}
.content-panel > .section:not(:last-child) {
  border-bottom: 1px solid var(--border-subtle);
}
.content-panel > .section.--row {
  display: flex;
  justify-content: space-between;
}

/* auth form css */
.auth-form-container {
  display: grid;
  grid-template-columns: 50% 50%;
  min-height: 100%;
}
@media (max-width: 650px) {
  .auth-form-container {
    grid-template-columns: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9)), url("/static/img/splash-1.b6ed9ebeaafa.png");
    background-position: center;
    background-repeat: no-repeat;
  }
}
.auth-form-container > .form-container {
  margin: auto;
  min-width: 300px;
}
.auth-form-container > .image {
  background-image: url("/static/img/splash-1.b6ed9ebeaafa.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
@media (max-width: 650px) {
  .auth-form-container > .image {
    display: none;
  }
}

/* card list */
.card-list {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.card-list .card-link {
  cursor: pointer;
  text-decoration: none;
  color: var(--text-base);
}
.card-list .card-link:hover {
  text-decoration: underline;
}
.card-list .card {
  display: flex;
  flex-direction: column;
}
.card-list .card > .image {
  height: 200px;
  width: 200px;
  border: 1px solid var(--border-subtle);
  object-fit: cover;
  border-radius: 0.5rem;
}

.card-list .card > .footer {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* dropdown container */
.dropdown-container {
  display: block;
}
.menu {
  display: none;
  position: absolute;
  background-color: var(--bg-base);
  border: 2px solid var(--border-base);
  border-radius: 1rem;
  padding: 1rem;
  z-index: 1;
}
.menu.show {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.menu .item {
  display: block;
}

/* legacy */
/* TODO: replace these with well defined components */
.column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0.5rem 0;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.list__separator {
    padding: 2rem;
    text-decoration: underline;
}

.box {
    border-style: solid;
    border-width: 2px;
    border-color: var(--color-gray-700);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    align-items: center;
}

.spacer {
    margin: 1rem 0;
}

.interactable {
    cursor: pointer;
}

.add-margin {
    margin-top: 20rem;
}

/* modal */
.modal-container .overlay {
  z-index: 10;
  position: fixed;
  padding-top: 1rem;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: start;
}
.modal-container[data-modal-show="true"] .overlay {
  display: flex;
}
.modal-container[data-modal-show="false"] .overlay {
  display: none;
}
.modal-container .content {
  background-color: var(--color-gray-800);
  padding: 1rem;
  width: 80%;
}

