/* ============================================================
   CHARGE BANKS — Ship Resource & Payment Card Vault
   USS Ulysses Portal — Starship Aesthetic
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.cb-wrapper {
  position: relative;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100%;
}

/* ── Starfield Background ────────────────────────────────── */
.cb-starfield {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.cb-stars {
  position: absolute;
  inset: -50%;
  background-repeat: repeat;
}
.cb-stars-1 {
  background-image: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.3) 0%, transparent 100%),
                    radial-gradient(1px 1px at 80px 60px, rgba(255,255,255,0.2) 0%, transparent 100%),
                    radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.15) 0%, transparent 100%),
                    radial-gradient(1px 1px at 240px 80px, rgba(255,255,255,0.25) 0%, transparent 100%),
                    radial-gradient(1px 1px at 320px 200px, rgba(255,255,255,0.1) 0%, transparent 100%);
  background-size: 400px 300px;
  animation: cb-drift-1 80s linear infinite;
}
.cb-stars-2 {
  background-image: radial-gradient(1px 1px at 50px 100px, rgba(0,212,255,0.15) 0%, transparent 100%),
                    radial-gradient(1px 1px at 200px 180px, rgba(0,212,255,0.1) 0%, transparent 100%),
                    radial-gradient(1px 1px at 350px 50px, rgba(0,212,255,0.12) 0%, transparent 100%);
  background-size: 500px 350px;
  animation: cb-drift-2 120s linear infinite;
}
@keyframes cb-drift-1 { from { transform: translateX(0); } to { transform: translateX(-400px); } }
@keyframes cb-drift-2 { from { transform: translateX(0); } to { transform: translateX(-500px); } }

/* ── HUD Header ──────────────────────────────────────────── */
.cb-hud-header {
  position: relative;
  padding: 20px 24px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,212,255,0.04) 0%, rgba(10,14,23,0.9) 100%);
  z-index: 1;
}
.cb-hud-bracket-tl,
.cb-hud-bracket-tr {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: #00d4ff;
  border-style: solid;
  opacity: 0.5;
}
.cb-hud-bracket-tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.cb-hud-bracket-tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }

.cb-hud-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cb-hud-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px rgba(0,212,255,0.6));
  animation: cb-icon-pulse 3s ease-in-out infinite;
}
@keyframes cb-icon-pulse {
  0%,100% { filter: drop-shadow(0 0 12px rgba(0,212,255,0.6)); }
  50% { filter: drop-shadow(0 0 24px rgba(0,212,255,0.9)); }
}
.cb-hud-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: #00d4ff;
  text-shadow: 0 0 15px rgba(0,212,255,0.4);
}
.cb-hud-subtitle {
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  color: #475569;
  margin-top: 2px;
}
.cb-hud-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: #94a3b8;
}
.cb-hud-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: cb-dot-pulse 2s ease-in-out infinite;
}
@keyframes cb-dot-pulse {
  0%,100% { opacity:1; box-shadow: 0 0 6px currentColor; }
  50% { opacity:0.4; box-shadow: 0 0 12px currentColor; }
}

/* ── Security Advisory ───────────────────────────────────── */
.cb-advisory {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  padding-left: 24px;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(234,179,8,0.06) 0%, rgba(239,68,68,0.04) 100%);
  border: 1px solid rgba(234,179,8,0.2);
  border-radius: 10px;
  z-index: 1;
  overflow: hidden;
}
.cb-advisory-stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #eab308, #f97316, #eab308);
  animation: cb-stripe-pulse 3s ease-in-out infinite;
}
@keyframes cb-stripe-pulse {
  0%,100% { opacity:0.8; }
  50% { opacity:1; }
}
.cb-advisory-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(234,179,8,0.5));
}
.cb-advisory-text {
  flex: 1;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #94a3b8;
}
.cb-advisory-text strong {
  display: block;
  color: #eab308;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.cb-advisory-text em { color: #fbbf24; font-style: normal; font-weight: 600; }
.cb-advisory-text p { margin: 0; }
.cb-advisory-close {
  background: none;
  border: 1px solid rgba(234,179,8,0.15);
  color: #475569;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.cb-advisory-close:hover { color: #eab308; border-color: #eab308; }

/* Collapsed advisory state */
.cb-advisory.collapsed {
  padding: 8px 12px;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}
.cb-advisory.collapsed .cb-advisory-content { display: none; }
.cb-advisory.collapsed .cb-advisory-stripe { display: none; }
.cb-advisory.collapsed .cb-advisory-close { display: none; }
.cb-advisory.collapsed .cb-advisory-collapsed-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eab308;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  opacity: 0.7;
}
.cb-advisory-collapsed-label { display: none; }
.cb-advisory.collapsed:hover { border-color: rgba(234,179,8,0.4); background: linear-gradient(135deg, rgba(234,179,8,0.1) 0%, rgba(239,68,68,0.06) 100%); }
.cb-advisory.collapsed:hover .cb-advisory-collapsed-label { opacity: 1; }

/* ── Reactor Core Summary ────────────────────────────────── */
.cb-reactor {
  position: relative;
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 1.5rem;
  background: linear-gradient(145deg, #0a0e17 0%, #0d1525 40%, #0a1628 100%);
  z-index: 1;
  overflow: hidden;
}
.cb-reactor::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  opacity: 0.6;
}
.cb-reactor::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,255,0.3), transparent);
}
.cb-reactor-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,212,255,0.02) 2px, rgba(0,212,255,0.02) 4px);
  pointer-events: none;
}
.cb-reactor-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.cb-reactor-cell { text-align: center; }
.cb-reactor-main { text-align: left; }
.cb-reactor-label {
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: #00d4ff;
  margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(0,212,255,0.3);
}
.cb-reactor-value {
  font-size: 2.8rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}
