/* ============================================================
   R6 Marketplace Price Tracker — style.css
   Fully scoped to #r6pt-root. No global overrides.
   Fonts: Rajdhani (headings) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

/* ── CSS Custom Properties (scoped) ─────────────────────────── */
#r6pt-root {
  --r6-bg:           #0b0d11;
  --r6-surface:      #111318;
  --r6-surface-2:    #181b22;
  --r6-border:       rgba(255,255,255,0.07);
  --r6-border-accent:rgba(255,200,30,0.25);
  --r6-yellow:       #f5c400;
  --r6-yellow-dim:   #c49a00;
  --r6-green:        #2ecc71;
  --r6-red:          #e74c3c;
  --r6-text-primary: #e8eaf0;
  --r6-text-secondary:#8b90a0;
  --r6-text-dim:     #555966;
  --r6-hover-bg:     rgba(245,196,0,0.04);
  --r6-glow:         0 0 20px rgba(245,196,0,0.08);
  --r6-radius:       6px;
  --r6-font-head:    'Rajdhani', sans-serif;
  --r6-font-body:    'Inter', sans-serif;

  /* Reset + contain */
  all: initial;
  display: block;
  box-sizing: border-box;
  font-family: var(--r6-font-body);
  background: transparent;
  width: 100%;
  color: var(--r6-text-primary);
  line-height: 1.5;
}

#r6pt-root *, #r6pt-root *::before, #r6pt-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
#r6pt-root .r6pt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--r6-surface);
  border: 1px solid var(--r6-border);
  border-bottom: none;
  border-radius: var(--r6-radius) var(--r6-radius) 0 0;
}

#r6pt-root .r6pt-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

#r6pt-root .r6pt-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--r6-green);
  box-shadow: 0 0 6px var(--r6-green);
  animation: r6pt-pulse 2s ease-in-out infinite;
}

@keyframes r6pt-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

#r6pt-root .r6pt-live-label {
  font-family: var(--r6-font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--r6-text-secondary);
  text-transform: uppercase;
}

#r6pt-root .r6pt-updated-label {
  font-size: 11px;
  color: var(--r6-text-dim);
  font-family: var(--r6-font-body);
}

/* ── Table Wrapper ───────────────────────────────────────────── */
#r6pt-root .r6pt-table-wrap {
  background: var(--r6-surface);
  border: 1px solid var(--r6-border);
  border-radius: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Row Layout ──────────────────────────────────────────────── */
#r6pt-root .r6pt-row {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 130px 120px 120px 110px 110px;
  align-items: center;
  border-bottom: 1px solid var(--r6-border);
  min-width: 720px;
}

#r6pt-root .r6pt-row:last-child {
  border-bottom: none;
}

/* ── Header Row ──────────────────────────────────────────────── */
#r6pt-root .r6pt-header-row {
  background: linear-gradient(135deg, #13161e 0%, #0f1117 100%);
  border-bottom: 1px solid var(--r6-border-accent);
  position: sticky;
  top: 0;
  z-index: 2;
}

#r6pt-root .r6pt-header-row .r6pt-cell {
  font-family: var(--r6-font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--r6-yellow);
  padding: 14px 16px;
}

/* ── Data Rows ───────────────────────────────────────────────── */
#r6pt-root .r6pt-data-row {
  background: var(--r6-surface);
  transition: background 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
  animation: r6pt-row-in 0.3s ease both;
}

#r6pt-root .r6pt-data-row:nth-child(even) {
  background: var(--r6-surface-2);
}

#r6pt-root .r6pt-data-row:hover {
  background: var(--r6-hover-bg);
  box-shadow: inset 2px 0 0 var(--r6-yellow);
}

@keyframes r6pt-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cells ───────────────────────────────────────────────────── */
#r6pt-root .r6pt-cell {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--r6-text-primary);
  font-family: var(--r6-font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#r6pt-root .r6pt-col-skin {
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
}

#r6pt-root .r6pt-col-skin .r6pt-skin-rank {
  display: inline-block;
  width: 20px;
  font-size: 10px;
  color: var(--r6-text-dim);
  font-weight: 600;
  margin-right: 6px;
  font-family: var(--r6-font-head);
  letter-spacing: 0.5px;
}

#r6pt-root .r6pt-col-price {
  font-family: var(--r6-font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--r6-text-primary);
  letter-spacing: 0.5px;
}

#r6pt-root .r6pt-col-avg,
#r6pt-root .r6pt-col-low,
#r6pt-root .r6pt-col-high {
  color: var(--r6-text-secondary);
  font-size: 13px;
}

/* ── Change Badge ─────────────────────────────────────────────── */
#r6pt-root .r6pt-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--r6-font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

