/* ================================================
   COLLECTION PAGE — header, tabs, empty state
   ================================================ */

.collection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.collection-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0c1222;
  margin: 0;
  line-height: 1;
}

/* --- Tabs: Cards / Packs --- */
.collection-tabs {
  display: inline-flex;
  gap: 4px;
  background: #f7f8fc;
  border-radius: 12px;
  padding: 4px;
  width: fit-content;
}
.collection-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #8b95a8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.collection-tab.active {
  background: #ffffff;
  color: #0c1222;
  box-shadow: 0 2px 10px rgba(12, 18, 34, 0.06);
}
.collection-tab .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 0.7rem;
  font-weight: 700;
}

.collection-tab.active .tab-count {
  background: #3b82f6;
  color: #ffffff;
}
.collection-tab:not(.active) .tab-count {
  background: rgba(12, 18, 34, 0.08);
  color: #8b95a8;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* --- Empty state --- */
.collection-empty {
  text-align: center;
  padding: 60px 20px;
}
.collection-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.7;
}
.collection-empty h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0c1222;
  margin-bottom: 8px;
}
.collection-empty p {
  font-size: 0.85rem;
  color: #4e5a72;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .collection-header {
    gap: 12px;
  }
  .collection-title {
    font-size: 1.25rem;
  }
  .collection-tab {
    padding: 7px 14px;
    font-size: 0.78rem;
  }
  #packFilters .filter-pill .pill-text {
    display: inline;
  }
}
@media (max-width: 480px) {
  .collection-title {
    font-size: 1.1rem;
  }
  .collection-tabs {
    padding: 3px;
  }
  .collection-tab {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
}

/* --- Collection card additions --- */
.collection-card-item .card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.card-order-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.card-order-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-order-icon.can-order svg {
  stroke: #0c1222;
  stroke-width: 2.5;
}
.card-order-icon.can-order:hover svg {
  stroke: #3b82f6;
}
.card-order-icon.ordered svg {
  stroke: #8b95a8;
  stroke-width: 1.5;
  opacity: 0.4;
}
.card-order-icon.ordered {
  cursor: default;
}

.collection-card-item .card-creator-name {
  font-size: 0.72rem;
  color: #8b95a8;
  margin-top: 2px;
}

.collection-card-item .card-bottom-row {
  margin-top: 8px;
}
.card-rarity-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag-grail {
  background: linear-gradient(135deg, #fff7e6, #fff0cc);
  color: #c97c04;
}
.tag-chase {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
}
.tag-rare {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: #ffffff;
}
.tag-common {
  background: #f7f8fc;
  color: #8b95a8;
}

.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  margin: 28px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(12, 18, 34, 0.06);
}
.group-header:first-child {
  margin-top: 0;
}
.group-header-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0c1222;
}
.group-header-count {
  font-size: 0.75rem;
  color: #8b95a8;
  margin-left: auto;
}

.group-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f7f8fc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.group-header-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-header-creator-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}
.group-header-creator-link:hover {
  opacity: 0.7;
}

.collection-card-item .card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

/* --- Portal dropdown --- */
.card-menu {
  position: fixed;
  min-width: 180px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid rgba(12, 18, 34, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(12, 18, 34, 0.15);
  z-index: 9999;
}
.card-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #4e5a72;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background 0.15s ease;
}
.card-menu-item:hover {
  background: #f7f8fc;
  color: #0c1222;
}
.card-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}
.card-menu-item:hover svg {
  opacity: 0.9;
}

.pack-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* --- 3-dot menu button --- */
/* --- 3-dot menu button (cards + packs) --- */
.card-menu-btn,
.opened-pack-menu-btn,
.pack-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #0c1222;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.opened-pack-menu-btn:hover,
.card-menu-btn:hover,
.pack-menu-btn:hover {
  color: #3b82f6;
}
.opened-pack-menu-btn svg,
.card-menu-btn svg,
.pack-menu-btn svg {
  width: 16px;
  height: 16px;
}
.pack-item--opened .pack-item-top img {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.pack-opened-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  pointer-events: none;
}
