/* =========================================================
   AeroTheme.css — Modern Aerospace UI
   Usage:
   - Link this file after any reset/normalize.
   - Optional: add `data-theme="dark"` on <html> or <body>
   - Uses system font stack + strong “technical” feel.
   ========================================================= */

/* -----------------------------
   1) Design Tokens
------------------------------ */
:root {
  /* Brand */
  --aero-primary: #2d6cff;   /* ion blue */
  --aero-accent:  #00d6ff;   /* cyan glow */
  --aero-warn:    #ffb020;
  --aero-danger:  #ff4d4d;
  --aero-success: #2ad67c;

  /* Neutrals (light theme defaults) */
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f0f4ff;
  --text: #0b1220;
  --text-2: #41506a;
  --border: rgba(11, 18, 32, 0.12);

  /* Effects */
  --shadow-sm: 0 6px 18px rgba(11, 18, 32, 0.08);
  --shadow-md: 0 12px 36px rgba(11, 18, 32, 0.12);
  --ring: 0 0 0 3px rgba(45, 108, 255, 0.25);
  --radius: 14px;

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
               "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
               "Courier New", monospace;

  /* Layout */
  --container: 1180px;
  --gutter: 20px;
}

/* Dark theme: set <html data-theme="dark"> */
:root[data-theme="dark"] {
  --bg: #070a12;
  --surface: #0b1020;
  --surface-2: #0e1730;
  --text: #e8eefc;
  --text-2: #a9b7d6;
  --border: rgba(232, 238, 252, 0.12);

  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 52px rgba(0, 0, 0, 0.45);
  --ring: 0 0 0 3px rgba(0, 214, 255, 0.18);
}

/* Respect user preference if you want automatic dark:
   uncomment the block below.

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070a12;
    --surface: #0b1020;
    --surface-2: #0e1730;
    --text: #e8eefc;
    --text-2: #a9b7d6;
    --border: rgba(232, 238, 252, 0.12);
    --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 18px 52px rgba(0, 0, 0, 0.45);
    --ring: 0 0 0 3px rgba(0, 214, 255, 0.18);
  }
}
*/

/* -----------------------------
   2) Base + Reset-ish
------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(0, 214, 255, 0.12), transparent 60%),
              radial-gradient(900px 520px at -10% 10%, rgba(45, 108, 255, 0.12), transparent 55%),
              var(--bg);
  line-height: 1.5;
  letter-spacing: 0.1px;
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--aero-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: rgba(0, 214, 255, 0.22);
}

/* -----------------------------
   3) Utilities
------------------------------ */
.container {
  width: min(var(--container), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.stack > * + * {
  margin-top: 14px;
}

.muted { color: var(--text-2); }
.mono  { font-family: var(--font-mono); }
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-2);
}

.hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* -----------------------------
   4) Headings + Text
------------------------------ */
h1, h2, h3, h4 {
  margin: 0 0 10px 0;
  line-height: 1.15;
  letter-spacing: 0.2px;
}

h1 { font-size: clamp(30px, 3.6vw, 46px); }
h2 { font-size: clamp(22px, 2.4vw, 34px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; }

p { margin: 0 0 12px 0; }

/* “Aerospace line” accent */
.heading-accent {
  position: relative;
  padding-left: 14px;
}
.heading-accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 4px;
  height: 0.9em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--aero-accent), var(--aero-primary));
  box-shadow: 0 0 18px rgba(0, 214, 255, 0.25);
}

/* -----------------------------
   5) Buttons
------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--aero-primary), #1a4fff);
  color: white;
  box-shadow: 0 10px 24px rgba(45, 108, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 16px 34px rgba(45, 108, 255, 0.32);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: rgba(45, 108, 255, 0.35);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(45, 108, 255, 0.08);
}

.btn-danger {
  background: linear-gradient(135deg, var(--aero-danger), #ff2f2f);
  color: #fff;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

/* -----------------------------
   6) Top Nav / Header
------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(0, 214, 255, 0.7), transparent 55%),
              linear-gradient(135deg, var(--aero-primary), #0b1636);
  box-shadow: 0 0 26px rgba(0, 214, 255, 0.18);
  border: 1px solid rgba(255,255,255,0.15);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-2);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
}

.nav a:hover {
  color: var(--text);
  background: rgba(45, 108, 255, 0.08);
  text-decoration: none;
}

/* -----------------------------
   7) Hero
------------------------------ */
.hero {
  padding: 44px 0 26px 0;
}

.hero-card {
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(700px 240px at 15% 10%, rgba(0, 214, 255, 0.18), transparent 60%),
    radial-gradient(620px 320px at 90% 0%, rgba(45, 108, 255, 0.20), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), var(--surface));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 28px;
  overflow: hidden;
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -140px;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(0, 214, 255, 0.22), transparent 55%),
              radial-gradient(circle at 70% 65%, rgba(45, 108, 255, 0.18), transparent 60%);
  filter: blur(2px);
  opacity: 0.9;
  pointer-events: none;
}

/* -----------------------------
   8) Cards
------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-body {
  padding: 18px;
}

.card-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}

/* -----------------------------
   9) Grid + Sections
------------------------------ */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.section {
  padding: 18px 0;
}

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* -----------------------------
   10) Forms
------------------------------ */
label {
  display: block;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}

.input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text);
  outline: none;
  transition: box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

textarea { min-height: 110px; resize: vertical; }

.input:focus, select:focus, textarea:focus {
  border-color: rgba(0, 214, 255, 0.40);
  box-shadow: var(--ring);
}

.help {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 13px;
}

.form-row {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
}

/* -----------------------------
   11) Tables
------------------------------ */
.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
  background: var(--surface-2);
}

.table tr:hover td {
  background: rgba(45, 108, 255, 0.06);
}

/* -----------------------------
   12) Badges + Status
------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  font-weight: 800;
  font-size: 12px;
  color: var(--text);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--aero-primary);
  box-shadow: 0 0 14px rgba(45, 108, 255, 0.45);
}

.badge.success .dot { background: var(--aero-success); box-shadow: 0 0 14px rgba(42, 214, 124, 0.45); }
.badge.warn .dot    { background: var(--aero-warn);    box-shadow: 0 0 14px rgba(255, 176, 32, 0.45); }
.badge.danger .dot  { background: var(--aero-danger);  box-shadow: 0 0 14px rgba(255, 77, 77, 0.45); }

/* -----------------------------
   13) Alerts
------------------------------ */
.alert {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
}

.alert.info {
  border-color: rgba(0, 214, 255, 0.35);
  background: rgba(0, 214, 255, 0.10);
}

.alert.success {
  border-color: rgba(42, 214, 124, 0.35);
  background: rgba(42, 214, 124, 0.10);
}

.alert.warn {
  border-color: rgba(255, 176, 32, 0.35);
  background: rgba(255, 176, 32, 0.10);
}

.alert.danger {
  border-color: rgba(255, 77, 77, 0.35);
  background: rgba(255, 77, 77, 0.10);
}

/* -----------------------------
   14) Footer
------------------------------ */
.footer {
  padding: 26px 0 40px 0;
  color: var(--text-2);
  border-top: 1px solid var(--border);
  margin-top: 34px;
}

/* -----------------------------
   15) Small “aerospace” details
------------------------------ */
.panel-lines {
  position: relative;
}

.panel-lines::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 40% 20%, black 20%, transparent 65%);
  opacity: 0.6;
  pointer-events: none;
}