#r6pt-root .r6pt-change.positive {
  color: var(--r6-green);
  background: rgba(46,204,113,0.1);
}

#r6pt-root .r6pt-change.negative {
  color: var(--r6-red);
  background: rgba(231,76,60,0.1);
}

#r6pt-root .r6pt-change.neutral {
  color: var(--r6-text-dim);
  background: rgba(255,255,255,0.04);
}

#r6pt-root .r6pt-change-arrow {
  font-size: 10px;
}

/* ── Loading State ───────────────────────────────────────────── */
#r6pt-root .r6pt-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--r6-text-secondary);
  font-size: 13px;
  min-width: 720px;
}

#r6pt-root .r6pt-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--r6-border);
  border-top-color: var(--r6-yellow);
  border-radius: 50%;
  animation: r6pt-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes r6pt-spin {
  to { transform: rotate(360deg); }
}

#r6pt-root .r6pt-error {
  padding: 32px 24px;
  text-align: center;
  color: var(--r6-red);
  font-size: 13px;
  min-width: 720px;
}

/* ── Footer ──────────────────────────────────────────────────── */
#r6pt-root .r6pt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background: var(--r6-surface);
  border: 1px solid var(--r6-border);
  border-top: 1px solid var(--r6-border-accent);
  border-radius: 0 0 var(--r6-radius) var(--r6-radius);
}

/* ── Pagination ──────────────────────────────────────────────── */
#r6pt-root .r6pt-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

#r6pt-root .r6pt-page-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  font-family: var(--r6-font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--r6-text-secondary);
  border: 1px solid var(--r6-border);
  background: var(--r6-surface-2);
  transition: all 0.15s ease;
  letter-spacing: 0.5px;
}

#r6pt-root .r6pt-page-btn:hover {
  color: var(--r6-yellow);
  border-color: var(--r6-yellow-dim);
  background: rgba(245,196,0,0.06);
}

#r6pt-root .r6pt-page-btn.active {
  color: var(--r6-bg);
  background: var(--r6-yellow);
  border-color: var(--r6-yellow);
  box-shadow: 0 0 12px rgba(245,196,0,0.3);
}

#r6pt-root .r6pt-page-btn:disabled,
#r6pt-root .r6pt-page-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

#r6pt-root .r6pt-page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--r6-text-dim);
  font-size: 13px;
}

/* ── View Complete List Button ───────────────────────────────── */
#r6pt-root .r6pt-btn-viewall {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--r6-yellow-dim);
  border-radius: 4px;
  font-family: var(--r6-font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--r6-yellow);
  transition: all 0.15s ease;
  width: 80%;
  justify-content: center;
  margin: auto !important;
}

#r6pt-root .r6pt-btn-viewall:hover {
  background: rgba(245,196,0,0.08);
  border-color: var(--r6-yellow);
  box-shadow: 0 0 16px rgba(245,196,0,0.15);
}

#r6pt-root .r6pt-btn-viewall:hover .r6pt-arrow {
  transform: translateX(4px);
}

#r6pt-root .r6pt-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}

/* ── Disclaimer ──────────────────────────────────────────────── */
#r6pt-root .r6pt-disclaimer {
  font-size: 10.5px;
  color: var(--r6-text-dim);
  text-align: center;
  padding: 10px 16px 0;
  font-family: var(--r6-font-body);
  line-height: 1.6;
}

/* ── Responsive: Tablet ──────────────────────────────────────── */
@media (max-width: 900px) {
  #r6pt-root .r6pt-row {
    grid-template-columns: minmax(160px, 2fr) 110px 100px 100px 90px 90px;
  }

  #r6pt-root .r6pt-cell {
    padding: 11px 12px;
    font-size: 12.5px;
  }
}

/* ── Responsive: Mobile ──────────────────────────────────────── */
@media (max-width: 600px) {
  #r6pt-root .r6pt-table-wrap {
    overflow-x: auto;
  }

  #r6pt-root .r6pt-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  #r6pt-root .r6pt-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #r6pt-root .r6pt-btn-viewall {
    width: 100%;
    justify-content: center;
  }

  #r6pt-root .r6pt-pagination {
    justify-content: center;
    width: 100%;
  }
}

/* ── Skeleton Loader ─────────────────────────────────────────── */
#r6pt-root .r6pt-skeleton {
  display: block;
  background: linear-gradient(90deg, var(--r6-surface-2) 25%, rgba(255,255,255,0.04) 50%, var(--r6-surface-2) 75%);
  background-size: 200% 100%;
  border-radius: 3px;
  animation: r6pt-shimmer 1.4s ease infinite;
}

@keyframes r6pt-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
