/* ============================================================
   Second-in-Command Skill Browser — Starsector In-Game Theme
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep:       #05060a;
  --bg-page:       #08090e;
  --bg-card:       #0c0e16;
  --bg-row:        #0e1019;
  --bg-hover:      #13161f;
  --border-subtle: rgba(80, 100, 140, 0.18);
  --border-mid:    rgba(80, 100, 140, 0.32);
  --border-bright: rgba(100, 130, 180, 0.55);
  --text-base:     #c8cde0;
  --text-muted:    #60697e;
  --text-dim:      #3e4455;
  --accent-sic:    #e6b502;
  --font-ui:       'Insignia', 'Segoe UI', sans-serif;
  --font-mono:     'Insignia', 'Segoe UI', sans-serif;
}

html, body {
  background: var(--bg-deep);
  color: var(--text-base);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Dimmed background image */
body {
  background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),
              url('appAssets/background.jpg') center/cover no-repeat fixed;
  background-color: var(--bg-deep);
}

/* Faint grid overlay replacing old CRT scanlines */
body::before {
  content: '';
  pointer-events: none;
  position: fixed; inset: 0; z-index: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 49px,
      rgba(40,55,90,0.30) 49px,
      rgba(40,55,90,0.30) 50px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 49px,
      rgba(40,55,90,0.30) 49px,
      rgba(40,55,90,0.30) 50px
    );
}

.boot-msg {
  color: var(--text-muted);
  font-family: var(--font-ui);
  padding: 40px;
  font-size: 13px;
}

/* ---- App shell ---- */
.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px 300px;
  position: relative;
  z-index: 1;
}

/* ---- Header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 6, 10, 0.92);
  backdrop-filter: blur(6px);
}

.app-title {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b0bfd8;
}
.app-title span {
  color: var(--accent-sic);
}

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 11px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border-subtle);
  letter-spacing: 0.05em;
}

/* ---- Skill list ---- */
.skill-list {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ---- Third-party divider ---- */
.third-party-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 8px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.third-party-divider::before,
.third-party-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-mid);
}

/* ---- Aptitude Row ---- */
.aptitude-row {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 10px 14px 12px;
  overflow-x: auto;
}

.aptitude-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: 'Orbitron', var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #c8cde0;
  margin-bottom: 0;
  padding-bottom: 6px;
  border-bottom: none;
}

.aptitude-title-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
}
.aptitude-title-link:hover {
  color: #dde2f0;
}

.aptitude-category-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 13px;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

.aptitude-category-notice-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  opacity: 0.7;
  image-rendering: pixelated;
}

.aptitude-mod-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 1px 5px;
  letter-spacing: 0.08em;
  text-transform: none;
}

/* Colored line under aptitude header */
.aptitude-color-bar {
  height: 2px;
  width: 100%;
  margin-bottom: 2px;
  border: none;
  border-radius: 0;
}

/* Aptitude description */
.aptitude-description {
  font-family: var(--font-ui);
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}

.aptitude-description p {
  line-height: inherit;
}

/* ---- Skills row wrapper ---- */
.aptitude-skills-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 0;
  min-height: 90px;
  padding: 8px 8px;
  border-left: 3px solid;
  /* background & border-left-color set inline per aptitude */
}

/* ---- Section separator (arrow image) ---- */
.section-separator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
}
.separator-arrow-svg {
  display: block;
  opacity: 0.65;
}

/* ---- Skill section (group of icons in one section) ---- */
.skill-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  flex-shrink: 0;
  position: relative;
}

.skill-section-icons {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
}

/* Pick-one underline bracket */
.pick-one-underline {
  position: absolute;
  bottom: -5px;
  left: 0;
  height: 3px;
  width: 100%;
  border: none;
}

/* Vertical separator between individual skill icons */
.skill-separator {
  width: 3px;
  align-self: stretch;
  flex-shrink: 0;
  margin: 0 5px;
}

