$mainColor: #22232c;
$textColor: white;
$mainFont: Resolve;

$secondaryColor: rgba(12, 12, 12, 0.4);
$secondaryColorHighlight: #33343F;
$secondaryColorLight: rgba(0, 0, 0, 0.5);
$secondaryColorDark: rgba(12, 12, 12, 0.8);

$gridCols: 5;
$gridRows: 4;
$gridSize: 8vh;
$gridGap: 5px;
$containerSize: calc(#{$gridRows} * #{$gridSize + 0.4vh} + #{$gridRows} * #{$gridGap});

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
    'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100vh;
  background: none !important;
  overflow: hidden !important;
  user-select: none;
}

#root {
  height: 100%;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

::-webkit-scrollbar {
  display: none;
}

p {
  margin: 0;
  padding: 0;
  font-family: $mainFont;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.app-wrapper {
  height: 100%;
  width: 100%;
  color: white;
}

.context-menu-list {
  min-width: 200px;
  padding: 4px;
  outline: none;
  display: flex;
  flex-direction: column;
}

.context-menu-item  {
  padding: 8px;
  border-radius: 4px;
  background: linear-gradient(145deg, white, white);
  margin-bottom: .4rem;
  outline: none;
  border: none;
  color: #0A0A0A;
  font-family: "Resolve";
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all .1s ease-in-out;
  text-transform: uppercase;
  &:active {
    transform: none;
  }
  &:hover {
    background: linear-gradient(145deg, #0B0C0B,#313031);
    outline: 3px solid white;
    transform: scale(1.03);
    color: white;
    cursor: pointer;
  }
}

.tooltip-description {
  padding-top: 0;
}

.tooltip-markdown > p {
  margin: 0;
}

button:active {
  transform: translateY(3px);
}

.item-drag-preview {
  width: 7.7vh;
  height: 7.7vh;
  z-index: 1;
  position: fixed;
  pointer-events: none;
  top: 0;
  left: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 7vh;
  image-rendering: -webkit-optimize-contrast;
}

.inventory-wrapper {
  position: absolute;
  right: 0;
  display: flex;
  justify-content: center;
  flex-direction: column;
  width: fit-content;
  padding-inline: 2.5vw;
  height: 100%;

  gap: 10px;
}

.inventory-control {
  display: flex;

  .inventory-control-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    align-items: center;
  }

  .inventory-control-input {
    transition: 200ms;
    padding-block: 8px;
    font-family: "Resolve";
    font-size: 3000px;
    text-align: center;
    border: none;
    color: #0A0A0A;
    outline: none;
    
    background-color: $secondaryColor;
    
    &:focus-within {
      background: #efeff0b7;
    }


  }

  .inventory-control-button {
    font-size: 18px;
    color: #0A0A0A;
    background-color: #EFEFF0;
    transition: 200ms;
    border-radius: 5vh;
    border: none;
    text-transform: uppercase;
    font-family: $mainFont;
    width: fit-content;
    font-weight: 500;

    &:hover {
      background: #efeff0b7;
    }
  }
}

.useful-controls-dialog {
  background-color: $mainColor;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: $textColor;
  width: 450px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: 4px;
  gap: 16px;
}

.useful-controls-dialog-overlay {
  background-color: rgba(0, 0, 0, 0.5);
}

.useful-controls-dialog-title {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
}

.useful-controls-dialog-close {
  width: 25px;
  height: 25px;
  padding: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  fill: $textColor;
  &:hover {
    background-color: $secondaryColorHighlight;
    cursor: pointer;
  }
}

.useful-controls-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.divider {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.12);
}

.useful-controls-button {
  position: absolute !important;
  bottom: 25px;
  right: 25px;
  transition: 200ms !important;
  border: none;
  color: white;
  width: 52px;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  fill: white;
  border-radius: 5% !important;
  background-color: $secondaryColor !important;
  &:hover {
    background-color: $secondaryColorDark !important;
    cursor: pointer;
  }
}

.useful-controls-exit-button {
  position: absolute !important;
  right: 8px;
  top: 8px;
  border-radius: 2.5% !important;
  color: grey !important;
}

// Dialog is used fro useful controls window


// inventory grids
.inventory-grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: calc($gridGap * 2);
}
.inventory-grid-header-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  p {
    font-size: 16px;
  }
}

.inventory-grid-container {
  display: grid;
  height: $containerSize;
  grid-template-columns: repeat($gridCols, $gridSize);
  grid-auto-rows: $gridSize + 0.22vh;
  gap: $gridGap;
  overflow-y: scroll;
}

// inventory slots
.inventory-slot {
  // border: 1px solid rgba(255, 255, 255, .4);
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: -webkit-optimize-contrast;
  position: relative;
  background-size: 7vh;
  color: $textColor;
}

.inventory-slot-label-box {
  background-color: #0B0B0B;
  color: $textColor;
  text-align: center;
}

.inventory-slot-label-text {
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 3px;
  font-weight: 400;
  font-family: $mainFont;
  font-size: 12px;
}

.inventory-slot-number {
  color: white;

  box-sizing: border-box;
  height: fit-content;
  font-size: 17px;
  font-family: $mainFont;
}


