/* The PNG has a 32px capture gutter around its native X/Y cell rectangle.
   Keep that origin when adapting it to the warehouse's existing cell size. */
.inventory-native-frame {
  overflow: visible !important;
}
/* Equipment images are positioned within their own slot, not the whole grid. */
.equipment-grid .item-slot.inventory-native-frame,
.ie-wrap .item-slot.inventory-native-frame {
  position: relative;
}
.bw-inventory-module .warehouse-item.inventory-native-frame > img,
.warehouse-item.inventory-native-frame > img,
.vi-item.inventory-native-frame > img,
.bw-inventory-module .vi-drop-preview.inventory-native-frame > img,
.vi-drop-preview.inventory-native-frame > img,
.equipment-grid .item-slot.inventory-native-frame > img,
.ie-wrap .inventory-item.inventory-native-frame > img,
.ie-wrap .item-slot.inventory-native-frame > img,
.ak-slot.inventory-native-frame > img {
  position: absolute !important;
  inset: auto !important;
  left: var(--inventory-image-left) !important;
  top: var(--inventory-image-top) !important;
  width: var(--inventory-image-width) !important;
  height: var(--inventory-image-height) !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  object-fit: fill !important;
  image-rendering: auto !important;
  pointer-events: none !important;
}

/* ---------------------------------------------------------------------------
   Shared item tooltip skin.

   Inventory (#tooltip), Market (#tooltip), Sell (#globalTooltip) and the
   character page all render the same markup from Scrap::parseItemOptions(),
   but each module carried its own copy of the styling, so the three drifted
   apart. This file is loaded last for every page and is the single place the
   tooltip look is defined - module CSS no longer needs to say anything
   about it.

   Look: framed panel with the silver border and the pointer arrow, no
   separator rules between the option groups, tight vertical rhythm.
   --------------------------------------------------------------------------- */

/* The character page reuses the #tooltip container for a different widget
   (.tt-box), so the panel styling only applies where the MU item markup is. */
#tooltip:has(.item-tooltip),
#globalTooltip:has(.item-tooltip) {
  position: fixed !important;
  left: -9999px;
  top: -9999px;
  z-index: 2147483000 !important;
  display: none !important;
  box-sizing: border-box !important;
  width: max-content !important;
  min-width: 0 !important;
  max-width: min(420px, calc(100vw - 16px)) !important;
  padding: 10px 14px 11px !important;
  /* the site look (dark blue, steel-blue frame), like the other hover hints */
  background: linear-gradient(180deg, rgba(20, 42, 66, .98), rgba(9, 18, 29, .98)) !important;
  border: 1px solid rgba(96, 176, 232, .45) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(160, 210, 255, .08) !important;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.8));
  backdrop-filter: none !important;
  color: #e8e8e8 !important;
  font-family: Arial, Tahoma, sans-serif !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  text-align: center !important;
  pointer-events: none !important;
}

#tooltip.show,
#globalTooltip.show {
  display: block !important;
}

#tooltip .item-tooltip,
#globalTooltip .item-tooltip {
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  text-align: center !important;
}

/* Generic children: no boxes of their own, the panel is the only frame. */
#tooltip .item-tooltip p,
#tooltip .item-tooltip div,
#tooltip .item-tooltip span,
#globalTooltip .item-tooltip p,
#globalTooltip .item-tooltip div,
#globalTooltip .item-tooltip span {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  line-height: 1.3 !important;
}

/* Option lines come through as bare <li> with no <ul>, so kill the markers. */
#tooltip .item-tooltip li,
#globalTooltip .item-tooltip li {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  text-indent: 0 !important;
  list-style: none !important;
  list-style-type: none !important;
}

#tooltip .item-tooltip li::marker,
#globalTooltip .item-tooltip li::marker {
  content: "" !important;
}

/* Use the same level-specific camera capture as Webshop. */
#tooltip .item-tooltip .item-image,
#globalTooltip .item-tooltip .item-image {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 2px auto 4px !important;
}

#tooltip .item-tooltip .item-image img,
#globalTooltip .item-tooltip .item-image img {
  display: block !important;
  visibility: visible !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  max-width: 220px !important;
  max-height: 180px !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  transform: none !important;
}

