/* =========================================================
   Category pages (filters + WoWHead-style results list)
   ========================================================= */

/* Center the main wiki page title */
.wk-page-title{
  text-align: center;
  margin: 0 0 14px;
  font-weight: 900;
  letter-spacing: .02em;
  color: var(--wk-gold);
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

/* Page wrapper for category content */
.wk-cat{
  /* center the entire category content area */
  max-width: 1100px;
  margin: 0 auto;
}

.wk-filter-toggle{
  width: 100%;
  max-width: 1100px;
  margin: 12px auto 14px;
}

.wk-filter-toggle__summary{
  list-style: none;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(0,0,0,.30);
  color: var(--wk-text);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.wk-filter-toggle__summary::-webkit-details-marker{
  display: none;
}

.wk-filter-toggle__summary::after{
  content: "+";
  font-size: 1.1rem;
  line-height: 1;
  color: rgba(255,255,255,.85);
}

.wk-filter-toggle[open] .wk-filter-toggle__summary{
  margin-bottom: 10px;
}

.wk-filter-toggle[open] .wk-filter-toggle__summary::after{
  content: "−";
}

/* =========================
   Filter box (centered)
   ========================= */
.wk-cat__filter{
  /* center the filter box itself */
  width: 100%;
  max-width: 1100px;
  margin: 12px auto 14px;

  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.20);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}

.wk-filter-toggle .wk-cat__filter{
  margin: 0;
  max-width: none;
}

/* rows */
.wk-cat__row{
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.wk-cat__row--one{
  grid-template-columns: 1fr;
}

.wk-cat__row--two{
  grid-template-columns: 1fr 1fr;
}

/* Inputs + selects match your .wk-search input vibe */
.wk-cat__input,
.wk-cat__select{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(0,0,0,.30);
  color: var(--wk-text);
  outline: none;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.wk-cat__input::placeholder{
  color: rgba(255,255,255,.65);
}

/* Select arrow styling */
.wk-cat__select{
  width: 100%;
  height: 44px;                      /* consistent height */
  padding: 11px 44px 11px 12px;      /* room for custom arrow */
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.24);
  background-color: rgba(0,0,0,.30);
  color: var(--wk-text);
  outline: none;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* custom arrow */
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.80) 50%),
    linear-gradient(135deg, rgba(255,255,255,.80) 50%, transparent 50%),
    linear-gradient(to right, rgba(255,255,255,.10), rgba(255,255,255,0));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    calc(100% - 44px) 50%;
  background-size:
    6px 6px,
    6px 6px,
    1px 22px;
  background-repeat: no-repeat;
}

/* Focus glow consistent with site */
.wk-cat__input:focus,
.wk-cat__select:focus{
  border-color: rgba(139,196,255,.55);
  box-shadow: 0 0 0 3px rgba(139,196,255,.12);
}

/* Filter button */
.wk-cat__btn{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(0,0,0,.30);
  color: var(--wk-text);
  padding: 11px 12px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: .02em;
}

.wk-cat__btn:hover{
  background: rgba(0,0,0,.38);
}

.wk-cat__empty{
  margin: 12px auto 0;
  max-width: 1100px;
  color: rgba(255,255,255,.75);
}

/* =========================
   WoWHead-style results list
   ========================= */
.wk-list{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 18px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
}

/* header row */
.wk-list__head{
  display: grid;
  grid-template-columns: 1fr 90px 140px 180px;
  gap: 10px;

  padding: 12px 14px;
  background: rgba(0,0,0,.28);
  border-bottom: 1px solid rgba(255,255,255,.10);

  font-weight: 900;
  color: rgba(255,255,255,.88);
  letter-spacing: .02em;
}

.wk-list__col--lvl,
.wk-list__col--rar,
.wk-list__col--fac{
  text-align: center;
}

/* row */
.wk-row{
  display: grid;
  grid-template-columns: 1fr 90px 140px 180px;
  gap: 10px;

  padding: 10px 14px;
  align-items: center;

  text-decoration: none;
  color: rgba(255,255,255,.92);

  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}

