:root {
  --header-log-height: 50px;

  --header-height: 60px;
  --header-padding: var(--startiapp-inset-bottom, 0px);

  --colors-border: #2c3035;
  --colors-primary: #f7931d;
}

.ionicon {
  height: 32px;
  width: 32px;
}

body {
  font-family: "Roboto", sans-serif;
  font-weight: 400;
  font-style: normal;
  background-color: black;
  color: white;

  padding: 0;
  margin: 0;

  min-height: 100vh;

  overflow: hidden;
}

/* Disables scrolling the body when overlays are active. */
body:has(.header-log-container.active),
body:has(#navigation-drawer.active) {
  overflow: hidden;
}

/* Header */
.tab-bar-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-direction: row;
  height: 100%;
  width: 100%;
}

.header-log-container {
  position: fixed;

  bottom: calc(var(--header-height) + var(--header-padding));
  max-height: 50px;
  width: 100%;
  height: 100%;
  background-color: black;

  overflow-y: scroll;
  padding-inline: 16px;
  transition: max-height 0.3s ease;
}

.header-log-container.active {
  max-height: calc(100vh - var(--header-height) - var(--header-padding));
  transition: max-height 0.3s ease;
  padding-top: calc(16px + var(--startiapp-inset-top, 0px));
}

.header-log-container pre {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
  overflow: auto;
}

#header-log[data-has-logs="false"] {
  color: #777;
  font-style: italic;
}

#header-log {
  user-select: text !important;
}

.header-log-container.active #header-log-clear-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.header-log-container #header-log-clear-btn {
  display: none;
}

.header-burger-container {
  position: absolute;
  top: 0px;
  right: 0px;
  height: var(--header-height);

  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 16px;
}

header {
  padding-bottom: var(--header-padding);
  min-height: var(--header-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  position: fixed;
  bottom: 0;
  z-index: 1000;
  background-color: black;

  border-bottom: 1px solid var(--colors-border);

  /* Fixes white gap on ios */
  margin-bottom: -1px;
}

/* Header */

body > .content {
  overflow-y: scroll;

  padding-top: calc(16px + var(--startiapp-inset-top, 0px));
  padding-right: calc(16px + var(--startiapp-inset-right, 0px));
  padding-left: calc(16px + var(--startiapp-inset-left, 0px));
  width: 100%;
  height: calc(
    100vh - var(--header-height) - var(--header-padding) - var(--header-log-height)
  );
}

body:has(.alert.active) > .content {
  height: calc(
    100vh - var(--header-height) - var(--header-padding) - var(--header-log-height) -
      100px
  );
  padding-top: 0px;
}

#navigation-drawer {
  position: fixed;
  top: 0;
  right: -70vw; /* Start off-screen */
  height: 100vh;
  width: 70vw; /* Set width to 70vw */
  background-color: black;
  z-index: 1000;
  transition: right 0.3s ease; /* Add transition for right property */

  border-left: 1px solid var(--colors-border);

  padding-top: var(--startiapp-inset-top, 0px);
  padding-inline: 16px;

  overflow: hidden;
}

#navigation-drawer.active {
  right: 0; /* Move on-screen */
}

#navigation-drawer.inactive {
  right: -70vw; /* Move off-screen */
}

#navigation-drawer-backdrop {
  position: fixed;
  top: 0;
  right: -100vw;
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0; /* Start with opacity 0 */
  transition: opacity 0.3s ease;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 2px 0px 4px black;
}

#navigation-drawer-backdrop.active {
  display: block; /* Ensure the backdrop is displayed */
  opacity: 1; /* Fade in */
  right: 0; /* Move on-screen */
}

#navigation-drawer-backdrop.inactive {
  opacity: 0; /* Fade out */
  display: none; /* Hide the backdrop after transition */
}

#navigation-drawer .header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--header-height);

  gap: 8px;
  padding-block: 16px;
}

