@use './variables.scss';

div.vec2,
div.vec3,
div.vec4 {
  display: inline;
}
.vec2 input.number,
.vec3 input.number {
  width: 40px;
}
.vec4 input.number {
  width: 34px;
}
.collapsible-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  .entityPrint {
    color: variables.$white;
  }
}
.componentTitle {
  display: flex;
  align-items: center;
  gap: 8px;

  span {
    overflow: hidden;
    white-space: nowrap;
    color: variables.$white;
    font-weight: 500;
    font-size: 16px;
    text-transform: uppercase;
  }
}
.componentHeader.collapsible-header {
  display: flex;
  align-items: center;
  flex: 1;
}
.sidepanelContent {
  padding: 0 0 0 15px;
}
.collapsible {
  .static {
    padding: 6px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: auto;
    background: variables.$black;

    .collapse-button {
      border: 6px solid transparent;
      width: 0;
      height: 0;
      margin: 0 8px;
    }

    &:hover {
      background: variables.$black-400;
    }
  }

  &.collapsed .static .collapse-button {
    border-left-color: variables.$lightgray-100;
    transform: translateY(-1px);
  }

  &:not(.collapsed) .static .collapse-button {
    border-top-color: variables.$lightgray-100;
    transform: translateY(1px);
    transform: translateX(-2px);
  }
}
.collapsible.component ~ .collapsible.component {
  border-top: 1px solid variables.$darkgray-700;
  width: 348px;
}
.collapsible:first-child {
  border-bottom: 1px solid variables.$lightgray-200;
}
.collapsible:last-child {
  border-bottom: none;
}
.collapsible .menu {
  text-align: right;
}
.collapsible .menuafter {
  color: variables.$lightgray-300;
  content: '\2807';
  font-size: 12px;
  padding: 5px;
  text-align: right;
}
.collapsible .static {
  margin: 0;
}
.collapsible .content {
  margin-bottom: 20px;
}
.collapsible .static .collapse-button {
  border: 6px solid transparent;
  float: left;
  height: 0;
  margin-right: 10px;
  margin-left: 2px;
  width: 0;
}
.collapsible.collapsed .static .collapse-button {
  border-left-color: variables.$lightgray-100;
  margin-top: 4px;
}
.collapsible:not(.collapsed) .static .collapse-button {
  border-top-color: variables.$lightgray-100;
  margin-top: 7px;
}
.details .propertyRow {
  padding: 0 0 0 15px;
  width: 100%;
  display: flex;
  align-items: center;
  column-gap: 12px;
}
.details .propertyRow .text {
  max-width: 100px;
  min-width: 100px;
  word-wrap: break-word;
}
.details .propertyRow input {
  width: 100% !important;
}
.details .propertyRow .inputBlock {
  margin-right: 12px;
  width: 100%;
}
.details .propertyRow .select-widget {
  width: 100%;
  margin-right: 12px;
}
.details .propertyRow .vec2 {
  justify-content: start;
}
.details .propertyRow .vec2 .inputBlock {
  width: 100%;
}
.details .propertyRow .vec3 .inputBlock {
  margin-right: 2px;
  width: 100%;
}
.propertyRow {
  display: flex;
  align-items: center;
  font-size: 14px;
  min-height: 30px;
  margin-top: 10px;
  margin-bottom: 10px;
  position: relative;

  .property-row-right-element {
    margin-left: auto;
    margin-right: 20px;
    display: flex;
    align-items: center;
  }

  .pro-badge {
    background-color: #774dee;
    color: white;
    padding: 0px 8px;
    border-radius: 8px;
    font-size: 0.775rem;
    font-weight: normal;
    display: inline-block;
  }

  .fakePropertyRowLabel {
    display: inline-block;
    min-width: 70px;
    color: variables.$white-100;
    font-weight: 500;
    font-size: 16px;
  }

  .fakePropertyRowValue {
    display: flex;
    align-items: center;
    margin-left: 35px;
    font-size: 16px;

    &.input-style {
      background: rgba(50, 50, 50, 0.8);
      border: 1px solid variables.$purple-400;
      border-radius: 10px;
      padding: 0.5rem;
      width: 100%;
      word-break: break-all;
      font-size: 0.875rem;
      position: relative;

      &:hover .copy-button,
      .copy-button.copied {
        opacity: 1;
        pointer-events: auto;
      }
    }

    .copy-button {
      display: flex;
      align-items: center;
      gap: 4px;
      border: 1px solid variables.$darkgray-600;
      font-size: 12px;
      padding: 4px 8px;
      backdrop-filter: blur(3px);
      border-radius: 4px;
      cursor: pointer;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      background-color: rgba(0, 0, 0, 0.5);
      color: variables.$white;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
      z-index: 10;

      &:hover {
        background-color: rgba(0, 0, 0, 0.7);
      }

      &:active {
        background-color: rgba(0, 0, 0, 0.8);
      }

      svg {
        width: 14px;
        height: 14px;
      }
    }
  }

  .checkmark-green {
    color: #4caf50;
    font-weight: bold;
    font-size: 16px;
  }

  > input.string,
  > input.number,
  > .inputBlock > input.number,
  .texture input {
    padding-left: 8px;
    box-sizing: border-box;
    padding: 12px 16px !important;
    background: rgba(50, 50, 50, 0.8);
    border: 1px solid variables.$purple-400;
    border-radius: 10px;
    box-sizing: border-box;
    white-space: nowrap;
  }
  > input.number,
  > .inputBlock > input.number {
    width: 228px;
  }
  > input.string,
  .texture input {
    width: 348px;
  }
  .select__menu {
    margin-top: 8px;
  }
  .select-widget {
    display: block;
  }
  .select__single-value {
    color: variables.$white;
  }
  .select__control {
    padding: 6px 8px !important;
    background: rgba(50, 50, 50, 0.8);
    border: 1px solid variables.$purple-400;
    border-radius: 10px;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .checkboxAnim {
    position: relative;
    display: inline-block;
    float: right;
    width: 40px;
    height: 20px;
    margin: 2px 5px;
    border: 1px solid variables.$lightgray-400;
    border-radius: 10px;
    box-sizing: border-box;
    cursor: pointer;
    &.checked {
      background: variables.$lightgray-400;
    }
    input {
      background: none;
    }
    label {
      display: block;
      width: 13.3px;
      height: 13.3px;
      border-radius: 50%;
      transition: all 0.5s ease;
      cursor: pointer;
      position: absolute;
      top: 3px;
      left: 3.3px;
      background: variables.$lightgray-400;
    }
    input[type='checkbox']:checked + label {
      left: 22px;
      background: variables.$darkgray-800;
    }
  }
  .text {
    color: variables.$white !important;
    font-weight: 400;
    font-size: 16px;
    text-transform: capitalize;
    margin-bottom: 4px;
    display: block;
  }
  .vec2 {
    width: 348px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-content: center;
    align-items: center;
    margin-top: 4px;
    .name {
      width: 100px;
    }
    .inputBlock {
      width: 108px;
      height: 48px;
      padding: 12px 16px;
      background: rgba(50, 50, 50, 0.8);
      border: 1px solid variables.$purple-400;
      border-radius: 10px;
      box-sizing: border-box;
      white-space: nowrap;
      span {
        width: 9px;
        height: 19px;
        line-height: 19px;
        margin-right: 8px;
        font-weight: 400;
        font-size: 16px;
        color: variables.$lightgray-200;
        text-transform: uppercase;
      }
    }
  }
  .vec3 {
    width: auto; // Changed from 348px
    display: inline-flex; // Changed from flex
    flex-direction: row;
    column-gap: 12px;
    align-content: center;
    align-items: center;
    margin-top: 4px;
    .name {
      width: auto; // Changed from 100px
    }
    .inputBlock {
      width: 100%;
      height: 38px;
      padding: 0px 10px;
      background: rgba(50, 50, 50, 0.8);
      border: 1px solid variables.$purple-400;
      border-radius: 10px;
      box-sizing: border-box;
      white-space: nowrap;
      display: inline-flex; // Added
      align-items: center; // Added
      span {
        width: auto; // Changed from 9px
        height: 16px;
        line-height: 18px;
        margin-right: 6px;
        font-weight: 400;
        font-size: 11px;
        color: variables.$lightgray-200;
        text-transform: uppercase;
      }
      .number {
        width: 100%;
        color: variables.$lightgray-500;
        font-weight: 400;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: middle;
        padding: 0px;
        font-size: 13.5px;
      }
    }
  }
  .map_value {
    margin: 0 0 0 5px;
    width: 68px;
  }
  .Select-control {
    font-size: 11px;
    height: 24px;
  }
  .Select-placeholder,
  .Select--single > .Select-control .Select-value {
    line-height: 19px;
  }
  .Select-input {
    height: 22px;
  }
  input[type='text'],
  input[type='number'],
  input.string,
  input.number {
    box-sizing: border-box;
    align-items: center;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 19px;
    color: variables.$white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    &:last-child {
      padding-right: 0;
    }
  }
  .color_value {
    letter-spacing: 1px;
  }
  .text {
    display: inline-block; // Changed from block
    margin-bottom: 0; // Changed from 4px
    min-width: 70px; // Added to maintain consistent label width
  }
}
.components * {
  vertical-align: middle;
}
span.subcomponent {
  color: variables.$lightgray-700;
  float: none !important;
  margin-left: 10px;
  vertical-align: top !important;
}
a.help-link {
  opacity: 0.4;
}
a.help-linkhover {
  opacity: 1;
}
.Select-menu-outer .is-focused span {
  color: variables.$white;
}
.component-title {
  align-items: center;
  display: flex;
}
#componentEntityHeader {
  display: block !important;
  width: 348px;
  .collapsible-header {
    bottom: 4px;
    position: relative;
  }
  .collapse-button {
    display: none;
  }
  .static {
    height: 13px;
    display: none;
  }
  .entityPrint {
    font-size: 15px;
    padding-left: 5px;
  }
  .entityName {
    max-width: 160px;
    top: 0;
  }
  .entityIcons {
    color: variables.$white-100;
  }
}
#mixinSelect {
  width: 348px;
}
.propertyRow .texture {
  display: flex;
  input {
    margin-left: 0;
    width: 120px;
  }
}
#componentEntityHeader .gltfIcon img {
  top: 0;
}
.fa {
  color: variables.$lightgray-100;
  &:hover {
    color: variables.$blue-100;
  }
}
.componentHeaderActions {
  .button {
    font-size: 16px;
    padding: 4px;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;

    &:hover {
      opacity: 1;
    }
  }
}

