/* ============================================================
   SCDB — Star Citizen Database
   JARVIS HUD Tactical Interface Theme
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --jarvis-bg: #0a0e17;
  --jarvis-bg-light: #0d1117;
  --jarvis-blue: #00d4ff;
  --jarvis-blue-dim: #0ea5e9;
  --jarvis-amber: #f59e0b;
  --jarvis-amber-light: #fbbf24;
  --jarvis-green: #22c55e;
  --jarvis-red: #ef4444;
  --jarvis-text: #e2e8f0;
  --jarvis-text-dim: #94a3b8;
  --jarvis-card-bg: rgba(14, 165, 233, 0.06);
  --jarvis-card-border: rgba(14, 165, 233, 0.2);
  --font-hud: 'Rajdhani', sans-serif;
  --font-display: 'Orbitron', sans-serif;
  --font-mono: 'Share Tech Mono', monospace;

  --header-height: 50px;
  --sidebar-width: 260px;
}


/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--jarvis-bg);
  color: var(--jarvis-text);
  font-family: var(--font-hud);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 212, 255, 0.008) 2px,
    rgba(0, 212, 255, 0.008) 4px
  );
}

/* Grid background */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

a {
  color: var(--jarvis-blue);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: var(--jarvis-blue);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(0, 212, 255, 0.25);
  color: #fff;
}


/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--jarvis-bg);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.25);
  border-radius: 3px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.45);
}

::-webkit-scrollbar-corner {
  background: var(--jarvis-bg);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 212, 255, 0.25) var(--jarvis-bg);
}


/* ============================================================
   HEADER (#scdb-header)
   ============================================================ */

#scdb-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--jarvis-card-border);
}

.header-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--jarvis-blue);
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-brand .brand-sub {
  font-family: var(--font-hud);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--jarvis-text-dim);
  text-shadow: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.header-version {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--jarvis-text-dim);
  letter-spacing: 0.04em;
}

.header-tabs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  margin: 0 1rem;
}

.header-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: none;
  background: transparent;
  color: var(--jarvis-text-dim);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.header-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--jarvis-blue);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
  transition: width 0.25s ease;
}

.header-tab:hover {
  color: var(--jarvis-text);
}

.header-tab:hover::after {
  width: 60%;
}

.header-tab.active {
  color: var(--jarvis-blue);
}

.header-tab.active::after {
  width: 100%;
}

.data-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-status.live {
  color: var(--jarvis-green);
}

.data-status.cached {
  color: var(--jarvis-amber);
}

.data-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.data-status.live .status-dot {
  background: var(--jarvis-green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  animation: status-pulse 2s ease-in-out infinite;
}

.data-status.cached .status-dot {
  background: var(--jarvis-amber);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--jarvis-card-border);
  background: transparent;
  color: var(--jarvis-blue);
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--jarvis-blue);
}


/* ============================================================
   SIDEBAR (#scdb-sidebar)
   ============================================================ */

#scdb-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(10, 14, 23, 0.5);
  border-right: 1px solid var(--jarvis-card-border);
  overflow-y: auto;
  z-index: 900;
  padding: 1rem 0;
  transition: transform 0.3s ease;
}

.sidebar-section {
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid rgba(14, 165, 233, 0.06);
}

.sidebar-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jarvis-blue);
  margin-bottom: 0.75rem;
  display: block;
}

.sidebar-label::before {
  content: '[ ';
  opacity: 0.5;
}

.sidebar-label::after {
  content: ' ]';
  opacity: 0.5;
}


/* ============================================================
   MODULE NAVIGATION
   ============================================================ */

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  color: var(--jarvis-text-dim);
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
  text-align: left;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.nav-item:hover {
  color: var(--jarvis-text);
  background: rgba(0, 212, 255, 0.03);
}

.nav-item.active {
  color: var(--jarvis-blue);
  background: rgba(0, 212, 255, 0.06);
}

.nav-item.active::before {
  background: var(--jarvis-blue);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.nav-icon {
  font-size: 0.55rem;
  width: 1rem;
  text-align: center;
  color: var(--jarvis-text-dim);
  transition: color 0.2s ease;
}

.nav-item.active .nav-icon {
  color: var(--jarvis-blue);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.5);
}


