/* ==========================================================================
   AION 2 INTERACTIVE WIKI - HIGH-END ITEM HOVER TOOLTIP & FRAME
   Authentic MMORPG Item Card with Rarity Glow & Cupertino Light Support
   ========================================================================== */

#aion-item-tooltip {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  width: 360px;
  max-width: calc(100vw - 32px);
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  line-height: 1.4;
  text-align: left;
}

#aion-item-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Tooltip Outer Frame Container */
.itt-frame {
  position: relative;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.97) 0%, rgba(9, 13, 22, 0.99) 100%);
  border: 1.5px solid var(--itt-border, rgba(212, 175, 55, 0.6));
  border-radius: 12px;
  padding: 1.1rem;
  color: #e2e8f0;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85),
              0 0 25px var(--itt-glow, rgba(212, 175, 55, 0.2)),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

/* Decorative Corner Accents */
.itt-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--itt-accent, #f59e0b) 50%, transparent 100%);
  opacity: 0.85;
}

/* Header with Icon, Name, and Rarity */
.itt-header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.itt-icon-box {
  position: relative;
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 8px;
  background: #090d16;
  border: 2px solid var(--itt-accent, #64748b);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px var(--itt-glow, transparent);
  overflow: hidden;
  flex-shrink: 0;
  background-image: var(--itt-bg-img, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.itt-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.itt-enchant-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(245, 158, 11, 0.95);
  color: #000;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 1px 4px;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  line-height: 1.1;
}

.itt-title-group {
  flex: 1;
  min-width: 0;
}

.itt-item-name {
  margin: 0 0 0.2rem 0;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--itt-accent, #f59e0b);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  word-break: break-word;
}

.itt-sub-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: #94a3b8;
}

.itt-rarity-pill {
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--itt-pill-bg, rgba(245, 158, 11, 0.15));
  color: var(--itt-accent, #f59e0b);
  border: 1px solid var(--itt-pill-border, rgba(245, 158, 11, 0.4));
}

.itt-level-badge {
  color: #cbd5e1;
  font-weight: 600;
}

/* Meta Bar (Soulbound, Class, Slot) */
.itt-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.76rem;
  color: #cbd5e1;
}

.itt-soulbound {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #38bdf8;
  font-weight: 600;
}

.itt-class-req {
  color: #fbbf24;
  font-weight: 600;
}

/* Stats Section */
.itt-stats-section {
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.itt-section-title {
  margin: 0 0 0.45rem 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-weight: 700;
}

.itt-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.itt-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
}

.itt-stat-label {
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.itt-stat-val {
  font-weight: 700;
  color: #f8fafc;
}

.itt-stat-enchant-bonus {
  font-size: 0.75rem;
  color: #34d399;
  margin-left: 0.25rem;
}

/* Manastone Sockets */
.itt-sockets-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  font-size: 0.78rem;
}

.itt-sockets-label {
  color: #d8b4fe;
  font-weight: 600;
}

.itt-sockets-diamonds {
  display: flex;
  gap: 0.3rem;
  color: #c084fc;
}

/* Set Bonus Box */
.itt-set-box {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-size: 0.78rem;
}

.itt-set-name {
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
}

.itt-set-tier {
  display: flex;
  gap: 0.5rem;
  color: #94a3b8;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.itt-set-tier.is-active {
  color: #7dd3fc;
  font-weight: 600;
}

/* Drop Source & Soulbinding Hint */
.itt-footer-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.6rem;
}

