/* === Ship Catalog Page === */

.main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 6rem 1rem 2rem;
}

/* === Page Header === */
.pageHeader {
  margin-bottom: 2rem;
}

.pageHeaderTitle {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--plasma-cyan), var(--shell-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pageHeaderSubtitle {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  color: var(--chrome-silver);
  font-size: 0.9rem;
}

.pageHeaderDescription {
  font-size: 0.85rem;
  color: var(--chrome-silver);
  margin-top: 0.5rem;
  opacity: 0.8;
  max-width: 700px;
}

.shipCount {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--chrome-silver);
  margin-top: 0.75rem;
  opacity: 0.6;
}

/* === Guide Section === */
.guideSection {
  margin-bottom: 2rem;
}

.guideSectionHeader {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.guideSectionTitle {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 1rem;
  color: var(--star-white);
  margin: 0;
}

.guideSectionHint {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--chrome-silver);
  opacity: 0.4;
}

.guidePanels {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guidePanel {
  background: linear-gradient(135deg, rgba(26, 39, 68, 0.4), rgba(13, 19, 33, 0.6));
  border: 1px solid var(--hull-grey);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.guidePanel:hover {
  border-color: rgba(0, 212, 255, 0.3);
}

.guidePanelOpen {
  border-color: rgba(0, 212, 255, 0.2);
}

.guidePanelToggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--star-white);
  text-align: left;
}

.guidePanelTitle {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.guidePanelChevron {
  color: var(--chrome-silver);
  opacity: 0.5;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.guidePanelOpen .guidePanelChevron {
  transform: rotate(180deg);
}

.guidePanelContent {
  padding: 0 1rem 1rem;
  font-size: 0.82rem;
  color: var(--chrome-silver);
  line-height: 1.7;
}

.guidePanelContent p {
  margin: 0 0 0.6rem;
}

.guidePanelContent p:last-child {
  margin-bottom: 0;
}

.guideColumns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.6rem 0;
}

.guideColumn {
  padding: 0.75rem;
  background: rgba(0, 212, 255, 0.04);
  border-radius: 6px;
  border: 1px solid rgba(0, 212, 255, 0.08);
}

.guideColumn p {
  margin: 0;
}

.guideColumnTitle {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--plasma-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem;
}

/* === Filter Bar === */
.filterSection {
  margin-bottom: 2rem;
  overflow-x: clip;
}

.filterRow {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: max-content;
}

.filterLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--chrome-silver);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 60px;
}

.filterBtn {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  background: var(--nebula-blue);
  border: 1px solid var(--hull-grey);
  color: var(--chrome-silver);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filterBtn:hover,
.filterBtnActive {
  border-color: var(--plasma-cyan);
  color: var(--plasma-cyan);
}

.filterBtnActive {
  background: rgba(0, 212, 255, 0.1);
}

.empireDot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.expandAllBtn {
  margin-left: auto;
}

/* === Class Dropdown === */
.classDropdown {
  position: relative;
}

.classDropdownToggle {
  gap: 0.5rem;
}

.classDropdownChevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.classDropdownMenu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 220px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  background: var(--nebula-blue);
  border: 1px solid var(--hull-grey);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.classDropdownClear {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--plasma-cyan);
  background: none;
  border: none;
  border-bottom: 1px solid var(--hull-grey);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  text-align: left;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.classDropdownClear:hover:not(:disabled) {
  opacity: 1;
}

.classDropdownClear:disabled {
  opacity: 0.3;
  cursor: default;
}

.classDropdownList {
  overflow-y: auto;
  padding: 0.35rem 0;
}

.classDropdownItem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.classDropdownItem:hover {
  background: rgba(0, 212, 255, 0.08);
}

.classCheckbox {
  accent-color: var(--plasma-cyan);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

.classDropdownLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--chrome-silver);
}