.item-slot-info-wrapper {
  display: flex;
  flex-direction: row;
  gap: 3px;
  opacity: .5;
  color: white;
  p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 10px;
  }
}

.item-slot-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  p {
    font-size: 10px;
  }
}

.item-slot-header-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.item-hotslot-header-wrapper {
  @extend .item-slot-header-wrapper;
  justify-content: space-between !important;
}


.item-slot-currency-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  padding-right: 3px;
  p {
    font-size: 14px;
    text-shadow: 0.1vh 0.1vh 0 rgba(0, 0, 0, 0.7);
  }
}

.item-slot-price-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  padding-right: 3px;
  p {
    font-size: 14px;
    text-shadow: 0.1vh 0.1vh 0 rgba(0, 0, 0, 0.7);
  }
}


.tooltip-wrapper {
  pointer-events: none;
  display: flex;
  /*background-color: $mainColor;*/
  width: 200px;
  padding: 8px;
  flex-direction: column;
  min-width: 200px;
  color: $textColor;
  font-family: $mainFont;
  /*border-radius: 4px;
  border-color: rgba(0, 0, 0, 0.2);
  border-style: inset;
  border-width: 1px;*/
  p {
    font-size: 12px;
    font-weight: 400;
  }
}

.tooltip-header-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  p {
    font-size: 15px;
    font-weight: 400;
  }
}

.tooltip-crafting-duration {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  svg {
    padding-right: 3px;
  }
  p {
    font-size: 14px;
  }
}

.tooltip-ingredients {
  padding-top: 5px;
}

.tooltip-ingredient {
  display: flex;
  flex-direction: row;
  align-items: center;
  img {
    width: 28px;
    height: 28px;
    padding-right: 5px;
  }
}

// hotbar
.hotbar-container {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  width: 100%;
  position: absolute;
  bottom: 4vh;
}

.hotbar-item-slot {
  @extend .inventory-slot;
  width: $gridSize;
  height: $gridSize;
}

.hotbar-slot-header-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

// item notifications

.item-notification-container {
  display: flex;
  overflow-x: scroll;
  flex-wrap: nowrap;
  gap: 2px;
  position: absolute;
  bottom: 20vh;
  left: 50%;
  width: 100%;
  margin-left: calc(50% - calc($gridSize/2));
  transform: translate(-50%);
}

.item-notification-action-box {
  width: 100%;
  color: $textColor;
  background-color: $secondaryColor;
  text-transform: uppercase;
  text-align: center;
  border-top-left-radius: 0.25vh;
  border-top-right-radius: 0.25vh;
  font-family: $mainFont;
  p {
    font-size: 11px;
    padding: 2px;
    font-weight: 600;
  }
}

.item-notification-item-box {
  @extend .inventory-slot;
  height: $gridSize;
  width: $gridSize;
}

.durability-bar {
  background: #de6262;
  width: 80%;
  height: 3px;
  overflow: hidden;
}

.weight-bar {
  background: rgba(0, 0, 0, 0.4);
  border: 1px inset rgba(0, 0, 0, 0.1);
  height: 0.8vh;
  border-radius: 5%;
  overflow: hidden;
}

.transition-fade-enter {
  opacity: 0;
}

.transition-fade-enter-active {
  opacity: 1;
  transition: opacity 200ms;
}

.transition-fade-exit {
  opacity: 1;
}

.transition-fade-exit-active {
  opacity: 0;
  transition: opacity 200ms;
}

.transition-slide-up-enter {
  transform: translateY(200px)
}

.transition-slide-up-enter-active {
  transform: translateY(0px);
  transition: all 200ms;
}

.transition-slide-up-exit {
  transform: translateY(0px);
}

.transition-slide-up-exit-active {
  transform: translateY(200px);
  transition: all 200ms;
}


/* Estilos para el menú de ropa */
.clothing-container {
  position: absolute;
  left: -60px; 
  top: 0;
  transform: translateY(193px);
  transition: all 0.3s ease-in;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px; 
  max-height: 90vh;
  overflow-y: auto;
  padding: 5px; 
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
}

.clothing-container.visible {
  left: -10px; 
  opacity: 1;
  pointer-events: auto;
}

.inventory-clothing-wrapper {
  position: absolute;
  left: -40px; 
  top: 0;
  height: 100%;
  z-index: 40;
}

.cloth-but {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 47px;
  height: 32.5px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  background-color: white;
  color: #0A0A0A;
  padding: 4px; 
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1px; 
}

.cloth-but:hover {
  transform: translateX(2px);
  background-color: rgba(17, 92, 136, 0.979);
}

.cloth-but:active {
  transform: scale(0.95);
}

.toggled-cloth {
  background-color: #0A0A0A !important;
  color: white !important;
  transform: scale(1.05);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.cloth-reset {
  margin-top: 4px;
  padding-top: 4px;
}


.clothing-container::-webkit-scrollbar {
  width: 4px;
}

.clothing-container::-webkit-scrollbar-track {
  background: transparent;
}

.clothing-container::-webkit-scrollbar-thumb {
  background-color: rgba(21, 151, 204, 0.5);
  border-radius: 10px;
}
