/* ==========================================================================
   mu-online-attributes.css
   High-quality UI for MU Online attribute pages (items/maps/skills)
   Focus here: items.php (compact requirements in Item column)
   ========================================================================== */

:root{
  --attr-accent:        var(--ranking-primary, #a20707);
  --attr-accent-dark:   var(--ranking-primary-dark, #750404);
  --attr-gold:          var(--ranking-gold, linear-gradient(90deg, #ffe680 0%, #ffd700 45%, #fff3b0 100%));

  --attr-border:        var(--ranking-box-border, #e6e8ea);
  --attr-surface:       var(--ranking-box-bg, #fafbfc);

  --attr-text:          var(--text-main, #1f2937);
  --attr-muted:         var(--text-muted, #6b7280);

  --attr-input-bg:      var(--secondary-bg, #fff);
  --attr-input-border:  var(--border-light, var(--attr-border));

  --attr-th-bg:         linear-gradient(92deg, var(--attr-accent) 0%, var(--attr-accent-dark) 100%);
  --attr-th-color:      #fff;

  --attr-row-even:      #f6f7fb;
  --attr-row-hover:     #eef0f4;

  --attr-cell-border:   rgba(0,0,0,.07);
  --attr-radius:        18px;
  --attr-radius-sm:     12px;

  --sticky-id-w:        92px; /* used for sticky columns */
}

/* Basic helpers */
.attr-help{
  color: var(--attr-muted);
  font-size: .96rem;
  margin-top: .35rem;
}

/* Filters grid */
.item-filters .event-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.05rem 1.45rem;
  margin-top: 1rem;
  align-items: end;
}

.item-filters label{
  display:block;
  margin-bottom: .35rem;
  font-size: .95rem;
  font-weight: 900;
  color: var(--attr-text);
}

.item-filters input[type="search"],
.item-filters input[type="number"],
.item-filters select{
  width: 100%;
  padding: .64rem .8rem;
  border-radius: 12px;
  border: 1.4px solid var(--attr-input-border);
  background: var(--attr-input-bg);
  color: var(--attr-text);
  font-size: .98rem;
  font-weight: 650;
  outline: none;
  box-shadow: 0 1px 6px rgba(20, 20, 20, .05);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.item-filters input::placeholder{
  color: rgba(107,114,128,.78);
  font-weight: 600;
}

.item-filters input:focus,
.item-filters select:focus{
  border-color: var(--attr-accent);
  box-shadow: 0 0 0 3px rgba(162, 7, 7, .12), 0 1px 8px rgba(20,20,20,.06);
}

.item-results-meta{
  margin-top: .85rem;
  font-size: .95rem;
  color: var(--attr-muted);
}

#item-results-count{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  padding: .12rem .55rem;
  border-radius: 999px;
  background: rgba(255, 215, 0, .12);
  border: 1px solid rgba(255, 215, 0, .25);
  color: var(--attr-accent-dark);
  font-weight: 950;
}

/* Buttons */
.attr-filter-actions{
  display:flex;
  justify-content:flex-end;
  gap:.65rem;
  flex-wrap:wrap;
  margin-top: 1rem;
}

.attr-btn{
  appearance:none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .62rem 1.15rem;
  font-weight: 950;
  font-size: .98rem;
  cursor:pointer;
  user-select:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}

.attr-btn:focus-visible{
  outline: 2px solid rgba(255,215,0,.65);
  outline-offset: 2px;
}

.attr-btn-primary{
  background: var(--attr-gold);
  color: var(--attr-accent-dark);
  border-color: rgba(255, 215, 0, .35);
  box-shadow: 0 10px 24px rgba(255, 215, 0, .14), 0 2px 10px rgba(0,0,0,.06);
}

.attr-btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(255, 215, 0, .18), 0 3px 14px rgba(0,0,0,.08);
}

.attr-btn-ghost{
  background: transparent;
  color: var(--attr-accent);
  border-color: var(--attr-border);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.attr-btn-ghost:hover{
  background: rgba(255,255,255,.75);
  border-color: rgba(162, 7, 7, .25);
  transform: translateY(-1px);
}

@media (max-width: 750px){
  .attr-filter-actions{ justify-content: stretch; }
  .attr-btn{ flex: 1 1 160px; }
}

/* Table wrapper */
.responsive-table{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--attr-radius-sm);
  border: 2px solid var(--attr-border);
  background: var(--attr-surface);
  box-shadow: 0 2px 14px rgba(30, 30, 30, .06);
  position: relative;
}

.responsive-table > table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
  margin: 0;
}

#item-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--attr-th-bg);
  color: var(--attr-th-color);
  font-weight: 950;
  letter-spacing: .03em;
  padding: .78rem .9rem;
  white-space: nowrap;
  border-bottom: 2px solid rgba(255, 215, 0, .22);
}

#item-table tbody td{
  padding: .72rem .9rem;
  border-bottom: 1px solid var(--attr-cell-border);
  background: var(--attr-input-bg);
  color: var(--attr-text);
  vertical-align: top;
}

#item-table tbody tr:nth-child(even) td{
  background: var(--attr-row-even);
}
#item-table tbody tr:hover td{
  background: var(--attr-row-hover);
}

/* Links */
.item-link{
  color: var(--attr-accent);
  text-decoration: none;
  font-weight: 950;
  letter-spacing: .01em;
}
.item-link:hover,
.item-link:focus{
  color: var(--attr-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Column sizing (new, compact table) */
.responsive-table #item-table{
  min-width: 1080px;
}

#item-table td,
#item-table th{
  text-align: center;
}

.item-id-cell{
  width: var(--sticky-id-w);
  white-space: nowrap;
  text-align: right !important;
  font-weight: 950;
  color: var(--attr-accent-dark);
}

.item-cell{
  text-align: left !important;
  min-width: 520px;
}

.item-role-cell{
  text-align: left !important;
  min-width: 180px;
}

.item-stat-cell{
  min-width: 150px;
}

.item-class-cell{
  text-align: left !important;
  min-width: 320px;
}

/* Sticky first columns (ID + Item) */
@media (min-width: 900px){
  #item-table thead th:nth-child(1),
  #item-table tbody td:nth-child(1){
    position: sticky;
    left: 0;
    z-index: 6;
    box-shadow: 2px 0 0 rgba(0,0,0,.05);
  }

  #item-table thead th:nth-child(2),
  #item-table tbody td:nth-child(2){
    position: sticky;
    left: var(--sticky-id-w);
    z-index: 5;
    box-shadow: 2px 0 0 rgba(0,0,0,.05);
  }

  #item-table thead th:nth-child(1),
  #item-table thead th:nth-child(2){
    z-index: 10;
  }
}

