#loaded {
  overflow: hidden;
}

#logo-background {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  user-select: none;
  pointer-events: none;
  max-width: 400px;
}

#three-container {
  /* height: 360px; */
  position: relative;
  overflow: hidden;
  background-color: #ececec;
  background-color: #fff;

  will-change: transform; /* Promotes container to its own GPU layer */
  transform: translateZ(0); /* Forces hardware acceleration */
  /* &::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background-image: url("/textures/dot.png");
    background-repeat: repeat;
    background-size: 24px;
    opacity: 0.2;
  } */

  #three-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 100% !important;
    height: auto !important;
    top: 50%;
    transform: translateY(-50%);
  }

  #overlay-container {
    position: absolute;
    z-index: 3;
    bottom: 80px;
    left: 16px;
    right: 16px;
    pointer-events: none;
  }

  /* #eye-toggle {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 8px;
  } */

  #three-controls {
    position: absolute;
    z-index: 3;
    bottom: 0;

    #delete-btn {
      width: 32px;
      height: 32px;
      line-height: 32px;
      text-align: center;
      background: #fff;
      cursor: pointer;
    }

    .left {
      left: 16px;
      bottom: 16px;

      position: absolute;
    }
    .right {
      right: 16px;
      bottom: 16px;
      position: absolute;
    }
    .center {
      left: 50%;
      transform: translateX(-50%);
      bottom: 16px;
      position: absolute;
    }
  }
}

#option-controls {
  max-width: 600px;
  margin: auto;
}

#strip-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.strip-item {
  /* border: 1px solid rgba(0, 0, 0, 0.5); */
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15), 0px 2px 8px rgba(0, 0, 0, 0.05);
  background: #fff;
  line-height: normal;
  overflow: hidden;
  .info {
    padding: 0 8px;
    display: flex;
    flex: 1;
    align-items: start;
    font-size: 11px;
  }
  .imgBox {
    /* display: flex;
        flex: 1;
        align-items: start; */
    padding-top: 8px;
    img {
      max-width: 90px;
      height: auto;
    }
  }
  .btn {
    color: #db8300;
    display: flex;
    width: 100%;
    height: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  letter-spacing: 5%;
  font-weight: 600;
  text-transform: uppercase;
}

#swap-arrows {
  & > * {
    transform: translateY(8px);
    transition: all 0.16s ease-out;
    opacity: 0;
    transform: translateY(4px);
  }
  &.active > * {
    transform: translateY(0);
    opacity: 1;
  }
  &:not(.active) {
    visibility: hidden;
    pointer-events: none;
    /* & > *{
      visibility: hidden;
      pointer-events: none;
    } */
  }
}

.swap-arrow {
  width: 32px;
  height: 32px;
  text-align: center;
  background: #fff;
}

#eye-toggle:not(.active) {
  #eye-pupil {
    fill: white;
  }
  #eye-ball {
    fill: var(--primary-color);
  }
}

#sidebar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #f6f6f6;
  z-index: 5;
  &.collapsed {
    transform: translateX(100%);
  }
}

#sidebar-header {
  background: #fff;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15), 0px 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

#sidebar-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#sidebar-tabs {
  background: #fff;
  /* box-shadow:
    0px 1px 2px rgba(0, 0, 0, 0.15),
    0px 2px 8px rgba(0, 0, 0, 0.05); */
  height: 48px;
  overflow: hidden;
  .tab {
    position: relative;
    transition: color 0.15s ease-out;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;

    &:not(.active):not(:hover) {
      color: #97a2ac;
      &::after {
        transform: translateY(100%);
        /* transform: translateY(100%); */
      }
    }

    &::after {
      content: "";
      display: block;
      position: absolute;
      width: 100%;
      height: 3px;
      background: var(--primary-color);
      bottom: 0;
      transition: transform 0.155s ease-out;
    }

    &.active {
      color: #000;
    }
  }
}

#sidebar-body {
  flex: 1;
  overflow-y: scroll;
  /* border-top: 1px solid var(--border-color); */
}

#desktop-header {
  display: none;
}
#mobile-header {
  height: 42px;
}

dialog {
  width: 100%;
  height: 100dvh;
  max-width: 740px;

  margin: 0 !important;
  padding: 0;
  border: none;
  transform: translateX(50%);
  max-width: none;
  max-height: none;
  position: fixed;
  inset: 0;

  opacity: 0;
  transform: translateX(50%);
  background: #f6f6f6;
  overflow: hidden;
}

.dialog-header {
  background: #fff;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15), 0px 2px 8px rgba(0, 0, 0, 0.05);
}