.wk-section-list--npc .wk-list__head,
.wk-section-list--npc .wk-row{
  grid-template-columns: minmax(0, 1fr) max-content;
}

.wk-section-list--npc .wk-list__col--fac,
.wk-section-list--npc .wk-row__fac{
  justify-self: end;
  text-align: right;
  min-width: 1ch;
}

.wk-section-list--monsters .wk-list__head,
.wk-section-list--monsters .wk-row{
  grid-template-columns: minmax(0, 1fr) max-content;
}

.wk-section-list--monsters .wk-list__col--lvl,
.wk-section-list--monsters .wk-row__lvl{
  justify-self: end;
  text-align: right;
}

.wk-section-list--monsters .wk-row__lvl{
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.wk-row:hover{
  background: rgba(255,255,255,.05);
  text-decoration: none;
}

.wk-row:hover .wk-row__title{
  text-decoration: none;
}

/* name cell */
.wk-row__name{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wk-row--npc .wk-row__name::before{
  content: "";
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 auto;
}

/* icon pinned left */
.wk-row__icon{
  flex: 0 0 auto;
  display: grid;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 10px 26px rgba(0,0,0,.35);
  background: rgba(0,0,0,.25);
  overflow: hidden;
}

/* default non-stackable = 64 */
.wk-row__icon.is-gear{
  width: 64px;
  height: 64px;
  padding: 6px;
}

/* stackable = 32 */
.wk-row__icon.is-stack{
  width: 64px;
  height: 64px;
  padding: 6px;
}

.wk-row__icon.is-skill{
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(0,0,0,.28);
}

.wk-row__icon.is-empty{
  visibility: hidden;
}

.wk-npc-shop__icon{
  width: 36px;
  height: 36px;
  padding: 4px;
  margin-right: 10px;
}

.wk-npc-shop__name{
  vertical-align: middle;
  display: inline-block;
}

.wk-npc-shop__item{
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  column-gap: 10px;
  justify-content: start;
  flex: 1 1 auto;
}

.wk-npc-shop__item .wk-row__icon{
  flex: 0 0 auto;
}

.wk-npc-shop__item a{
  display: inline-block;
  white-space: nowrap;
}

.wk-npc-shop__price{
  display: block;
  text-align: right;
}

.wk-npc-shop__prices{
  display: grid !important;
  grid-auto-flow: row;
  align-items: center;
  justify-items: end;
  gap: 2px;
  white-space: nowrap;
}

.wk-npc-shop__statKey{
  display: flex;
  align-items: center;
  gap: 10px;
}

.wk-npc-shop__row{
  display: grid;
  grid-template-columns: clamp(120px, 18vw, 200px) 1fr clamp(120px, 18vw, 200px);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  position: relative;
}

.wk-npc-shop__cell--prices{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.wk-npc-shop__cell{
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
}

.wk-npc-shop__cell--icon{
  justify-content: center;
  align-items: center;
}

.wk-npc-shop__row:not(.wk-npc-skill__row) .wk-npc-shop__cell--icon{
  justify-content: flex-start;
  padding-left: 6px;
}

.wk-npc-shop__cell--name{
  justify-content: center;
  text-align: center;
  width: 100%;
}

/* Center shop item names on the full card, independent of price width */
.wk-npc-shop__row:not(.wk-npc-skill__row) .wk-npc-shop__cell--name{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(220px, 40%, 520px);
  justify-content: center;
  text-align: center;
  z-index: 1;
}

.wk-npc-shop__row:not(.wk-npc-skill__row) .wk-npc-shop__cell--prices{
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(140px, 20vw, 220px);
  align-items: flex-end;
  text-align: right;
  z-index: 1;
}

.wk-npc-skill__row.wk-skill-detail__stat{
  display: grid !important;
  align-items: center !important;
  grid-template-columns: 1fr auto 1fr;
}

.wk-npc-shop__name{
  line-height: 1.2;
}

.wk-npc-shop__cell--name .wk-item-detail__link{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: inherit;
  text-shadow: none;
}

.wk-npc-shop__cell--name .wk-item-detail__link:hover,
.wk-npc-shop__cell--name .wk-item-detail__link:focus-visible{
  color: inherit;
  text-shadow: 0 0 10px rgba(255,255,255,.18);
}

.wk-npc-skill__row .wk-npc-shop__cell--prices{
  align-items: center;
  justify-content: flex-end;
}

.wk-npc-skill__row .wk-npc-shop__cell--icon{
  justify-content: flex-start;
}

.wk-npc-skill__row .wk-npc-shop__cell--name{
  justify-content: center;
  text-align: center;
}

.wk-npc-shop__row:not(.wk-npc-skill__row) .wk-npc-shop__name{
  font-size: 1.25rem;
  font-weight: 800;
  width: 100%;
  text-align: center;
}

.wk-npc-skill__row .wk-row__icon.is-skill{
  width: 66px;
  height: 66px;
  padding: 0;
  margin: 0;
}

.wk-npc-shop__cell--icon .wk-row__icon{
  width: 64px;
  height: 64px;
  padding: 6px;
  margin: 0;
}

.wk-npc-shop__price{
  white-space: nowrap;
}

.wk-row__icon img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wk-row__icon.is-skill img{
  object-fit: contain;
  padding: 4px;
  box-sizing: border-box;
}

.wk-row__title{
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255,255,255,.94);
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

/* columns */
.wk-row__lvl,
.wk-row__rar,
.wk-row__fac{
  color: rgba(255,255,255,.78);
  font-weight: 800;
  text-align: center;
}

/* Optional: color hint by rarity string (if you want) */
.wk-row__rar{
  text-transform: capitalize;
}

/* =========================
   Mobile adjustments
   ========================= */
@media (max-width: 760px){
  /* stack filter rows */
  .wk-cat__row--two{
    grid-template-columns: 1fr;
  }

  /* hide header row like WoWHead mobile */
  .wk-list__head{
    display: none;
  }

  .wk-section-list--monsters .wk-list__head{
    display: grid;
  }

  /* each result becomes a compact stacked row */
  .wk-row{
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 14px;
  }

  .wk-row__lvl,
  .wk-row__rar,
  .wk-row__fac{
    padding-left: 74px; /* aligns under name next to 64px icon */
    font-size: .92rem;
  }

  /* when stackable icons (32px), reduce indentation */
  .wk-row:has(.wk-row__icon.is-stack) .wk-row__lvl,
  .wk-row:has(.wk-row__icon.is-stack) .wk-row__rar,
  .wk-row:has(.wk-row__icon.is-stack) .wk-row__fac{
    padding-left: 46px;
  }
}

/* Older browsers fallback (no :has support) */
@media (max-width: 760px){
  .wk-row__icon.is-stack + .wk-row__title{
    /* no-op fallback */
  }
}

/* =========================
   Rarity colors (name text)
   ========================= */
.wk-q-common    { color: #ffffff; }  /* Common = white */
.wk-q-unique    { color: #ebab0b9d; }  /* Unique = gold */
.wk-q-rare      { color: #ffd24a; }  /* Rare = yellow */
.wk-q-elite     { color: #b86bff; }  /* Elite = purple */
.wk-q-legendary { color: #ff8a2a; }  /* Legendary = orange */
.wk-q-celestial { color: #76d7ff; }  /* Celestial = light blue */

/* =========================
   Faction colors
   ========================= */
.wk-f-guanyin { color: #03752b; }  /* green */
.wk-f-fujin   { color: #007eb4; }  /* light blue */
.wk-f-jinong  { color: #ff8a2a; }  /* orange */
.wk-f-nangin  { color: #97014c; }  /* optional: keep white/default */
.wk-f-all-factions { color: #ffffff; }
.wk-f-pvp { color: #ff4d4f; }
.wk-f-war { color: #ff4d4f; }

/* Keep readability */
.wk-row__title{
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
}

.wk-cat__select:hover{
  border-color: rgba(255,255,255,.30);
  background-color: rgba(0,0,0,.36);
}

.wk-cat__select:focus{
  border-color: rgba(139,196,255,.55);
  box-shadow: 0 0 0 3px rgba(139,196,255,.12);
}

/* Option colors (important: many browsers render option lists in system UI) */
.wk-cat__select option{
  color: #0b0f17;           /* dark text in dropdown list */
  background: #eef4ff;      /* light background */
}

/* Disabled select styling (if you ever use it) */
.wk-cat__select:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* =========================
   Custom Dropdown (black menu)
   ========================= */
.wk-dd{ position: relative; }

.wk-dd__native{
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

/* visible "select" */
.wk-dd__btn{
  width: 100%;
  height: 50px;
  padding: 11px 20px 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(0,0,0,.30);
  color: var(--wk-text);
  text-align: left;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.wk-dd__btn:hover{
  background: rgba(0,0,0,.36);
  border-color: rgba(255,255,255,.30);
}

.wk-dd.is-open .wk-dd__btn{
  border-color: rgba(139,196,255,.55);
  box-shadow: 0 0 0 3px rgba(139,196,255,.12);
}
.wk-dd__btnText{
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;       /* prevents super-wide label */
}

.wk-dd__chev{
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255,255,255,.80); /* was 3px */
  border-bottom: 2px solid rgba(255,255,255,.80);/* was 3px */
  transform: rotate(45deg);
  margin-top: -1px;
  flex: 0 0 auto;
}

/* menu */
.wk-dd__menu{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 9999;

  display: none;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,12,20,.98);     /* black themed */
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  max-height: 280px;
  overflow: auto;
}

.wk-dd.is-open .wk-dd__menu{ display: block; }

.wk-dd__opt{
  width: 100%;
  display: block;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,.90);
  cursor: pointer;
}

.wk-dd__opt:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

.wk-dd__opt.is-active{
  background: rgba(139,196,255,.10);
  border-color: rgba(139,196,255,.20);
}

.wk-section-list .wk-list__head,
.wk-section-list .wk-row{
  grid-template-columns: 1fr;
}

.wk-section-list--skills .wk-list__head,
.wk-section-list--skills .wk-row,
.wk-section-list--monsters .wk-list__head,
.wk-section-list--monsters .wk-row,
.wk-section-list--npc .wk-list__head,
.wk-section-list--npc .wk-row{
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
}

.wk-section-list--skills .wk-list__col--fac,
.wk-section-list--skills .wk-row__fac,
.wk-section-list--monsters .wk-list__col--lvl,
.wk-section-list--monsters .wk-row__lvl,
.wk-section-list--npc .wk-list__col--fac,
.wk-section-list--npc .wk-row__fac{
  justify-self: end;
  text-align: right;
  min-width: 1ch;
}

.wk-section-list--npc .wk-list__col--name,
.wk-section-list--npc .wk-list__col--fac,
.wk-section-list--npc .wk-row__name,
.wk-section-list--npc .wk-row__fac{
  display: flex;
  align-items: center;
}

.wk-section-list--monsters .wk-list__col--name,
.wk-section-list--monsters .wk-list__col--lvl,
.wk-section-list--monsters .wk-row__name,
.wk-section-list--monsters .wk-row__lvl{
  display: flex;
  align-items: center;
}

.wk-section-list--npc .wk-list__col--fac,
.wk-section-list--npc .wk-row__fac{
  justify-content: flex-end;
}

.wk-fac-label-short,
.wk-fac-value-short{
  display: none;
}

@media (max-width: 760px){
  .wk-section-list--skills .wk-row__fac{
    padding-left: 0;
  }

  .wk-fac-label-full,
  .wk-fac-value-full{
    display: none;
  }

  .wk-fac-label-short,
  .wk-fac-value-short{
    display: inline;
  }
}