/* ============================================================
   FILTER CONTROLS
   ============================================================ */

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(14, 165, 233, 0.15);
  color: var(--jarvis-text);
  font-family: var(--font-hud);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 0.6rem;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--jarvis-blue);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.15), inset 0 0 12px rgba(0, 212, 255, 0.04);
}

.filter-input::placeholder {
  color: var(--jarvis-text-dim);
  opacity: 0.6;
  font-style: italic;
}

.filter-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

.filter-select option {
  background: var(--jarvis-bg);
  color: var(--jarvis-text);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--jarvis-text-dim);
  transition: color 0.2s ease;
  padding: 0.15rem 0;
}

.filter-checkbox:hover {
  color: var(--jarvis-text);
}

.filter-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  background: rgba(10, 14, 23, 0.8);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.filter-checkbox input[type="checkbox"]:checked {
  border-color: var(--jarvis-blue);
  background: rgba(0, 212, 255, 0.15);
}

.filter-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--jarvis-blue);
  box-shadow: 0 0 4px rgba(0, 212, 255, 0.5);
}

.filter-checkbox input[type="checkbox"]:focus {
  outline: none;
  border-color: var(--jarvis-blue);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.15);
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(14, 165, 233, 0.2);
  background: transparent;
  color: var(--jarvis-text-dim);
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  width: 100%;
  margin-top: 0.3rem;
}

.filter-btn:hover {
  color: var(--jarvis-blue);
  border-color: var(--jarvis-blue);
  background: rgba(0, 212, 255, 0.05);
}

.filter-btn + .filter-btn {
  margin-top: 0.35rem;
}


/* ============================================================
   MAIN CONTENT (#scdb-content)
   ============================================================ */

#scdb-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 1.5rem;
  min-height: calc(100vh - var(--header-height));
  transition: margin-left 0.3s ease;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(14, 165, 233, 0.08);
}

.content-header .section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--jarvis-blue);
}

.content-header .section-title::before {
  content: '[ ';
  opacity: 0.5;
}

.content-header .section-title::after {
  content: ' ]';
  opacity: 0.5;
}

.content-header .breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--jarvis-text-dim);
  letter-spacing: 0.04em;
}

.content-header .breadcrumb span {
  color: rgba(148, 163, 184, 0.4);
  margin: 0 0.35rem;
}


/* ============================================================
   DATA TABLE (.scdb-table)
   ============================================================ */

.scdb-table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(14, 165, 233, 0.08);
}

.scdb-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.scdb-table thead th {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--jarvis-blue-dim);
  padding: 0.75rem;
  text-align: left;
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--jarvis-bg);
  border-bottom: 1px solid var(--jarvis-card-border);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  z-index: 10;
}

.scdb-table thead th:hover {
  color: var(--jarvis-blue);
}

.scdb-table thead th.sort-asc::after {
  content: ' \25B2';
  font-size: 0.5rem;
  margin-left: 0.3rem;
  color: var(--jarvis-blue);
}

.scdb-table thead th.sort-desc::after {
  content: ' \25BC';
  font-size: 0.5rem;
  margin-left: 0.3rem;
  color: var(--jarvis-blue);
}

.scdb-table thead th.no-sort {
  cursor: default;
}

.scdb-table tbody tr {
  border-bottom: 1px solid rgba(14, 165, 233, 0.06);
  transition: background 0.2s ease;
  animation: data-load 0.3s ease forwards;
}

.scdb-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.03);
}

.scdb-table tbody tr.selected {
  background: rgba(0, 212, 255, 0.08);
  border-left: 2px solid var(--jarvis-blue);
}

.scdb-table td {
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  vertical-align: middle;
}

.scdb-table td.td-numeric {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.td-name {
  font-family: var(--font-hud);
  font-weight: 600;
  color: var(--jarvis-text);
  white-space: nowrap;
}

.td-mfr {
  color: var(--jarvis-text-dim);
  font-size: 0.75rem;
}

/* Checkbox column */
.scdb-table th.col-checkbox,
.scdb-table td.col-checkbox {
  width: 36px;
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0.25rem;
}

.scdb-table .row-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  background: rgba(10, 14, 23, 0.8);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.scdb-table .row-checkbox:checked {
  border-color: var(--jarvis-blue);
  background: rgba(0, 212, 255, 0.15);
}

.scdb-table .row-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: var(--jarvis-blue);
  box-shadow: 0 0 4px rgba(0, 212, 255, 0.5);
}