/* Reclaim the transparent capture gutters without shrinking the item. */
#tooltip .item-tooltip .item-image img[src*="/webshop-native/"],
#globalTooltip .item-tooltip .item-image img[src*="/webshop-native/"] {
  margin: calc(-1 * var(--tooltip-image-trim, 16px)) auto !important;
}

/* Keep decorative separators hidden. */
#tooltip .item-tooltip hr,
#tooltip .item-tooltip .divider,
#tooltip .item-tooltip .separator,
#tooltip .item-tooltip .line,
#tooltip .item-tooltip .border,
#globalTooltip .item-tooltip hr,
#globalTooltip .item-tooltip .divider,
#globalTooltip .item-tooltip .separator,
#globalTooltip .item-tooltip .line,
#globalTooltip .item-tooltip .border {
  display: none !important;
}

/* Pointer arrow. Drawn on the panel itself, not on the inner .item-tooltip -
   the inner element sits inside the padding, so an arrow hung off it ended up
   overlapping the frame instead of pointing out of it. Blunt triangle: wide
   base, low height, so it reads as a soft pointer rather than a spike. */
#tooltip .item-tooltip::before,
#tooltip .item-tooltip::after,
#globalTooltip .item-tooltip::before,
#globalTooltip .item-tooltip::after {
  display: none !important;
}

#tooltip:has(.item-tooltip)::after,
#globalTooltip:has(.item-tooltip)::after {
  content: "";
  position: absolute;
  top: -9px;
  left: var(--tip-arrow-x, 50%);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 9px solid rgba(96,176,232,.75);
  z-index: 1;
  pointer-events: none;
}

#tooltip.tooltip-above:has(.item-tooltip)::after,
#globalTooltip.tooltip-above:has(.item-tooltip)::after {
  top: auto;
  bottom: -9px;
  border-bottom: none;
  border-top: 9px solid rgba(96,176,232,.75);
}

#tooltip.tooltip-noarrow:has(.item-tooltip)::after,
#globalTooltip.tooltip-noarrow:has(.item-tooltip)::after {
  display: none;
}

/* Name ------------------------------------------------------------------- */

#tooltip .item-tooltip .item-name,
#globalTooltip .item-tooltip .item-name {
  display: block !important;
  position: relative !important;
  z-index: 2 !important;
  margin: 0 0 5px !important;
  padding: 0 !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  /* style_scrap.css left-aligns every .item-name on the page, and a direct
     rule beats the centring the panel only passes down by inheritance. */
  text-align: center !important;
}

#tooltip .item-tooltip .item-name.item-normal,
#globalTooltip .item-tooltip .item-name.item-normal {
  color: #ffffff !important;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.4), 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

#tooltip .item-tooltip .item-name.item-wing,
#globalTooltip .item-tooltip .item-name.item-wing {
  color: #ffd700 !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6), 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

#tooltip .item-tooltip.quality-excellent .item-name:not(.item-wing):not(.item-normal),
#globalTooltip .item-tooltip.quality-excellent .item-name:not(.item-wing):not(.item-normal) {
  color: #35d435 !important;
  text-shadow: 0 0 5px rgba(0, 255, 0, 0.5), 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

#tooltip .item-tooltip.quality-ancient .item-name:not(.item-wing):not(.item-normal),
#globalTooltip .item-tooltip.quality-ancient .item-name:not(.item-wing):not(.item-normal) {
  color: #4b9bf5 !important;
  text-shadow: 0 0 5px rgba(75, 155, 245, 0.45), 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

/* Sections ---------------------------------------------------------------
   No rules between the groups any more - the blocks are only set apart by a
   small gap, so the whole tooltip reads tighter. */

#tooltip .item-tooltip .item-section,
#globalTooltip .item-tooltip .item-section {
  display: block !important;
  margin: 3px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #e0e0e0 !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  text-align: center !important;
}

#tooltip .item-tooltip .item-section + .item-section,
#globalTooltip .item-tooltip .item-section + .item-section {
  margin-top: 5px !important;
}

#tooltip .item-tooltip .item-section.durability,
#globalTooltip .item-tooltip .item-section.durability {
  margin-top: 0 !important;
  color: #ffffff !important;
}

#tooltip .item-tooltip .item-section.requirements,
#globalTooltip .item-tooltip .item-section.requirements {
  margin-top: 4px !important;
  padding: 0 !important;
  color: #ffffff !important;
}