/* Item meta + short description */
.item-row-meta{
  margin-top: .22rem;
  font-size: .88rem;
  font-weight: 750;
  color: var(--attr-muted);
}

.item-row-desc{
  margin-top: .35rem;
  font-size: .94rem;
  line-height: 1.5;
  color: rgba(107,114,128,.92);
}

/* Role pill inside Item column */
.item-role-pill{
  display: inline-flex;
  align-items: center;
  margin-left: .35rem;
  padding: 0.05rem .5rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(162, 7, 7, .06);
  border: 1px solid rgba(162, 7, 7, .22);
  color: var(--attr-accent-dark);
  white-space: nowrap;
}

/* Requirements mini grid */
.item-mini-stats{
  list-style: none;
  margin: .7rem 0 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .45rem;
}

.item-mini-stats li{
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.55);
  border-radius: 12px;
  padding: .44rem .6rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .65rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}

.item-mini-stats li span{
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(107,114,128,.86);
  font-weight: 900;
  white-space: nowrap;
}

.item-mini-stats li strong{
  font-size: .95rem;
  font-weight: 950;
  color: var(--attr-accent-dark);
  white-space: nowrap;
}

/* Item type goes full-width */
.item-mini-stats li.is-wide{
  grid-column: 1 / -1;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.item-mini-stats li.is-wide strong{
  white-space: normal;
}

/* Downplay zeros */
.item-mini-stats li.is-zero{
  background: rgba(107,114,128,.06);
  border-color: rgba(107,114,128,.12);
}
.item-mini-stats li.is-zero strong{
  color: rgba(107,114,128,.85);
  font-weight: 850;
}

/* No results */
.no-results{
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: #fcf7e7;
  border: 1.5px dashed rgba(255, 215, 0, .35);
  color: var(--attr-accent);
  text-align: center;
  font-weight: 850;
}

/* Class chips (Class & stage column + detail view) */
.class-pill-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:.3rem .45rem;
}

.class-pill-list-large{
  gap:.5rem .7rem;
}

.class-pill{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.25rem .5rem;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.06);
  background:rgba(255,255,255,.85);
  box-shadow:0 1px 4px rgba(15,23,42,.05);
  max-width:100%;
}

.class-pill-icon{
  width:18px;
  height:18px;
  flex:0 0 auto;
}

.class-pill-text{
  display:flex;
  flex-direction:column;
  line-height:1.15;
  max-width:100%;
}

.class-pill-short{
  font-size:.78rem;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--attr-accent-dark);
}

.class-pill-sub{
  font-size:.8rem;
  font-weight:600;
  color:rgba(31,41,55,.86);
}

.class-pill-empty{
  font-size:.9rem;
  color:var(--attr-muted);
}

/* Mobile */
@media (max-width: 750px){
  #item-table thead th{
    padding: .68rem .75rem;
    font-size: .92rem;
  }
  #item-table tbody td{
    padding: .62rem .75rem;
    font-size: .92rem;
  }
  .item-mini-stats{
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