/* ---- Skill Icon ---- */
.skill-icon {
  position: relative;
  width: 90px;
  height: 90px;
  border: 2px solid;
  border-radius: 0;
  background: #080a10;
  cursor: default;
  overflow: hidden;
  flex-shrink: 0;
  transition: box-shadow 0.1s;
  image-rendering: pixelated;
}

.skill-icon:hover {
  z-index: 10;
}

.skill-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

/* ---- Tooltip Overlay ---- */
.tooltip-overlay {
  position: fixed;
  z-index: 10000;
  width: 700px;
  background-color: rgba(0, 0, 0, 0.95);
  border: none;
  border-radius: 0;
  padding: 10px 16px;
  pointer-events: none;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
}

/* Edge images as pseudo-elements so filter: brightness only affects them */
.tooltip-overlay::before,
.tooltip-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 13px;
  background-repeat: no-repeat;
  background-size: 13px 100%;
  filter: brightness(1.4);
  pointer-events: none;
  z-index: 1;
}
.tooltip-overlay::before {
  left: 0;
  background-image: url('appAssets/left_tooltip_edge.png');
  background-position: left center;
}
.tooltip-overlay::after {
  right: 0;
  background-image: url('appAssets/right_tooltip_edge.png');
  background-position: right center;
}

.tooltip-title {
  font-family: 'Orbitron', var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}


.tooltip-label {
  font-size: 13px;
  color: var(--text-base);
  white-space: pre-wrap;
  word-break: break-word;
}

.tooltip-spacer {
  flex-shrink: 0;
}

.tooltip-image-with-text {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border-subtle);
  border-radius: 0;
  padding: 6px 8px;
}

.tooltip-ability-image {
  border-radius: 0;
  border: 1px solid var(--border-mid);
  background: #080a10;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.tooltip-image-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

/* ---- Filter Panel ---- */
.filter-panel {
  position: relative;
}

.filter-toggle-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  color: var(--text-base);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.filter-toggle-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-bright);
}

.filter-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 6px);
  min-width: 220px;
  background: rgba(8, 10, 18, 0.97);
  border: 1px solid var(--border-bright);
  border-radius: 0;
  padding: 12px 14px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-section-title {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
  color: var(--text-base);
}
.filter-option input[type="checkbox"] {
  accent-color: var(--accent-sic);
  cursor: pointer;
}