/* Single-select dropdown items (Empire, Tier, Category) */
.filterDropdownItem {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.filterDropdownItem:hover {
  background: rgba(0, 212, 255, 0.08);
}

.filterDropdownItemActive {
  background: rgba(0, 212, 255, 0.12);
}

.filterDropdownItemActive .classDropdownLabel {
  color: var(--plasma-cyan);
}

.searchInput {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  background: var(--nebula-blue);
  border: 1px solid var(--hull-grey);
  color: var(--star-white);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.3s ease;
  flex: 1;
  min-width: 120px;
  max-width: 320px;
}

.searchInput::placeholder {
  color: var(--chrome-silver);
  opacity: 0.5;
}

.searchInput:focus {
  border-color: var(--plasma-cyan);
}

/* === Ship Grid === */
.shipGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* === Ship Card === */
.shipCard {
  background: linear-gradient(135deg, rgba(26, 39, 68, 0.6), rgba(13, 19, 33, 0.8));
  border: 1px solid var(--hull-grey);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.shipCard:hover {
  border-color: var(--empire-color, var(--plasma-cyan));
  box-shadow: 0 5px 25px color-mix(in srgb, var(--empire-color, var(--plasma-cyan)) 20%, transparent);
  transform: translateY(-3px);
}

.shipCardExpanded {
  border-color: var(--empire-color, var(--plasma-cyan));
  box-shadow: 0 5px 25px color-mix(in srgb, var(--empire-color, var(--plasma-cyan)) 15%, transparent);
  grid-column: 1 / -1;
  flex-direction: row;
}

.shipCardExpanded .cardAccent {
  width: 3px;
  height: auto;
}

.cardLeft {
  display: flex;
  flex-direction: column;
}

.shipCardExpanded .cardLeft {
  flex: 0 0 360px;
  border-right: 1px solid rgba(0, 212, 255, 0.08);
}

.cardAccent {
  height: 3px;
  background: var(--empire-color, var(--hull-grey));
  flex-shrink: 0;
}

.shipImageWrap {
  overflow: hidden;
  background: rgba(13, 19, 33, 0.8);
  position: relative;
}

.shipImage {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.shipCard:hover .shipImage {
  transform: scale(1.03);
}

.zoomBtn {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 19, 33, 0.75);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 4px;
  color: var(--chrome-silver);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.shipImageWrap:hover .zoomBtn {
  opacity: 1;
}

.zoomBtn:hover {
  background: rgba(0, 212, 255, 0.15);
  color: var(--plasma-cyan);
  border-color: var(--plasma-cyan);
}

.cardBody {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cardHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.shipName {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--star-white);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tierBadge {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--plasma-cyan);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.cardTags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.empireBadge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
}

.classBadge {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--chrome-silver);
  opacity: 0.7;
}

.priceBadge {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--shell-orange);
  margin-left: auto;
}

.shipDescription {
  font-size: 0.85rem;
  color: var(--chrome-silver);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* === Stats Row === */
.statsRow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.statItem {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.statLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--chrome-silver);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.statValue {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--star-white);
  font-weight: 600;
}

/* === Slots Row === */
.slotsRow {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--chrome-silver);
}

.slotItem {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.slotIcon {
  font-size: 0.75rem;
}

.weaponSlot {
  color: var(--claw-red);
}

.defenseSlot {
  color: var(--plasma-cyan);
}

.utilitySlot {
  color: var(--bio-green);
}

/* === Expanded Detail === */
.expandedDetail {
  padding: 1.25rem;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 1.5rem;
  align-content: start;
}

.detailSection {
  margin-top: 0;
  margin-bottom: 1rem;
}

.detailSection:first-child {
  grid-column: 1 / -1;
}

.detailSectionWide {
  grid-column: 1 / -1;
}

.detailSectionTitle {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--plasma-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.loreText {
  font-size: 0.85rem;
  color: var(--chrome-silver);
  line-height: 1.7;
  opacity: 0.9;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}

/* === Full Stats Grid === */
.fullStatsGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.fullStatItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 212, 255, 0.04);
  border-radius: 4px;
}

.fullStatLabel {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--chrome-silver);
}

.fullStatValue {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--star-white);
  font-weight: 600;
}

/* === Materials List === */
.materialsList {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.materialItem {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.5rem;
  background: rgba(255, 107, 53, 0.05);
  border-radius: 4px;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.materialName {
  color: var(--chrome-silver);
}

.materialQty {
  color: var(--shell-orange);
  font-weight: 600;
}

/* === Skills List === */
.skillsList {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.skillItem {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 3px;
  color: var(--chrome-silver);
}

/* === Flavor Tags === */
.flavorTags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
  grid-column: 1 / -1;
}

.flavorTag {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  background: rgba(168, 197, 214, 0.08);
  border-radius: 3px;
  color: var(--chrome-silver);
  opacity: 0.7;
}

/* === Loading === */
.loading {
  text-align: center;
  padding: 4rem;
  color: var(--chrome-silver);
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
}

/* === Empty State === */
.emptyState {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--chrome-silver);
}

.emptyStateTitle {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--star-white);
}