/* ============================================================
   DETAIL PANEL (.detail-panel)
   ============================================================ */

.detail-panel {
  background: var(--jarvis-card-bg);
  border: 1px solid var(--jarvis-card-border);
  padding: 1.5rem;
  margin: 0.5rem 0;
  position: relative;
  animation: data-load 0.25s ease forwards;
  overflow: hidden;
}

/* HUD corners effect */
.detail-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-top: 2px solid var(--jarvis-blue);
  border-left: 2px solid var(--jarvis-blue);
  pointer-events: none;
}

.detail-panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid var(--jarvis-blue);
  border-right: 2px solid var(--jarvis-blue);
  pointer-events: none;
}

.detail-panel-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--jarvis-blue);
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.detail-stat {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid rgba(14, 165, 233, 0.08);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.detail-stat-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jarvis-text-dim);
}

.detail-stat-value {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--jarvis-text);
  letter-spacing: 0.02em;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(14, 165, 233, 0.08);
}


/* ============================================================
   SIDEBAR COMPARE LIST
   ============================================================ */

.compare-selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(14, 165, 233, 0.06);
}

.compare-selected-name {
  font-family: var(--font-hud);
  font-size: 0.8rem;
  color: var(--jarvis-text);
}

.compare-remove {
  background: none;
  border: none;
  color: var(--jarvis-text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color 0.2s ease;
}

.compare-remove:hover {
  color: var(--jarvis-red);
}


/* ============================================================
   COMPARE MODE (.compare-matrix)
   ============================================================ */

.compare-matrix {
  padding: 0.5rem 0;
}

.compare-slots {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.compare-slot {
  flex: 1;
  min-width: 180px;
  background: var(--jarvis-card-bg);
  border: 1px solid var(--jarvis-card-border);
  padding: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.2s ease;
}

.compare-slot:hover {
  border-color: rgba(0, 212, 255, 0.4);
}

.compare-slot .slot-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jarvis-text-dim);
}

.compare-slot .slot-name {
  font-family: var(--font-hud);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--jarvis-text);
}

.compare-slot .slot-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--jarvis-text-dim);
  cursor: pointer;
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

.compare-slot .slot-remove:hover {
  color: var(--jarvis-red);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

.compare-table th {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--jarvis-blue-dim);
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--jarvis-card-border);
}

.compare-table td {
  padding: 0.55rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(14, 165, 233, 0.06);
  vertical-align: middle;
}

.compare-bar {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(14, 165, 233, 0.1);
  overflow: hidden;
  margin-top: 0.3rem;
}

.compare-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--jarvis-blue);
  box-shadow: 0 0 4px rgba(0, 212, 255, 0.3);
  transition: width 0.3s ease;
}

.stat-best {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.stat-worst {
  color: #ff4444;
}

.stat-mid {
  color: #ffaa00;
}


/* ============================================================
   LOADOUT BUILDER (.loadout-builder)
   ============================================================ */

.loadout-builder {
  padding: 0.5rem 0;
}

.loadout-ship-select {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--jarvis-card-bg);
  border: 1px solid var(--jarvis-card-border);
}

.loadout-ship-select label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jarvis-blue);
  white-space: nowrap;
}

.loadout-ship-select select {
  flex: 1;
  padding: 0.5rem 0.65rem;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(14, 165, 233, 0.15);
  color: var(--jarvis-text);
  font-family: var(--font-hud);
  font-size: 0.85rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
  transition: border-color 0.2s ease;
}

.loadout-ship-select select:focus {
  border-color: var(--jarvis-blue);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.15);
}

.hardpoint-manifest {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hardpoint-category {
  border: 1px solid rgba(14, 165, 233, 0.08);
}

.hardpoint-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(14, 165, 233, 0.04);
  border-bottom: 1px solid rgba(14, 165, 233, 0.08);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--jarvis-blue-dim);
}

.hardpoint-slot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(14, 165, 233, 0.04);
  transition: background 0.2s ease;
}

.hardpoint-slot:last-child {
  border-bottom: none;
}

.hardpoint-slot:hover {
  background: rgba(0, 212, 255, 0.02);
}

.hardpoint-size {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-radius: 3px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--jarvis-blue);
  font-weight: 700;
  flex-shrink: 0;
}

.hardpoint-slot-label {
  font-family: var(--font-hud);
  font-size: 0.78rem;
  color: var(--jarvis-text-dim);
  min-width: 100px;
  flex-shrink: 0;
}

