/* Player Inspector - Styles (theme gold/warning #d9963c) */

/* ============================================
   SEARCH BAR
   ============================================ */
.pi-search-bar {
  position: relative;
}

.pi-search-bar .input-group-lg .form-control {
  font-size: 1rem;
}

.pi-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2000;
  max-height: 350px;
  overflow-y: auto;
  background: #241710;
  border: 1px solid rgba(154, 138, 78, 0.3);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.pi-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(58, 42, 30, 0.3);
}

.pi-search-item:hover {
  background: rgba(154, 138, 78, 0.1);
}

.pi-search-item:last-child {
  border-bottom: none;
}

.pi-search-name {
  font-weight: 700;
  color: #e9ecef;
  font-size: 0.9rem;
}

.pi-search-meta {
  font-size: 0.78rem;
  color: #b49a82;
}

.pi-search-badges {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* ============================================
   WELCOME
   ============================================ */
.pi-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
  text-align: center;
}

.pi-welcome-icon {
  font-size: 4rem;
  color: #d9963c;
  opacity: 0.35;
  margin-bottom: 16px;
}

.pi-welcome h4 {
  color: #e9ecef;
  font-weight: 700;
}

/* ============================================
   HEADER (player card)
   ============================================ */
.pi-header {
  background: linear-gradient(135deg, rgba(154, 138, 78, 0.08), rgba(154, 138, 78, 0.04));
  border: 1px solid rgba(154, 138, 78, 0.2);
  border-radius: 12px;
  padding: 20px 24px;
}

.pi-header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.pi-header-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(154, 138, 78, 0.15);
  border: 2px solid rgba(154, 138, 78, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #d9963c;
  flex-shrink: 0;
}

.pi-header-info {
  flex: 1;
  min-width: 200px;
}

.pi-header-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #efe0cd;
  margin: 0;
}

.pi-header-name .pi-id {
  font-size: 0.8rem;
  color: #b49a82;
  font-weight: 500;
  margin-left: 8px;
}

.pi-header-subtitle {
  font-size: 0.85rem;
  color: #b49a82;
  margin-top: 2px;
}

.pi-header-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-left: auto;
}

.pi-header-stat {
  text-align: center;
  padding: 6px 14px;
  background: rgba(20, 12, 7, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(58, 42, 30, 0.3);
  min-width: 80px;
}

.pi-header-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #d9963c;
}