.filter-reset-btn {
  margin-top: 4px;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-transform: uppercase;
}
.filter-reset-btn:hover {
  color: var(--text-base);
  border-color: var(--border-bright);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #1e2438; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2c3350; }

/* ---- Loading / Error ---- */
.loading, .error {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text-muted);
  padding: 60px 40px;
  text-align: center;
}
.error { color: #d94040; }

/* ---- Page Banner ---- */
.page-banner {
  width: 70%;
  margin: 40px auto 0;
  line-height: 0;
}
.page-banner img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

/* ---- Nav links (inside app-header) ---- */
.app-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.app-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 11px;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.app-nav a:hover {
  color: var(--text-base);
  border-color: var(--border-subtle);
  background: rgba(255,255,255,0.03);
}

/* ---- Page sections ---- */
.page-section {
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.page-section:last-child {
  border-bottom: none;
}

.section-body {
  padding: 0 14px;
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-body p {
  color: var(--text-base);
  font-size: 18px;
  line-height: 1.7;
}
.section-body strong {
  color: rgb(255, 210, 0);
  font-weight: 600;
}

/* ---- Section headings ---- */
.section-heading {
  font-family: 'Orbitron', var(--font-ui);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgb(170, 222, 255);
  padding: 0 14px 10px;
  border-bottom: 1px solid rgba(170, 222, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: 70px;
}

.section-subheading {
  font-family: 'Orbitron', var(--font-ui);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(170, 222, 255, 0.9);
  padding: 18px 14px 8px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: 70px;
}

/* ---- Share anchor (button) ---- */
.heading-anchor {
  font-family: var(--font-ui);
  font-size: 0.72em;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: 0.05em;
}
.section-heading:hover .heading-anchor,
.section-subheading:hover .heading-anchor,
.aptitude-title:hover .aptitude-anchor {
  opacity: 1;
}
.heading-anchor:hover {
  color: rgb(170, 222, 255);
  opacity: 1;
}
.heading-anchor.copied {
  color: #8de0b0;
  opacity: 1;
}

/* Aptitude-row anchor (styled slightly smaller, inline with title) */
.aptitude-anchor {
  font-size: 11px;
}
.aptitude-title-text {
  /* natural flow, badge uses margin-left: auto to stay right */
}
.aptitude-row {
  scroll-margin-top: 70px;
}

/* ---- Aptitudes subsection ---- */
.aptitudes-subsection {
  margin-top: 4px;
}

/* ---- Gallery Carousel ---- */
.carousel {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.carousel-track {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.carousel-multi {
  flex: 1;
  display: flex;
  gap: 5px;
  align-items: stretch;
}
.carousel-thumb-wrap {
  flex: 1;
  line-height: 0;
  border: 1px solid var(--border-mid);
  background: #05060a;
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 0.15s, opacity 0.15s;
}
.carousel-thumb-wrap:hover {
  border-color: var(--border-bright);
  opacity: 0.88;
}
.carousel-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-btn {
  flex-shrink: 0;
  width: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  color: var(--text-base);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.carousel-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-bright);
  color: #fff;
}
.carousel-dots {
  display: flex;
  gap: 6px;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  background: var(--text-dim);
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.carousel-dot.active {
  background: rgb(170, 222, 255);
}
.carousel-dot:hover:not(.active) {
  background: var(--text-muted);
}

/* ---- Lightbox ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.90);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox-image {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 0 60px rgba(0,0,0,0.9);
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-mid);
  color: var(--text-base);
  font-size: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ---- Links list ---- */
.links-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.links-list a {
  color: rgb(153, 200, 230);
  text-decoration: none;
  font-size: 18px;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}
.links-list a:hover {
  color: rgb(170, 222, 255);
  text-decoration: underline;
}

/* ---- Incompatibilities lists ---- */
.incompat-list {
  list-style: disc;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text-base);
  font-size: 18px;
  line-height: 1.65;
}
.incompat-crash {
  margin-bottom: 4px;
}

/* ---- About section divider ---- */
hr.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(170, 222, 255, 0.28) 15%, rgba(170, 222, 255, 0.28) 85%, transparent);
  margin: 14px 0;
}

/* ---- Aptitude subsection description ---- */
.subsection-description {
  padding: 10px 14px 0;
  color: var(--text-base);
  font-size: 18px;
  line-height: 1.65;
}
.subsection-description strong {
  color: rgb(255, 210, 0);
}

/* ---- Lightbox prev/next nav ---- */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-mid);
  color: var(--text-base);
  font-size: 42px;
  line-height: 1;
  width: 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  padding: 0 0 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 1;
}
.lightbox-nav-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--border-bright);
  color: #fff;
}
.lightbox-nav-prev { left: 22px; }
.lightbox-nav-next { right: 22px; }

/* ---- Side Navigation ---- */
.side-nav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.side-nav-item {
  display: block;
  color: rgba(170, 222, 255, 0.45);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  background: transparent;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.side-nav-item.sub {
  padding-left: 18px;
  font-size: 10px;
}
.side-nav-item:hover {
  color: rgb(170, 222, 255);
  background: rgba(170, 222, 255, 0.05);
}
.side-nav-item.active {
  color: rgb(170, 222, 255);
  background: rgba(170, 222, 255, 0.10);
  border-left-color: rgba(170, 222, 255, 0.40);
}

/* hide on narrow viewports where it would overlap content */
@media (max-width: 1200px) {
  .side-nav { display: none; }
}