.itt-drop-source {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.itt-soulbinding-tip {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.35;
}

/* Empty Slot Frame */
.itt-empty-frame {
  background: linear-gradient(180deg, #161e2e 0%, #0d131f 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 1rem;
  color: #e2e8f0;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.7);
}

.itt-empty-title {
  color: #38bdf8;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.itt-empty-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

/* Rarity Accent Themes (Aion 2 Official 6-Tier Ladder) */
.itt-rarity--special,
.itt-rarity--ancient {
  --itt-accent: #04ddd9;
  --itt-border: #04ddd9;
  --itt-glow: rgba(4, 221, 217, 0.55);
  --itt-pill-bg: rgba(4, 221, 217, 0.15);
  --itt-pill-border: rgba(4, 221, 217, 0.5);
  --itt-bg-img: url('img/rarity/bg_special.webp');
}

.itt-rarity--heroic,
.itt-rarity--mythic,
.itt-rarity--eternal {
  --itt-accent: #d21046;
  --itt-border: #d21046;
  --itt-glow: rgba(210, 16, 70, 0.55);
  --itt-pill-bg: rgba(210, 16, 70, 0.15);
  --itt-pill-border: rgba(210, 16, 70, 0.5);
  --itt-bg-img: url('img/rarity/bg_mythic.webp');
}

.itt-rarity--unique,
.itt-rarity--fabled {
  --itt-accent: #d3ad0f;
  --itt-border: #d3ad0f;
  --itt-glow: rgba(211, 173, 15, 0.55);
  --itt-pill-bg: rgba(211, 173, 15, 0.15);
  --itt-pill-border: rgba(211, 173, 15, 0.5);
  --itt-bg-img: url('img/rarity/bg_fabled.webp');
}

.itt-rarity--epic,
.itt-rarity--legend {
  --itt-accent: #1383b6;
  --itt-border: #1383b6;
  --itt-glow: rgba(19, 131, 182, 0.55);
  --itt-pill-bg: rgba(19, 131, 182, 0.15);
  --itt-pill-border: rgba(19, 131, 182, 0.5);
  --itt-bg-img: url('img/rarity/bg_heroic.webp');
}

.itt-rarity--rare,
.itt-rarity--superior {
  --itt-accent: #498b35;
  --itt-border: #498b35;
  --itt-glow: rgba(73, 139, 53, 0.5);
  --itt-pill-bg: rgba(73, 139, 53, 0.15);
  --itt-pill-border: rgba(73, 139, 53, 0.5);
  --itt-bg-img: url('img/rarity/bg_superior.webp');
}

.itt-rarity--common {
  --itt-accent: #94a3b8;
  --itt-border: #808080;
  --itt-glow: rgba(128, 128, 128, 0.35);
  --itt-pill-bg: rgba(128, 128, 128, 0.15);
  --itt-pill-border: rgba(128, 128, 128, 0.35);
  --itt-bg-img: url('img/rarity/bg_common.webp');
}

/* ==========================================================================
   APPLE CUPERTINO LIGHT THEME OVERRIDES FOR ITEM TOOLTIP
   ========================================================================== */

html[data-theme="apple"] .itt-frame {
  background: rgba(255, 255, 255, 0.98) !important;
  color: #1c1c1e !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.16),
              0 2px 8px rgba(0, 0, 0, 0.06),
              0 0 0 1.5px var(--itt-accent, #007aff) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
}

html[data-theme="apple"] .itt-item-name {
  text-shadow: none !important;
  color: var(--itt-accent, #007aff) !important;
}

html[data-theme="apple"] .itt-sub-bar {
  color: #636366 !important;
}

html[data-theme="apple"] .itt-meta-row {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  color: #1c1c1e !important;
}

html[data-theme="apple"] .itt-soulbound {
  color: #007aff !important;
}

html[data-theme="apple"] .itt-class-req {
  color: #d97706 !important;
}

html[data-theme="apple"] .itt-stats-section {
  background: #f2f2f7 !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="apple"] .itt-section-title {
  color: #8e8e93 !important;
}

html[data-theme="apple"] .itt-stat-label {
  color: #48484a !important;
}

html[data-theme="apple"] .itt-stat-val {
  color: #1c1c1e !important;
}

html[data-theme="apple"] .itt-stat-enchant-bonus {
  color: #248a3d !important;
}

html[data-theme="apple"] .itt-sockets-row {
  background: rgba(175, 82, 222, 0.08) !important;
  border: 1px solid rgba(175, 82, 222, 0.25) !important;
}

html[data-theme="apple"] .itt-sockets-label {
  color: #af52de !important;
}

html[data-theme="apple"] .itt-sockets-diamonds {
  color: #af52de !important;
}

html[data-theme="apple"] .itt-set-box {
  background: rgba(0, 122, 255, 0.06) !important;
  border: 1px solid rgba(0, 122, 255, 0.25) !important;
}

html[data-theme="apple"] .itt-set-name {
  color: #007aff !important;
}

html[data-theme="apple"] .itt-set-tier {
  color: #636366 !important;
}

html[data-theme="apple"] .itt-set-tier.is-active {
  color: #007aff !important;
}

html[data-theme="apple"] .itt-footer-info {
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #636366 !important;
}

html[data-theme="apple"] .itt-drop-source {
  color: #48484a !important;
}

html[data-theme="apple"] .itt-soulbinding-tip {
  background: rgba(175, 82, 222, 0.08) !important;
  border: 1px solid rgba(175, 82, 222, 0.25) !important;
  color: #af52de !important;
}

html[data-theme="apple"] .itt-empty-frame {
  background: #ffffff !important;
  border: 1.5px solid rgba(0, 122, 255, 0.3) !important;
  color: #1c1c1e !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12) !important;
}

html[data-theme="apple"] .itt-empty-title {
  color: #007aff !important;
}

html[data-theme="apple"] .itt-empty-desc {
  color: #636366 !important;
}