.hardpoint-dropdown {
  flex: 1;
  padding: 0.4rem 0.6rem;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid rgba(14, 165, 233, 0.12);
  color: var(--jarvis-text);
  font-family: var(--font-hud);
  font-size: 0.78rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 1.8rem;
  transition: border-color 0.2s ease;
}

.hardpoint-dropdown:focus {
  border-color: var(--jarvis-blue);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.1);
}

.hardpoint-stats {
  display: flex;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--jarvis-text-dim);
  flex-shrink: 0;
}

.hardpoint-stats span {
  white-space: nowrap;
}

.loadout-summary {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--jarvis-card-bg);
  border: 1px solid var(--jarvis-card-border);
  position: relative;
}

.loadout-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-top: 2px solid var(--jarvis-blue);
  border-left: 2px solid var(--jarvis-blue);
  pointer-events: none;
}

.loadout-summary::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  border-bottom: 2px solid var(--jarvis-blue);
  border-right: 2px solid var(--jarvis-blue);
  pointer-events: none;
}

.loadout-summary-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--jarvis-blue);
  margin-bottom: 0.85rem;
}

.loadout-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.loadout-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}


/* ============================================================
   LOADING STATE (.loading-state)
   ============================================================ */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  min-height: 300px;
}

.loading-state .loading-scan {
  width: 200px;
  height: 3px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  position: relative;
}

.loading-state .loading-scan::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--jarvis-blue), transparent);
  animation: scan-sweep 1.5s ease-in-out infinite;
}

.loading-state .loading-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--jarvis-blue-dim);
  animation: pulse-glow 2s ease-in-out infinite;
}

.loading-state .loading-text::before {
  content: '[ ';
  opacity: 0.5;
}

.loading-state .loading-text::after {
  content: ' ]';
  opacity: 0.5;
}


/* ============================================================
   ERROR STATE (.error-state)
   ============================================================ */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  min-height: 250px;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.05);
}

.error-state .error-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--jarvis-red);
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
}

.error-state .error-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jarvis-red);
  margin-bottom: 0.5rem;
}

.error-state .error-message {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--jarvis-text-dim);
  margin-bottom: 1.25rem;
  text-align: center;
}

.error-state .error-retry {
  padding: 0.5rem 1.25rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: var(--jarvis-red);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.error-state .error-retry:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--jarvis-red);
}


/* ============================================================
   EMPTY STATE (.empty-state)
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  min-height: 250px;
}

.empty-state .empty-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--jarvis-text-dim);
  opacity: 0.6;
  text-transform: uppercase;
}

.empty-state .empty-icon {
  font-size: 2rem;
  color: var(--jarvis-text-dim);
  opacity: 0.25;
  margin-bottom: 1rem;
}


/* ============================================================
   PAGINATION (.pagination)
   ============================================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 0.5rem;
  border: 1px solid rgba(14, 165, 233, 0.15);
  background: transparent;
  color: var(--jarvis-text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.page-btn:hover {
  color: var(--jarvis-blue);
  border-color: rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.04);
}

.page-btn.active {
  color: var(--jarvis-bg);
  background: var(--jarvis-blue);
  border-color: var(--jarvis-blue);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--jarvis-text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0.5rem;
}


/* ============================================================
   UTILITY — TEXT COLORS
   ============================================================ */

.text-green {
  color: var(--jarvis-green);
}

.text-red {
  color: var(--jarvis-red);
}

.text-amber {
  color: var(--jarvis-amber);
}

.text-blue {
  color: var(--jarvis-blue);
}

.text-dim {
  color: var(--jarvis-text-dim);
}


/* ============================================================
   UTILITY — GLOWS
   ============================================================ */

.glow-green {
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.5), 0 0 16px rgba(34, 197, 94, 0.25);
}

.glow-blue {
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3), 0 0 16px rgba(0, 212, 255, 0.15);
}


/* ============================================================
   UTILITY — FONTS
   ============================================================ */

.font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

.font-hud {
  font-family: var(--font-hud);
}


/* ============================================================
   UTILITY — HUD COMPONENTS
   ============================================================ */

.hud-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jarvis-blue);
  display: inline-block;
}

.hud-label::before {
  content: '[ ';
  opacity: 0.5;
}