.modules-icon {
  width: 22px;
  height: 22px;
  fill: white;
}

#navigation-drawer .content {
  overflow-y: scroll;
  max-height: calc(
    100vh - 60px - 16px - var(--startiapp-inset-bottom, 0px) -
      var(--startiapp-inset-top, 0px)
  );
  padding-bottom: 80px; /* Add padding to ensure items at the bottom are accessible */

  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

#navigation-drawer .content::-webkit-scrollbar {
  display: none;
}

#navigation-drawer .content ul {
  list-style-type: none;
  padding-inline: 0;
  padding-bottom: 40px; /* Add padding to ensure the last items are fully clickable */
  display: flex;
  gap: 8px;
  flex-direction: column;
  margin: 0px;
}

.nav-link {
  padding: 16px;
  border-radius: 8px;

  text-decoration: none;
}

.nav-link.active {
  background-color: #1b1d20;
}

.nav-link.active a {
  color: var(--colors-primary);
}

.nav-link a {
  color: white;
  text-decoration: none;
}

.content-wrapper {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
}

.input-wrapper .input-with-icon {
  display: flex;
  justify-content: space-between;
}

.input-wrapper input {
  padding-right: 40px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.input-wrapper button {
  padding: 0;
  margin: 0;
  margin-left: 5px;
}

.button-wrapper {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 5px;
}

button {
  background-color: #2c3035;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 8px 16px;
  transition: 0.3s;
  cursor: pointer;
  margin-top: 5px;
  margin-bottom: 5px;
}

button:hover {
  background-color: #1b1d20;
}

input[type="url"],
input[type="number"],
input[type="text"] {
  border: 1px solid var(--colors-primary);
  background-color: transparent;
  border-radius: 5px;
  color: white;
  width: 100%;
  padding: 10px;
  transition: 0.3s;
}

.container {
  padding-inline: 0;
}

select {
  border: 1px solid var(--colors-primary);
  background-color: transparent;
  color: white;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 8px 16px;
  border-radius: 5px;
  transition: 0.3s;
  padding-right: 40px;
  color: var(--colors-primary);
  width: 100%;
}

select:focus {
  outline: none;
}

select:active {
  outline: 2px solid var(--colors-primary);
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.dropdown-arrow {
  position: absolute;
  top: 0;
  bottom: 4px;
  margin-block: auto;
  right: 20px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--colors-primary);
  border-bottom: 0;
  border-left: 0;
  transform: rotate(135deg);
}

input[type="number"]:focus,
input[type="url"]:focus,
input[type="text"]:focus {
  outline: 2px solid var(--colors-primary);
}

span.input-name {
  color: var(--colors-primary);
}

textarea {
  border-radius: 5px;
  border: 1px solid var(--colors-primary);
  background-color: transparent;
  color: white;
  transition: 0.3s;
}

textarea:focus {
  outline: 2px solid var(--colors-primary);
}

.container {
  padding-inline: 0;
}
.tab-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  min-width: 64px;
  height: 60px;
}

.tab-bar-item svg {
  width: 24px;
  height: 24px;
  margin-bottom: 5px;
}

.tab-bar-item p {
  font-size: 12px;
  text-align: center;
  margin: 0;
}

.tab-bar-item.active p {
  color: var(--colors-primary);
}
.alert {
  display: none;
  padding: 16px;
  margin: 16px;
  background-color: #ff4c4c;
  border-radius: 8px;
  z-index: 1000;
  align-items: center;
  justify-content: space-between;
  transition: top 0.3s ease; /* Add transition for top property */

  margin-top: calc(var(--startiapp-inset-top, 0px) + 16px);
  margin-right: calc(var(--startiapp-inset-right, 0px) + 16px);
  margin-left: calc(var(--startiapp-inset-left, 0px) + 16px);
}
.alert.active {
  display: flex;
  top: calc(var(--startiapp-inset-top, 0px) + 16px); /* Slide down into view */
}
