/* ===== GOOGLE FONT ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ===== GLOBAL STYLES ===== */
html {
  overflow-y: scroll;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a, #1b1f2d);
  color: #e5e7eb;
  margin: 0;
  padding: 24px;
  padding-top: 100px; /* accounts for fixed navbar */
  text-align: center;
}

/* ===== HEADERS ===== */
h1 {
  margin-bottom: 18px;
  font-size: 30px;
  font-weight: 800;
  color: #f1f5f9;
  text-align: center;
  letter-spacing: 0.5px;
  position: relative;
}

h1::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  margin: 6px auto 0;
  border-radius: 3px;
}

/* ===== LINKS ===== */
a {
  text-decoration: none;
  color: #0077cc;
  display: inline-block;
  margin-top: 20px;
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #111827, #1b1f2d);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid #334155;
  z-index: 3000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  border-radius: 0 0 12px 12px;
}

.nav-left {
  font-weight: 700;
  font-size: 18px;
  color: #f1f5f9;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: #94a3b8;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.1s;
}

.nav-links a:hover {
  color: #6366f1;
  transform: translateY(-2px);
}

.nav-links a.active {
  color: #22d3ee;
  font-weight: 600;
  position: relative;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: #22d3ee;
}

/* ===== PANELS / CARDS ===== */
.panel {
  background: linear-gradient(180deg, #1e293b, #1b1f2d);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  position: relative;
  text-align: left;
}

/* ===== CONTROLS / INPUTS ===== */
.controls,
.sort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.controls > * {
  flex: 1 1 200px;
}

input,
button {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}

input {
  cursor: text;
}

button:hover {
  background-color: #273449;
}

button.active {
  border-color: #3b82f6;
  color: #3b82f6;
}

/* ===== DROPDOWN ===== */
.dropdown {
  position: relative;
}

.dropdown-btn {
  width: 100%;
  text-align: left;
  padding-right: 32px;
  position: relative;
}

.dropdown-btn::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.dropdown.open .dropdown-btn::after {
  transform: translateY(-40%) rotate(-135deg);
}

.dropdown-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
}

.dropdown-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.dropdown-menu label:hover {
  background: #273449;
}

/* ===== LISTS ===== */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 6px;
  background: #1e293b;
  transition: transform 0.1s, box-shadow 0.15s;
}

.list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 8px #6366f1;
}

.list-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-right: 12px;
}

/* ===== TABLE ===== */
.table-wrapper {
  background-color: #1e293b;
  border-radius: 12px;
  padding: 12px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

thead th {
  position: sticky;
  top: 60px;
  z-index: 10;
  background: #334155;
  padding: 10px;
}

tbody tr {
  background: #1e293b;
  transition: background 0.2s ease;
}

tbody tr:nth-child(even) {
  background: #273449;
}

tbody tr:hover {
  background: #334155;
}

td {
  padding: 10px;
  text-align: center;
  vertical-align: middle;
}

td:first-child {
  width: 80px;
  padding: 0;
}

.item-image {
  width: 100%;
  height: 56px;
  object-fit: contain;
}

.item-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== BOTTOM ROW (GALLEONS + RESET) ===== */
.bottom-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.galleon-box input {
  width: 140px;
  padding: 10px;
  font-size: 1em;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #020617;
  color: #e5e7eb;
  text-align: center;
}

.galleon-box input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1;
}

/* ===== BADGES ===== */
.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.Common { background:#475569; }
.Uncommon { background:#eab308; color:#0f172a; }
.Rare { background:#6366f1; }
.Limited { background:#a855f7; }
.Mystic { background:#f43f5e; }
.Legendary { background:#22c55e; color:#0f172a; }

/* ===== BOOKMARKS ===== */
.bookmark-panel {
  background: #1e293b;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 18px;
}

.bookmark-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #273449;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
}

.bookmark-item:hover {
  background: #334155;
}

.bookmark-name-pill {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.bookmark-name-pill.Common { background:#475569; }
.bookmark-name-pill.Uncommon { background:#eab308; color:#0f172a; }
.bookmark-name-pill.Rare { background:#6366f1; }
.bookmark-name-pill.Limited { background:#a855f7; }
.bookmark-name-pill.Mystic { background:#f43f5e; }
.bookmark-name-pill.Legendary { background:#22c55e; color:#0f172a; }

/* ===== MODAL ===== */
#chartModal {
  backdrop-filter: blur(6px);
  transition: opacity .25s ease;
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 2000;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .controls, .sort-row {
    flex-direction: column;
  }
}