.hud-label::after {
  content: ' ]';
  opacity: 0.5;
}

.hud-divider {
  height: 1px;
  border: none;
  margin: 1rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(14, 165, 233, 0.3) 20%,
    rgba(14, 165, 233, 0.3) 80%,
    transparent
  );
}

.hud-corners {
  position: relative;
}

.hud-corners::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-top: 2px solid var(--jarvis-blue);
  border-left: 2px solid var(--jarvis-blue);
  pointer-events: none;
}

.hud-corners::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  border-bottom: 2px solid var(--jarvis-blue);
  border-right: 2px solid var(--jarvis-blue);
  pointer-events: none;
}


/* ============================================================
   BUTTONS — HUD
   ============================================================ */

.btn-hud {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--jarvis-card-border);
  background: transparent;
  color: var(--jarvis-text-dim);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-hud:hover {
  color: var(--jarvis-blue);
  border-color: var(--jarvis-blue);
  background: rgba(0, 212, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.1);
}

.btn-hud:active {
  background: rgba(0, 212, 255, 0.12);
}

.btn-hud-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--jarvis-blue);
  background: rgba(0, 212, 255, 0.1);
  color: var(--jarvis-blue);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.btn-hud-primary:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.2), inset 0 0 12px rgba(0, 212, 255, 0.06);
}

.btn-hud-primary:active {
  background: rgba(0, 212, 255, 0.3);
}

.btn-hud-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
  color: var(--jarvis-red);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-hud-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--jarvis-red);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.btn-hud-danger:active {
  background: rgba(239, 68, 68, 0.25);
}

.btn-hud-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.06);
  color: var(--jarvis-green);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-hud-success:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--jarvis-green);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

.btn-hud-success:active {
  background: rgba(34, 197, 94, 0.25);
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes scan-sweep {
  0% {
    left: -50%;
  }
  100% {
    left: 100%;
  }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes data-load {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes status-pulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8), 0 0 20px rgba(34, 197, 94, 0.3);
    opacity: 0.8;
  }
}


/* ============================================================
   RESPONSIVE — TABLET (< 1024px)
   ============================================================ */

@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .compare-slots {
    flex-wrap: wrap;
  }

  .compare-slot {
    min-width: 150px;
  }
}


/* ============================================================
   RESPONSIVE — MOBILE (< 768px)
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  #scdb-sidebar {
    transform: translateX(-260px);
    width: 260px;
    z-index: 1100;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  #scdb-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
  }

  .sidebar-overlay.active {
    display: block;
  }

  #scdb-content {
    margin-left: 0;
    padding: 1rem;
  }

  .header-tabs {
    display: none;
  }

  .header-tabs.mobile-visible {
    display: flex;
    flex-wrap: wrap;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, 0.98);
    border-bottom: 1px solid var(--jarvis-card-border);
    padding: 0.5rem;
    gap: 0.15rem;
    z-index: 999;
  }

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

  .detail-panel {
    padding: 1rem;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .compare-slots {
    flex-direction: column;
  }

  .compare-slot {
    min-width: auto;
  }

  .loadout-ship-select {
    flex-direction: column;
    align-items: stretch;
  }

  .hardpoint-slot {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .hardpoint-stats {
    width: 100%;
    padding-left: calc(28px + 0.75rem);
  }

  .loadout-actions {
    flex-wrap: wrap;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}


/* ============================================================
   RESPONSIVE — SMALL MOBILE (< 480px)
   ============================================================ */

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  #scdb-header {
    padding: 0 0.75rem;
  }

  .header-brand {
    font-size: 0.9rem;
  }

  .scdb-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .scdb-table {
    min-width: 600px;
  }

  .scdb-table thead th {
    font-size: 0.55rem;
    padding: 0.5rem;
  }

  .scdb-table td {
    font-size: 0.72rem;
    padding: 0.45rem 0.5rem;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .detail-stat-value {
    font-size: 0.95rem;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .page-btn {
    min-width: 28px;
    height: 28px;
    font-size: 0.6rem;
  }

  .btn-hud,
  .btn-hud-primary,
  .btn-hud-danger,
  .btn-hud-success {
    font-size: 0.55rem;
    padding: 0.4rem 0.7rem;
  }

  .filter-btn {
    font-size: 0.5rem;
  }

  .loadout-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hardpoint-dropdown {
    font-size: 0.7rem;
  }
}