#tooltip .item-tooltip .req-stat,
#globalTooltip .item-tooltip .req-stat {
  color: #ffffff !important;
  font-size: 11.5px !important;
  line-height: 1.4 !important;
}

/* Full-bleed red band: cancel the panel padding so it reaches both edges. */
#tooltip .item-tooltip .req-class,
#globalTooltip .item-tooltip .req-class {
  display: block !important;
  margin: 1px -14px 0 !important;
  padding: 2px 14px !important;
  background: #9d0d0d !important;
  border: 0 !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
}

#tooltip .item-tooltip .req-class:first-of-type,
#globalTooltip .item-tooltip .req-class:first-of-type {
  margin-top: 4px !important;
}

#tooltip .item-tooltip .req-class:last-of-type,
#globalTooltip .item-tooltip .req-class:last-of-type {
  margin-bottom: 4px !important;
}

/* Option lists take the client's light blue, harmony and 380 options gold. */
#tooltip .item-tooltip .item-section.basic,
#tooltip .item-tooltip .item-section.excellent,
#tooltip .item-tooltip .item-section.ancient,
#tooltip .item-tooltip .item-section.sockets,
#globalTooltip .item-tooltip .item-section.basic,
#globalTooltip .item-tooltip .item-section.excellent,
#globalTooltip .item-tooltip .item-section.ancient,
#globalTooltip .item-tooltip .item-section.sockets {
  color: #4b9bf5 !important;
}

#tooltip .item-tooltip .item-section.harmony,
#tooltip .item-tooltip .item-section.special,
#globalTooltip .item-tooltip .item-section.harmony,
#globalTooltip .item-tooltip .item-section.special {
  color: var(--bw-gold, #f7c33c) !important;
  font-weight: 700 !important;
}

/* Scrap status ------------------------------------------------------------ */

#tooltip .item-tooltip .scrap-status,
#globalTooltip .item-tooltip .scrap-status {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  margin: 7px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

#tooltip .item-tooltip .scrap-status.scrapable,
#globalTooltip .item-tooltip .scrap-status.scrapable {
  color: #4ade80 !important;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.45) !important;
}

#tooltip .item-tooltip .scrap-status.scrapable::before,
#globalTooltip .item-tooltip .scrap-status.scrapable::before {
  content: "\26CF\FE0F";
  font-size: 12px;
  line-height: 1;
}

#tooltip .item-tooltip .scrap-status.non-scrapable,
#globalTooltip .item-tooltip .scrap-status.non-scrapable {
  color: #f87171 !important;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.45) !important;
}

#tooltip .item-tooltip .scrap-status.non-scrapable::before,
#globalTooltip .item-tooltip .scrap-status.non-scrapable::before {
  content: "\1F6AB";
  font-size: 11px;
  line-height: 1;
}

/* Ancient set options as their own block (as in the game): space and a thin line above,
   a title, and the options in the ancient green so they don't run into the excellent options. */
#tooltip .item-tooltip .item-section.ancient,
#globalTooltip .item-tooltip .item-section.ancient {
  display: block !important;
  margin: 8px -6px 2px !important;
  padding: 7px 6px 4px !important;
  color: #7bd97a !important;
  border-top: 1px solid rgba(123, 217, 122, .28) !important;
  background: linear-gradient(180deg, rgba(123, 217, 122, .07), transparent 70%) !important;
}
#tooltip .item-tooltip .item-section.ancient .ancient-title,
#globalTooltip .item-tooltip .item-section.ancient .ancient-title {
  display: block !important;
  margin: 0 0 4px !important;
  color: #d8f0b0 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: .8px !important;
  text-transform: uppercase !important;
}
/* the full-set bonuses: a little gap before them and a brighter green */
#tooltip .item-tooltip .item-section.ancient li.is-fullset,
#globalTooltip .item-tooltip .item-section.ancient li.is-fullset { color: #a6ef8f !important; }
#tooltip .item-tooltip .item-section.ancient li:not(.is-fullset) + li.is-fullset,
#globalTooltip .item-tooltip .item-section.ancient li:not(.is-fullset) + li.is-fullset { margin-top: 5px !important; padding-top: 5px !important; border-top: 1px dashed rgba(123, 217, 122, .22) !important; }