#strip-filter {
  background: #fff;
  box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15), 0px 2px 8px rgba(0, 0, 0, 0.05);
  height: 32px;
  overflow: hidden;

  .tab {
    position: relative;
    transition: color 0.15s ease-out;

    &:not(.active):not(:hover) {
      color: #97a2ac;
    }

    /* &::after {
      content: "";
      display: block;
      position: absolute;
      width: 100%;
      height: 3px;
      background: var(--primary-color);
      bottom: 0;
      transition: transform 0.155s ease-out;
    } */

    &.active {
      color: var(--primary-color);
      font-weight: 600;
    }
  }
}

#strip-dialog-container,
#form-dialog-container {
  overflow: hidden;
  height: 100%;
}

#strip-dialog-body,
#form-dialog-body {
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling for older iOS */
  outline: none !important;
}

dialog[open] {
  opacity: 1;
  transform: translateX(0);

  /* Transition only applies when opening */
  transition: opacity 0.3s ease, transform 0.3s ease;

  position: fixed;
  margin: 0;

  /* 2. Override the default positioning */
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;

  max-width: 740px;
  height: 100%; /* Optional: for full height */
}

#strip-open {
  width: 52px;
  height: 52px;
  background: #db8300;
  color: #fff;
}

.spinner-circle {
  border: 8px solid rgb(240, 240, 240);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border-left-color: #000;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.hidden {
  display: none;
}

form {
  img {
    height: auto;
    width: 100%;
    display: block;
    max-width: 480px;
    margin: auto;
    max-height: 180px;
    object-fit: contain;
  }
  #form-submit {
    background-color: var(--primary-color);
    color: #fff;
    padding: 8px;
    outline: none;
    border: none;
    font-family: inherit; /* Use the parent page's font */
  }
}

/* dropdown */
#color-input {
  width: 0;
  min-width: 100px;
  &::placeholder {
    color: rgb(192, 192, 192);
  }
}
.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  border: none;
  padding: 0;
  text-align: left;
  background-color: transparent;
  white-space: nowrap;
}

.toggle-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--primary-400);
}

.dropdown-menu {
  position: fixed;
  z-index: 1000;
  min-width: 180px;
  max-width: 300px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 6px;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.dropdown-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: #374151;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background-color: var(--primary-40);
  color: #111827;
}

.dropdown-menu a.selected {
  background-color: var(--primary-50);
  color: var(--primary-500);
  font-weight: 500;
}

.dropdown-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 4px 0;
}

.dropdown-input-row {
  padding: 4px;
}

#color-input {
  padding: 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

#color-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-300);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#color-submit:hover {
  background: var(--primary-400);
}

#color-warning {
  background-color: var(--primary-50);
  color: var(--primary-500);
  padding: 4px 16px;
  border-top: 1px solid;
  border-bottom: 1px solid;
  border-color: var(--primary-200);
  /* position: absolute;
  left: 0;
  right: 0; */
  cursor: pointer;
}
.hidden {
  display: none;
}
#desktop-prompt {
  display: none;
}
/* dropdown */

@media (min-width: 480px) {
  #strip-body {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .strip-item .info {
    padding: 0 12px;
  }
}
@media (min-width: 800px) {
  .strip-item .info {
    padding: 0 16px;
  }
  .strip-item .imgBox {
    padding-top: 16px;
  }
}
@media (min-width: 1000px) {
  .dropdown-container {
    font-size: 14px;
  }
  .dropdown-toggle {
    font-size: 16px;
  }
  .dropdown-label {
    font-size: 14px;
  }
  .dropdown-menu {
    min-width: 200px;
  }

  #loaded-container {
    display: flex;
  }
  #mobile-header {
    display: none;
  }
  #desktop-header {
    display: block;
  }
  #sidebar {
    position: relative !important;
    flex: 1;
    max-width: min(45%, 700px);
    transform: translateX(0) !important;
    border-left: 1px solid var(--border-color);
  }
  #strip-open {
    display: none;
  }

  #three-controls {
    margin: 16px;
  }
  #eye-toggle,
  #delete-btn,
  .swap-arrow {
    width: 48px !important;
    height: 48px !important;
  }
  .swap-arrow svg {
    width: 18px;
    height: 18px;
  }
  #delete-btn svg {
    width: 20px;
    height: 20px;
  }
  #eye-toggle svg {
    width: 30px;
    height: 30px;
  }

  #overlay-container {
    bottom: 96px !important;
    #overlay-desc {
      font-size: 16px;
    }
  }

  #query-bar {
    display: none;
  }
  .strip-item .info {
    font-size: 13px;
  }
  #mobile-prompt {
    display: none;
  }
  #desktop-prompt {
    display: block;
  }
}

@media (min-width: 1200px) {
  #sidebar {
    width: 620px;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