.cb-reactor-remaining {
  font-size: 1.6rem;
  font-weight: 700;
  text-shadow: 0 0 15px currentColor;
  transition: color 0.3s;
}

/* Ring gauge */
.cb-reactor-ring-wrap { width: 160px; height: 160px; margin: 0 auto; }
.cb-reactor-ring { width: 100%; height: 100%; }
@keyframes cb-ring-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Stats column */
.cb-reactor-stats { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.cb-reactor-stat { display: flex; align-items: baseline; gap: 10px; }
.cb-reactor-stat-val {
  font-size: 1.3rem;
  font-weight: 700;
  color: #00d4ff;
  min-width: 80px;
}
.cb-reactor-stat-lbl {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: #475569;
}

/* ── Action Bar ──────────────────────────────────────────── */
.cb-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.cb-btn-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: linear-gradient(135deg, rgba(0,212,255,0.12) 0%, rgba(0,212,255,0.04) 100%);
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: 8px;
  color: #00d4ff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.25s;
}
.cb-btn-add:hover {
  background: linear-gradient(135deg, rgba(0,212,255,0.22) 0%, rgba(0,212,255,0.08) 100%);
  border-color: #00d4ff;
  box-shadow: 0 0 25px rgba(0,212,255,0.15), inset 0 0 15px rgba(0,212,255,0.05);
  transform: translateY(-1px);
}
.cb-btn-add-icon { font-size: 1.15rem; }

/* ── Card Grid ───────────────────────────────────────────── */
.cb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

/* ── Empty State ─────────────────────────────────────────── */
.cb-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  text-align: center;
  padding: 2rem;
}
.cb-empty-reactor { width: 160px; height: 160px; margin-bottom: 1.5rem; opacity: 0.6; }
.cb-empty-ring { width: 100%; height: 100%; animation: cb-ring-rotate 30s linear infinite; opacity: 0.5; }
.cb-empty-title {
  font-size: 1.15rem;
  letter-spacing: 0.25em;
  color: #334155;
  margin-bottom: 12px;
}
.cb-empty-sub {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 24px;
}
.cb-empty-btn { margin-top: 0; }

/* ── Card ────────────────────────────────────────────────── */
.cb-card {
  position: relative;
  background: linear-gradient(150deg, #0d1525 0%, #0a1024 60%, #0c1428 100%);
  border: 1px solid rgba(30,41,59,0.8);
  border-radius: 14px;
  padding: 22px;
  overflow: hidden;
  transition: all 0.3s;
}
.cb-card-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,212,255,0.012) 3px, rgba(0,212,255,0.012) 6px);
  pointer-events: none;
}
.cb-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.5;
  transition: opacity 0.3s;
}
.cb-card:hover {
  border-color: rgba(0,212,255,0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 30px rgba(0,212,255,0.06);
}
.cb-card:hover .cb-card-glow { opacity: 1; }
.cb-card-offline { opacity: 0.45; filter: saturate(0.3); }
.cb-card-offline:hover { opacity: 0.6; }

/* Card Header */
.cb-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.cb-card-brand {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}
.cb-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.cb-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  animation: cb-dot-pulse 2s ease-in-out infinite;
}

/* Card Number + Name */
.cb-card-number {
  font-size: 1.6rem;
  letter-spacing: 0.22em;
  color: #e2e8f0;
  margin-bottom: 4px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.cb-card-name {
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  color: #00d4ff;
  margin-bottom: 18px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0,212,255,0.3);
  position: relative;
  z-index: 1;
}

