/* ============================================================
 *  LIBRARY (Thư Viện) — Item & Mob wiki
 * ============================================================ */

/* ===== Search box ===== */
.lib-search-wrap {
  max-width: 720px;
  margin: 0 auto 30px;
}
.lib-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  justify-content: center;
}
.lib-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  background: rgba(11, 10, 35, 0.55);
  border: 1.5px solid rgba(255, 244, 220, 0.15);
  color: rgba(255, 244, 220, 0.75);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all .2s;
}
.lib-tab:hover {
  border-color: var(--accent-orange, #f1b94f);
  color: var(--cream, #e8e3d5);
}
.lib-tab.active {
  background: linear-gradient(180deg, var(--accent-orange, #f1b94f), #6494e8);
  border-color: transparent;
  color: #fff;
}

.lib-search-form {
  display: flex;
  gap: 10px;
}
.lib-search-input {
  flex: 1;
  padding: 14px 20px;
  background: rgba(11, 10, 35, 0.6);
  border: 1.5px solid rgba(255, 244, 220, 0.15);
  border-radius: 12px;
  color: var(--cream, #e8e3d5);
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  transition: all .2s;
}
.lib-search-input:focus {
  outline: none;
  border-color: var(--accent-gold, #ffc94a);
  box-shadow: 0 0 0 3px rgba(241, 185, 79, 0.15);
}
.lib-search-btn {
  padding: 14px 28px;
  background: linear-gradient(180deg, var(--accent-orange, #f1b94f), #6494e8);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Bungee', cursive;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.lib-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(241, 185, 79, 0.4);
}

/* ===== Results info ===== */
.lib-results-info {
  font-size: 14px;
  color: rgba(232, 227, 213, 0.65);
  margin-bottom: 18px;
  text-align: center;
}

/* ===== Result grid ===== */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.lib-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 244, 220, 0.04);
  border: 1.5px solid rgba(255, 244, 220, 0.08);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all .2s;
}
.lib-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-orange, #f1b94f);
  box-shadow: 0 8px 24px rgba(241, 185, 79, 0.18);
  color: inherit;
}
.lib-card-img {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 35, 0.5);
  border-radius: 10px;
  flex-shrink: 0;
}
.lib-card-img img {
  max-width: 48px;
  max-height: 48px;
  image-rendering: pixelated;
}
.lib-card-mob .lib-card-img img {
  max-width: 52px;
  max-height: 52px;
}
.lib-card-info {
  min-width: 0;
  flex: 1;
}
.lib-card-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--cream, #e8e3d5);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lib-card-id,
.lib-card-meta {
  font-size: 12px;
  color: rgba(232, 227, 213, 0.5);
}

/* ===== Boss badge ===== */
.lib-boss-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  vertical-align: middle;
}

/* ===== Empty ===== */
.lib-empty {
  text-align: center;
  padding: 50px 20px;
  color: rgba(232, 227, 213, 0.55);
}
.lib-empty-icon {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 12px;
}
.lib-empty-inline {
  padding: 20px;
  text-align: center;
  color: rgba(232, 227, 213, 0.55);
  background: rgba(255, 244, 220, 0.03);
  border-radius: 10px;
  font-size: 14px;
}

/* ===== Intro (chưa search) ===== */
.lib-intro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}
.lib-intro-card {
  background: rgba(255, 244, 220, 0.04);
  border: 1.5px solid rgba(255, 244, 220, 0.08);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
.lib-intro-icon {
  font-size: 44px;
  margin-bottom: 12px;
}
.lib-intro-card h3 {
  font-family: 'Bungee', cursive;
  font-size: 16px;
  color: var(--accent-gold, #ffc94a);
  margin: 0 0 8px;
}
.lib-intro-card p {
  font-size: 14px;
  color: rgba(232, 227, 213, 0.7);
  line-height: 1.6;
  margin: 0;
}
.lib-intro-card strong { color: var(--cream, #e8e3d5); }

/* ============================================================
 *  DETAIL PAGE
 * ============================================================ */
.lib-detail {
  max-width: 860px;
  margin: 0 auto;
}
.lib-detail-head {
  display: flex;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, rgba(26, 23, 51, 0.7), rgba(11, 10, 35, 0.85));
  border: 1px solid rgba(255, 244, 220, 0.1);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 24px;
}
.lib-detail-img {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 35, 0.5);
  border-radius: 14px;
  flex-shrink: 0;
}
.lib-detail-img img {
  max-width: 96px;
  max-height: 96px;
  image-rendering: pixelated;
}
.lib-detail-img-mob img {
  max-width: 110px;
  max-height: 110px;
}
.lib-detail-title-area {
  min-width: 0;
  flex: 1;
}
.lib-detail-type {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold, #ffc94a);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lib-detail-name {
  font-family: 'Bungee', cursive;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--cream, #e8e3d5);
  margin: 0 0 6px;
  line-height: 1.15;
}
.lib-detail-id {
  font-size: 12px;
  color: rgba(232, 227, 213, 0.45);
  font-family: monospace;
}
.lib-detail-desc {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(232, 227, 213, 0.75);
}

/* ===== Section ===== */
.lib-section {
  background: rgba(255, 244, 220, 0.03);
  border: 1px solid rgba(255, 244, 220, 0.08);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.lib-section-title {
  font-family: 'Bungee', cursive;
  font-size: 16px;
  color: var(--accent-gold, #ffc94a);
  margin: 0 0 16px;
}

/* ===== Stats grid (mob) ===== */
.lib-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.lib-stat {
  background: rgba(11, 10, 35, 0.4);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}
.lib-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(232, 227, 213, 0.5);
  font-weight: 700;
  margin-bottom: 6px;
}
.lib-stat-value {
  font-family: 'Bungee', cursive;
  font-size: 20px;
  color: var(--cream, #e8e3d5);
}
.lib-stat-hp { color: #fca5a5; }
.lib-stat-mp { color: #93c5fd; }
.lib-stat-exp { color: #86efac; }

/* ===== Drop list ===== */
.lib-drop-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lib-drop-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(11, 10, 35, 0.35);
  border: 1px solid rgba(255, 244, 220, 0.06);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all .15s;
}
.lib-drop-row:hover:not(.lib-drop-row-nolink) {
  transform: translateX(3px);
  border-color: var(--accent-orange, #f1b94f);
  color: inherit;
}
.lib-drop-row-nolink {
  cursor: default;
  opacity: 0.85;
}
.lib-drop-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 244, 220, 0.04);
  border-radius: 8px;
  flex-shrink: 0;
}
.lib-drop-img img {
  max-width: 42px;
  max-height: 42px;
  image-rendering: pixelated;
}
.lib-drop-info {
  flex: 1;
  min-width: 0;
}
.lib-drop-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--cream, #e8e3d5);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lib-drop-sub {
  font-size: 12px;
  color: rgba(232, 227, 213, 0.5);
  margin-top: 2px;
}
.lib-drop-chance {
  text-align: right;
  flex-shrink: 0;
}
.lib-drop-pct {
  display: block;
  font-family: 'Bungee', cursive;
  font-size: 15px;
  color: var(--tier, #b0b0b0);
}
.lib-drop-tier {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tier, #b0b0b0);
  opacity: 0.8;
  margin-top: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .lib-detail-head {
    flex-direction: column;
    text-align: center;
    padding: 22px;
  }
  .lib-search-form {
    flex-direction: column;
  }
  .lib-search-btn { width: 100%; }
}

/* ============================================================
 *  DROP GRID (compact) — danh sách item rơi dạng lưới nhỏ gọn
 *  Dùng ở trang mob để tránh scroll dài khi quái rơi nhiều item
 * ============================================================ */
.lib-drop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.lib-drop-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(11, 10, 35, 0.35);
  border: 1px solid rgba(255, 244, 220, 0.06);
  border-left: 3px solid var(--tier, #b0b0b0);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: all .15s;
  min-width: 0;
}
.lib-drop-cell:hover {
  transform: translateY(-2px);
  border-color: var(--accent-orange, #f1b94f);
  border-left-color: var(--tier, #b0b0b0);
  background: rgba(255, 244, 220, 0.05);
  color: inherit;
}
.lib-drop-cell-img {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 244, 220, 0.04);
  border-radius: 8px;
  flex-shrink: 0;
}
.lib-drop-cell-img img {
  max-width: 34px;
  max-height: 34px;
  image-rendering: pixelated;
}
.lib-drop-cell-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--cream, #e8e3d5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-drop-cell-pct {
  font-size: 11px;
  color: var(--tier, #b0b0b0);
  margin-top: 2px;
  font-weight: 600;
}
.lib-drop-cell-text {
  min-width: 0;
  flex: 1;
}

@media (max-width: 480px) {
  .lib-drop-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Drop pagination ===== */
.lib-section#drops { scroll-margin-top: 80px; }
.lib-drop-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 18px;
}
.lib-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 8px 12px;
  background: rgba(11, 10, 35, 0.5);
  border: 1.5px solid rgba(255, 244, 220, 0.12);
  border-radius: 8px;
  color: rgba(232, 227, 213, 0.75);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  transition: all .15s;
}
.lib-page-link:hover {
  border-color: var(--accent-orange, #f1b94f);
  color: var(--cream, #e8e3d5);
}
.lib-page-link.active {
  background: linear-gradient(180deg, var(--accent-orange, #f1b94f), #6494e8);
  border-color: transparent;
  color: #fff;
}
.lib-page-dots {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: rgba(232, 227, 213, 0.4);
}
.lib-drop-page-info {
  text-align: center;
  font-size: 12px;
  color: rgba(232, 227, 213, 0.5);
  margin-top: 10px;
}