.advancedComponentsContainer {
  margin-top: 20px;
}

.componentHeader.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;

  .componentTitle {
    flex: 1;
  }

  .componentHeaderActions {
    display: flex;
    gap: 8px;
    align-items: center;
  }
}

// If you need to override any Button styles specifically for these icons:
.componentHeaderActions {
  .button[variant='toolbtn'] {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;

    svg {
      width: 16px;
      height: 16px;
    }
  }
}

// only show component header actions on hover
.componentHeaderActions {
  .button.remove-button {
    opacity: 0;
    transition: opacity 0.2s ease;
  }
}
.componentHeader:hover {
  .componentHeaderActions {
    .button.remove-button {
      opacity: 0.6;
    }
  }
}

/* Make the delete component hover state more specific to override the header hover */
.componentHeader .componentHeaderActions .button.remove-button:hover {
  opacity: 1 !important;
  svg path {
    stroke: #ff4444 !important;
  }
}

#addComponentContainer {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 10px;

  #addComponent {
    width: 300px; // Slightly smaller than 348px for other component widths

    .select__control {
      padding: 12px 16px !important;
      background: rgba(50, 50, 50, 0.8);
      border: 1px solid variables.$purple-400;
      border-radius: 10px;
      box-sizing: border-box;
      white-space: nowrap;
      min-height: 48px; // Match other input heights

      &:hover {
        border-color: variables.$purple-700;
      }

      &--is-focused {
        border-color: variables.$purple-700 !important;
        box-shadow: none;
      }
    }

    .select__placeholder {
      color: variables.$white;
      font-weight: 400;
      font-size: 16px;
    }

    .select__single-value {
      color: variables.$white;
    }

    .select__menu {
      margin-top: 8px;
      background: variables.$darkgray-300;
      border: 1px solid variables.$purple-500;
      border-radius: 10px;

      .select__option {
        padding: 12px 16px;
        color: variables.$white;

        &--is-focused {
          background: variables.$black;
        }

        &--is-selected {
          background: variables.$black;
        }
      }
    }
  }
}