/* Energy Gauge */
.cb-card-gauge {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.cb-card-gauge-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #475569;
  margin-bottom: 10px;
}
.cb-card-gauge-track {
  position: relative;
  height: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.cb-card-gauge-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background 0.3s;
  position: relative;
}
.cb-card-gauge-marks {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 1px;
  pointer-events: none;
}
.cb-card-gauge-marks span {
  width: 1px;
  height: 100%;
  background: rgba(255,255,255,0.06);
}
.cb-card-gauge-values {
  display: flex;
  justify-content: space-between;
}
.cb-gauge-label {
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #334155;
  margin-bottom: 2px;
}
.cb-gauge-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #e2e8f0;
}

/* Purpose & Meta */
.cb-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.cb-card-purpose {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid;
  border-radius: 5px;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.cb-card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.95rem;
  color: #334155;
  letter-spacing: 0.08em;
}

/* Card Actions */
.cb-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.03);
}
.cb-act-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(30,41,59,0.6);
  background: rgba(0,0,0,0.25);
  color: #475569;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
}
.cb-act-btn:hover { color: #00d4ff; border-color: rgba(0,212,255,0.3); background: rgba(0,212,255,0.06); }
.cb-act-toggle:hover { color: #22c55e; border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.06); }
.cb-act-delete:hover { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.06); }

/* ── Modal ───────────────────────────────────────────────── */
.cb-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: cb-fadeIn 0.2s ease;
}
@keyframes cb-fadeIn { from { opacity:0; } to { opacity:1; } }
.cb-modal-overlay.hidden { display: none; }
.cb-modal {
  position: relative;
  background: linear-gradient(150deg, #0d1525 0%, #0a1024 100%);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 14px;
  width: 540px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
}
.cb-modal-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,212,255,0.015) 2px, rgba(0,212,255,0.015) 4px);
  pointer-events: none;
  border-radius: 14px;
}
.cb-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00d4ff, transparent);
  border-radius: 14px 14px 0 0;
}
.cb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(30,41,59,0.6);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  color: #00d4ff;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.cb-modal-close {
  background: none;
  border: 1px solid rgba(30,41,59,0.6);
  color: #475569;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.cb-modal-close:hover { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.cb-modal-body { padding: 24px; position: relative; z-index: 1; }
.cb-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(30,41,59,0.6);
  position: relative;
  z-index: 1;
}

/* Form Section Label */
.cb-form-section-label {
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: #334155;
  text-align: center;
  margin-bottom: 14px;
}

/* Form Elements */
.cb-form-group {
  margin-bottom: 14px;
  flex: 1;
}
.cb-form-group label {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: #475569;
  margin-bottom: 6px;
  font-weight: 600;
}
.cb-form-group input,
.cb-form-group select,
.cb-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(10,14,23,0.8);
  border: 1px solid rgba(30,41,59,0.6);
  border-radius: 8px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}
.cb-form-group input:focus,
.cb-form-group select:focus,
.cb-form-group textarea:focus {
  border-color: rgba(0,212,255,0.4);
  box-shadow: 0 0 12px rgba(0,212,255,0.1), inset 0 0 8px rgba(0,212,255,0.03);
}
.cb-form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.cb-form-group textarea { resize: vertical; min-height: 50px; }
.cb-form-row { display: flex; gap: 12px; }
.cb-flex2 { flex: 2; }

/* Disclaimer */
.cb-form-disclaimer {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(234,179,8,0.05);
  border: 1px solid rgba(234,179,8,0.15);
  border-radius: 8px;
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.5;
}
.cb-form-disclaimer strong { color: #eab308; font-size: 1.15rem; letter-spacing: 0.08em; }

/* Buttons */
.cb-btn-cancel {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(30,41,59,0.6);
  border-radius: 8px;
  color: #64748b;
  font-family: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}
.cb-btn-cancel:hover { border-color: #475569; color: #e2e8f0; }
.cb-btn-save {
  padding: 10px 24px;
  background: linear-gradient(135deg, #00d4ff 0%, #0088cc 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}
.cb-btn-save:hover {
  box-shadow: 0 0 25px rgba(0,212,255,0.3);
  transform: translateY(-1px);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .cb-reactor-grid { grid-template-columns: 1fr; gap: 20px; }
  .cb-reactor-main { text-align: center; }
  .cb-reactor-stats { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 16px; }
  .cb-reactor-stat { text-align: center; }
}
@media (max-width: 768px) {
  .cb-wrapper { padding: 1rem; }
  .cb-grid { grid-template-columns: 1fr; }
  .cb-reactor-value { font-size: 1.6rem; }
  .cb-reactor-remaining { font-size: 1.5rem; }
  .cb-form-row { flex-direction: column; gap: 0; }
  .cb-modal { width: 95vw; }
  .cb-hud-title { font-size: 0.9rem; }
}