.pi-header-stat-label {
  font-size: 0.65rem;
  color: #b49a82;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.pi-header-badges {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pi-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.pi-badge-admin { background: rgba(184, 70, 92, 0.2); color: #d4707f; border: 1px solid rgba(184, 70, 92, 0.3); }
.pi-badge-vip { background: rgba(192, 95, 116, 0.2); color: #c084fc; border: 1px solid rgba(192, 95, 116, 0.3); }
.pi-badge-banned { background: rgba(184, 70, 92, 0.3); color: #e3a8b1; border: 1px solid rgba(184, 70, 92, 0.5); }
.pi-badge-sub { background: rgba(90, 168, 115, 0.2); color: #7cc194; border: 1px solid rgba(90, 168, 115, 0.3); }
.pi-badge-muted { background: rgba(176, 157, 92, 0.2); color: #e0a851; border: 1px solid rgba(176, 157, 92, 0.3); }
.pi-badge-online { background: rgba(90, 168, 115, 0.2); color: #7cc194; border: 1px solid rgba(90, 168, 115, 0.3); }
.pi-badge-offline { background: rgba(58, 42, 30, 0.3); color: #b49a82; border: 1px solid rgba(58, 42, 30, 0.4); }

/* ============================================
   TABS
   ============================================ */
.pi-tabs {
  gap: 4px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.3);
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.pi-tabs .nav-link {
  color: #b49a82;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.15s;
}

.pi-tabs .nav-link:hover {
  color: #d9963c;
  background: rgba(154, 138, 78, 0.08);
}

.pi-tabs .nav-link.active {
  background: rgba(154, 138, 78, 0.15);
  color: #d9963c;
}

/* ============================================
   CARDS (generic inside tabs)
   ============================================ */
.pi-card {
  background: #241710;
  border: 1px solid rgba(58, 42, 30, 0.4);
  border-radius: 10px;
  overflow: hidden;
}

.pi-card-header {
  padding: 12px 16px;
  background: rgba(154, 138, 78, 0.06);
  border-bottom: 1px solid rgba(58, 42, 30, 0.3);
  font-weight: 700;
  font-size: 0.85rem;
  color: #e9ecef;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pi-card-header i { color: #d9963c; }

.pi-card-body {
  padding: 16px;
}

.pi-card-body-compact {
  padding: 0;
}

/* ============================================
   DATA GRID (key-value pairs)
   ============================================ */
.pi-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
}

.pi-data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.2);
  font-size: 0.82rem;
}

.pi-data-item:last-child { border-bottom: none; }

.pi-data-label {
  color: #b49a82;
  font-weight: 500;
}

.pi-data-value {
  color: #e9ecef;
  font-weight: 700;
  text-align: right;
}

.pi-data-value.text-gold { color: #d9963c; }
.pi-data-value.text-green { color: #7cc194; }
.pi-data-value.text-red { color: #d4707f; }
.pi-data-value.text-blue { color: #d98b53; }
.pi-data-value.text-purple { color: #c084fc; }

/* ============================================
   CHARACTER LIST (allChars)
   ============================================ */
.pi-char-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(20, 12, 7, 0.4);
  border: 1px solid rgba(58, 42, 30, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.pi-char-card:hover {
  border-color: rgba(154, 138, 78, 0.4);
  background: rgba(154, 138, 78, 0.06);
}

.pi-char-card.active {
  border-color: #d9963c;
  background: rgba(154, 138, 78, 0.1);
}

.pi-char-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(154, 138, 78, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #d9963c;
  flex-shrink: 0;
}

.pi-char-name { font-weight: 700; color: #e9ecef; font-size: 0.85rem; }
.pi-char-meta { font-size: 0.75rem; color: #b49a82; }

/* ============================================
   OBJECTS TABLE
   ============================================ */
.pi-obj-table {
  width: 100%;
  font-size: 0.8rem;
}

.pi-obj-table thead th {
  background: rgba(20, 12, 7, 0.6);
  color: #b49a82;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(154, 138, 78, 0.2);
  position: sticky;
  top: 0;
}

.pi-obj-table tbody tr {
  border-bottom: 1px solid rgba(58, 42, 30, 0.2);
  transition: background 0.1s;
}

.pi-obj-table tbody tr:hover {
  background: rgba(154, 138, 78, 0.05);
}

.pi-obj-table td {
  padding: 6px 12px;
  color: #d6c3ae;
  vertical-align: middle;
}

.pi-obj-equipped {
  color: #7cc194;
  font-weight: 600;
}

.pi-obj-name {
  font-weight: 600;
  color: #e9ecef;
}

/* ============================================
   STATS BARS
   ============================================ */
.pi-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pi-stat-label {
  width: 100px;
  font-size: 0.8rem;
  color: #b49a82;
  font-weight: 600;
  flex-shrink: 0;
}

.pi-stat-bar {
  flex: 1;
  height: 20px;
  background: rgba(20, 12, 7, 0.6);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.pi-stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.pi-stat-value {
  width: 70px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 800;
  color: #e9ecef;
  flex-shrink: 0;
}

/* ============================================
   QUEST LIST
   ============================================ */
.pi-quest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.2);
  font-size: 0.82rem;
}

.pi-quest-finished {
  color: #7cc194;
}

.pi-quest-inprogress {
  color: #e0a851;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.pi-empty {
  text-align: center;
  padding: 32px;
  color: #8b7461;
  font-size: 0.85rem;
}

.pi-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  opacity: 0.3;
}

/* ============================================
   LOADING
   ============================================ */
.pi-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: #d9963c;
  font-size: 0.9rem;
}

/* ============================================
   MOUNT CARD
   ============================================ */
.pi-mount-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
}

.pi-mount-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(154, 138, 78, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* ============================================
   SCROLLABLE TABLE CONTAINER
   ============================================ */
.pi-table-scroll {
  max-height: 400px;
  overflow-y: auto;
}

.pi-table-scroll-lg {
  max-height: 600px;
  overflow-y: auto;
}

/* ============================================
   ALERTS (ban, prison)
   ============================================ */
.pi-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pi-alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pi-alert-danger {
  background: rgba(184, 70, 92, 0.15);
  border: 1px solid rgba(184, 70, 92, 0.4);
  color: #e3a8b1;
}

/* ============================================
   LINKED ACCOUNTS
   ============================================ */
.pi-linked-row {
  transition: background 0.15s;
}

.pi-linked-row:hover {
  background: rgba(154, 138, 78, 0.08) !important;
}

.pi-linked-account {
  color: #d98b53;
  font-weight: 700;
}

/* ============================================
   ECONOMY — highlighted rows
   ============================================ */
.pi-row-warning {
  background: rgba(154, 138, 78, 0.08) !important;
  border-left: 3px solid #d9963c;
}

.pi-row-self {
  background: rgba(224, 151, 95, 0.05);
}

/* ============================================
   EVENT BADGES (shadow mode, kamas type)
   ============================================ */
.pi-badge-sub { background: rgba(90, 168, 115, 0.2); color: #7cc194; border: 1px solid rgba(90, 168, 115, 0.3); }

/* ============================================
   TEXT HELPER (for inline use)
   ============================================ */
.text-green { color: #7cc194 !important; }

/* ============================================
   SCAN FAILLES — RESULTS
   ============================================ */

/* Override pi-welcome centering when scan is active */
.pi-welcome.scan-active {
  align-items: stretch;
  text-align: left;
  padding: 20px 24px;
  justify-content: flex-start;
}

/* Toolbar */
.scan-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.scan-toolbar .btn {
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 6px;
}

/* Summary dashboard */
.scan-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.scan-stat-box {
  background: rgba(20, 12, 7, 0.6);
  border: 1px solid rgba(58, 42, 30, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}

.scan-stat-box-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.scan-stat-box-label {
  font-size: 0.68rem;
  color: #b49a82;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 4px;
}

.scan-stat-box.critique .scan-stat-box-value { color: #c0455a; }
.scan-stat-box.suspect .scan-stat-box-value { color: #d9963c; }
.scan-stat-box.info .scan-stat-box-value { color: #d98b53; }
.scan-stat-box.success .scan-stat-box-value { color: #7cc194; }

/* Filters bar */
.scan-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(20, 12, 7, 0.4);
  border: 1px solid rgba(58, 42, 30, 0.25);
  border-radius: 8px;
  margin-bottom: 16px;
}

.scan-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scan-filter-group label {
  font-size: 0.72rem;
  color: #8b7461;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  white-space: nowrap;
  margin: 0;
}

.scan-filter-group select {
  background: #1a0f07;
  color: #e9ecef;
  border: 1px solid rgba(58, 42, 30, 0.4);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.scan-filter-group select:focus {
  border-color: rgba(154, 138, 78, 0.5);
}

.scan-filter-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: #8b7461;
}

/* Player list */
.scan-player-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scan-player-row {
  background: #241710;
  border: 1px solid rgba(58, 42, 30, 0.3);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.scan-player-row:hover {
  border-color: rgba(162, 143, 127, 0.4);
}

.scan-player-row.critique {
  border-left: 3px solid #c0455a;
}

.scan-player-row.suspect {
  border-left: 3px solid #d9963c;
}

/* Player header (clickable) */
.scan-row-header {
  display: grid;
  grid-template-columns: 20px 32px 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.scan-row-header:hover {
  background: rgba(154, 138, 78, 0.04);
}

.scan-row-chevron {
  color: #4a3021;
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-row-chevron.open {
  transform: rotate(90deg);
}

.scan-row-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.scan-row-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #e9ecef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-row-meta {
  font-size: 0.75rem;
  color: #8b7461;
  white-space: nowrap;
}

.scan-row-badges {
  display: flex;
  gap: 4px;
  align-items: center;
}

.scan-row-count {
  font-size: 0.72rem;
  color: #8b7461;
  text-align: right;
  white-space: nowrap;
  min-width: 70px;
}

.scan-row-actions {
  display: flex;
  gap: 6px;
}

.scan-row-actions .btn {
  font-size: 0.68rem;
  padding: 2px 10px;
  border-radius: 5px;
}

/* Player body (expanded details) */
.scan-row-body {
  display: none;
  padding: 0 14px 12px 62px;
  border-top: 1px solid rgba(58, 42, 30, 0.15);
}

.scan-row-body.open {
  display: block;
}

/* Anomaly items inside expanded body */
.scan-anomaly-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(58, 42, 30, 0.1);
  font-size: 0.8rem;
}

.scan-anomaly-item:last-child {
  border-bottom: none;
}

.scan-anomaly-item-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scan-anomaly-item-name {
  font-weight: 700;
  color: #e9ecef;
}

.scan-anomaly-item-loc {
  font-size: 0.7rem;
  color: #8b7461;
  padding: 1px 6px;
  background: rgba(58, 42, 30, 0.2);
  border-radius: 4px;
}

.scan-anomaly-detail {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 2px 12px;
  font-size: 0.78rem;
}

.scan-anomaly-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.scan-anomaly-dot.critique { background: #c0455a; }
.scan-anomaly-dot.suspect { background: #d9963c; }

.scan-anomaly-stat {
  font-weight: 600;
  color: #d6c3ae;
  min-width: 80px;
}

.scan-anomaly-val {
  font-weight: 700;
  color: #c0455a;
}

.scan-anomaly-exp {
  color: #8b7461;
}

.scan-anomaly-sep {
  color: #4a3021;
}

/* Type badges in expanded body */
.scan-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(58, 42, 30, 0.15);
  white-space: nowrap;
}

.scan-type-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* Empty / no filter results */
.scan-empty {
  text-align: center;
  padding: 40px 20px;
  color: #8b7461;
}

.scan-empty i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.4;
}

.scan-empty-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Account group container */
.scan-account-group {
  border-radius: 8px;
  overflow: hidden;
}

.scan-account-header {
  transition: background 0.1s;
}

.scan-account-header:hover {
  background: rgba(154, 138, 78, 0.08) !important;
}

.scan-account-header i.scan-group-chevron {
  flex-shrink: 0;
}

.scan-account-body {
  background: rgba(20, 12, 7, 0.3);
}

/* Nested player rows inside account groups */
.scan-account-body .scan-player-row {
  border-radius: 6px;
}

.scan-account-body .scan-player-row:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