/* === Image Zoom Modal === */
.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}

.modalClose {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 39, 68, 0.8);
  border: 1px solid var(--hull-grey);
  border-radius: 6px;
  color: var(--chrome-silver);
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.modalClose:hover {
  color: var(--star-white);
  border-color: var(--plasma-cyan);
}

.modalContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1200px, 90vw);
  cursor: default;
}

.modalImage {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.modalCaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  text-align: center;
  max-width: 700px;
}

.modalShipName {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--star-white);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modalShipDesc {
  font-size: 0.85rem;
  color: var(--chrome-silver);
  line-height: 1.6;
  opacity: 0.8;
}

/* === View Toggle === */
.filterRowRight {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.viewToggle {
  display: flex;
  gap: 0.25rem;
}

.viewToggleBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--nebula-blue);
  border: 1px solid var(--hull-grey);
  border-radius: 4px;
  color: var(--chrome-silver);
  cursor: pointer;
  transition: all 0.2s ease;
}

.viewToggleBtn:hover,
.viewToggleBtnActive {
  border-color: var(--plasma-cyan);
  color: var(--plasma-cyan);
}

.viewToggleBtnActive {
  background: rgba(0, 212, 255, 0.1);
}

/* === Ship Table === */
.tableWrap {
  overflow-x: auto;
  border: 1px solid var(--hull-grey);
  border-radius: 8px;
}

.shipTable {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  min-width: 1100px;
}

.tableHeaderCell {
  padding: 0.6rem 0.6rem;
  text-align: left;
  color: var(--chrome-silver);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: rgba(13, 19, 33, 0.9);
  border-bottom: 1px solid var(--hull-grey);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.tableHeaderCell:hover {
  color: var(--star-white);
}

.sortActive {
  color: var(--plasma-cyan);
}

.sortIndicator {
  opacity: 0.4;
  font-size: 0.65rem;
  margin-left: 0.25rem;
}

.sortActive .sortIndicator {
  opacity: 1;
}

.tableRow {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.1s ease;
}

.tableRow:hover {
  background: rgba(0, 212, 255, 0.05);
}

.tableRowExpanded {
  background: rgba(0, 212, 255, 0.07);
  border-bottom: none;
}

.tableCell {
  padding: 0.45rem 0.6rem;
  color: var(--chrome-silver);
  white-space: nowrap;
}

.tableCellNum {
  text-align: right;
  color: var(--star-white);
  font-weight: 500;
}

.tableName {
  color: var(--star-white);
  font-weight: 600;
  position: relative;
  padding-left: 1rem;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tableClass {
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tableEmpireAccent {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: 2px;
}

.tableExpandRow {
  border-bottom: 1px solid var(--hull-grey);
}

.tableExpandCell {
  padding: 0;
}

.tableExpandContent {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(13, 19, 33, 0.6);
}

.tableExpandImageWrap {
  position: relative;
  flex-shrink: 0;
  width: 280px;
}

.tableExpandImage {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  object-fit: cover;
}

.tableExpandText {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tableExpandDescription {
  font-size: 0.9rem;
  color: var(--star-white);
  line-height: 1.6;
  margin: 0;
}

.tableExpandLore {
  font-size: 0.82rem;
  color: var(--chrome-silver);
  line-height: 1.75;
  opacity: 0.85;
  margin: 0;
}

/* === Responsive === */
@media (max-width: 768px) {
  .main {
    padding: 8rem 1rem 2rem;
  }

  .shipGrid {
    grid-template-columns: 1fr;
  }

  .pageHeaderTitle {
    font-size: 1.6rem;
  }

  .statsRow {
    grid-template-columns: repeat(2, 1fr);
  }

  .fullStatsGrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .searchInput {
    width: 100%;
  }

  .filterRow {
    gap: 0.35rem;
  }

  .filterBtn {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }

  .guideColumns {
    grid-template-columns: 1fr;
  }

  .shipCardExpanded {
    flex-direction: column;
  }

  .shipCardExpanded .cardAccent {
    width: auto;
    height: 3px;
  }

  .shipCardExpanded .cardLeft {
    flex: none;
    border-right: none;
    border-bottom: 1px solid rgba(0, 212, 255, 0.08);
  }

  .expandedDetail {
    grid-template-columns: 1fr;
  }
}
