/* play/style-modern.css
   ─────────────────────────────────────────────────────────────────────
   Layer of modern visual upgrades on top of style.css. Loaded after the
   base stylesheet so it can override selectively without breaking
   existing components. Pure CSS — no JS changes required.
   ───────────────────────────────────────────────────────────────────── */

/* ── Glassmorphism on the major panels ─────────────────────────────── */
#market-panel,
#shipyard-panel,
#crew-panel,
#mission-journal,
#timeline-panel,
#galaxy-map,
#achievements-panel,
#base-panel,
#station-panel {
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background-image:
    radial-gradient(ellipse at top, rgba(248, 216, 120, 0.05), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(94, 215, 255, 0.04), transparent 60%);
}

/* Open/close micro-animation for panels (when they get .visible) */
#market-panel.visible,
#shipyard-panel.visible,
#crew-panel.visible,
#mission-journal.visible,
#achievements-panel.visible,
#base-panel.visible,
#station-panel.visible,
#timeline-panel.visible {
  animation: modernPanelIn 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

@keyframes modernPanelIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* ── Button micro-interactions: subtle hover lift + glow ─────────── */
button {
  transition:
    transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.05),
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.market-action-btn:not(:disabled):hover,
.svc-btn:not(:disabled):hover,
.shipyard-tier:hover,
.haven-tab:hover,
.cp-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(248, 216, 120, 0.18);
}
.market-action-btn:not(:disabled):active,
.svc-btn:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(248, 216, 120, 0.12);
}

/* ── Cards: gentle hover lift + brighter accent border on hover ── */
.crew-card,
.shipyard-card,
.npc-card,
.ach-card,
.market-item,
.base-machine {
  transition:
    transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.05),
    box-shadow 0.22s ease,
    border-color 0.2s ease;
  position: relative;
}
.crew-card:hover,
.shipyard-card:hover,
.npc-card:hover,
.ach-card:hover,
.market-item:hover,
.base-machine:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(94, 215, 255, 0.15);
}

/* ── Tabs: animated underline on the active tab ─────────────────── */
.haven-tab,
.cp-tab {
  position: relative;
  overflow: hidden;
}
.haven-tab.active::after,
.cp-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  animation: tabUnderline 1.6s ease-in-out infinite;
}
@keyframes tabUnderline {
  0%, 100% { opacity: 0.6; transform: scaleX(0.85); }
  50%      { opacity: 1;   transform: scaleX(1); }
}

/* ── Modern scrollbars (Chromium / Webkit) ─────────────────────── */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: rgba(10, 5, 24, 0.4);
  border-radius: 6px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(248, 216, 120, 0.35), rgba(94, 215, 255, 0.25));
  border-radius: 6px;
  border: 2px solid rgba(10, 5, 24, 0.4);
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(248, 216, 120, 0.6), rgba(94, 215, 255, 0.45));
}

/* ── HUD panels: subtle gradient sheen ─────────────────────────── */
.hud-panel,
.combat-bar-container,
.combat-credits {
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0%, transparent 40%);
  position: relative;
  overflow: hidden;
}

/* Bar fills get a moving glow strip when not full */
.combat-bar-fill {
  position: relative;
  background-image:
    linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.18) 45%,
      rgba(255, 255, 255, 0.18) 55%,
      rgba(255, 255, 255, 0) 100%);
  background-size: 200% 100%;
  animation: barShine 3s linear infinite;
}
@keyframes barShine {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Tooltips polish ─────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10, 5, 24, 0.95);
  border: 1px solid rgba(248, 216, 120, 0.4);
  color: #f8d878;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.15em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
  z-index: 10000;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Focus state — a11y polish for keyboard nav ──────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(248, 216, 120, 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Avoid white flash on link/button defaults ──────────────── */
button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* ── Subtitle / banner text: slight text-shadow for depth ──── */
.market-title,
.section-title {
  text-shadow: 0 0 14px rgba(248, 216, 120, 0.25);
}
