
/*
 * Profile and authenticated dashboard styles - Light Theme.
 * Matches the landing page visual system: clean editorial layout, 
 * instrument serif typography, and soft structured cards.
 */

:root {
  --bg: #f6f3ee;
  --line: rgba(22, 27, 35, 0.08);
  --line-strong: rgba(22, 27, 35, 0.12);
  --text: #15171d;
  --muted: #6d7078;
  --soft: #8d9097;
  --dark-bg: #111318;
  --dark-surface: #1a1d24;
  --dark-text: #f5f2ed;
  --mint: #4ec79f;
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-card: 0 12px 28px rgba(18, 24, 33, 0.05);
  --font-body: "Inter", system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #faf7f2 0%, #f6f3ee 100%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  padding-bottom: 60px;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* Navigation */
.dash-nav-shell {
  position: sticky;
  top: 18px;
  z-index: 50;
  width: min(1280px, calc(100% - 32px));
  margin: 20px auto 40px;
}

.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(18, 24, 33, 0.04);
}

.nav-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; }
.nav-icon { background: #111; color: #fff; padding: 4px 8px; border-radius: 8px; font-size: 12px; }
.nav-links { display: flex; align-items: center; gap: 24px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-weight: 500; color: var(--muted); }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; }

/* Buttons */
.btn-dark { background: #111; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid #111; cursor: pointer;}
.btn-light { background: #fff; color: var(--text); border: 1px solid var(--line-strong); padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;}

/* Layout */
.profile-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

/* Typography & Labels */
.meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--soft);
  font-weight: 700;
}
.mint { color: var(--mint) !important; }

/* Hero */
.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 12px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(78, 199, 159, 0.15);
  color: #2b8b6a;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(78, 199, 159, 0.3);
  margin-bottom: 12px;
}

.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }

.profile-info h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  margin: 8px 0;
  letter-spacing: -0.02em;
}

.profile-info p { color: var(--muted); font-size: 15px; margin: 0; }
.profile-actions { display: flex; gap: 12px; }

/* Status Band */
.status-band {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.status-band[data-mode="ok"] .status-dot { background: var(--mint); }
.status-band[data-mode="loading"] .status-dot, .status-band[data-mode="warn"] .status-dot { background: #eab308; }
.status-band[data-mode="error"] .status-dot { background: #ef4444; }

/* Grids & Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.stat-card, .panel {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.stat-card { padding: 20px; }
.stat-card .value { display: block; font-size: 2rem; font-weight: 600; line-height: 1.1; color: var(--text); margin-top: 8px; }
.stat-card .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px 16px;
  font-size: 16px;
  font-weight: 600;
}

/* JS Injected Elements: Active Flight Card */
.card-dark {
  background: var(--dark-bg);
  color: var(--dark-text);
  border: none;
  background-image: radial-gradient(circle at top right, rgba(78, 199, 159, 0.08), transparent 50%);
}

.dark-heading { border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 16px; margin-bottom: 8px; }

.active-flight-list { display: grid; gap: 18px; padding: 0 28px 28px; }
.active-flight-list.single { display: block; }
.active-flight-card { padding: 18px; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; background: rgba(255,255,255,0.02); }
.active-route { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.active-route span { font-size: 3rem; font-family: var(--font-display); font-weight: 500; }
.active-flight-list .active-route span { font-size: 2.2rem; }
.active-route i { flex: 1; height: 1px; background: rgba(255,255,255,0.1); margin: 0 24px; position: relative; }
.active-route i::after { content: "✈"; position: absolute; left: 50%; top: -10px; font-size: 14px; transform: translateX(-50%); color: var(--mint); }

.active-meta, .active-foot { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.active-meta span, .active-foot span { background: var(--dark-surface); padding: 6px 12px; border-radius: 6px; font-size: 12px; border: 1px solid rgba(255,255,255,0.05); color: var(--dark-text);}
.active-foot span { color: var(--muted); }

.tracker-link-btn {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
}

.empty-state { padding: 0 28px 28px; color: var(--muted); font-size: 14px; }

/* JS Injected Elements: Highlights */
.split-list { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 0 28px 28px; }
.split-list h2 { margin: 0 0 16px; }

.mini-bar-row { display: grid; grid-template-columns: 100px 1fr 30px; gap: 16px; align-items: center; font-size: 13px; font-weight: 500; margin-bottom: 12px;}
.mini-bar-track { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.mini-bar-track span { display: block; height: 100%; background: var(--text); border-radius: 999px; }
.mini-bar-value { text-align: right; color: var(--muted); }

/* JS Injected Elements: Route Map */
.route-map-preview { padding: 0 28px 28px; }
.route-map-canvas {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  height: 220px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.route-map-canvas::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 20px 20px; opacity: 0.5;
}

.map-node {
  position: absolute;
  background: #fff;
  border: 1px solid var(--line-strong);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  z-index: 2;
}

.map-node-1 { top: 20%; left: 10%; } .map-node-2 { top: 40%; left: 30%; }
.map-node-3 { top: 70%; left: 20%; } .map-node-4 { top: 30%; right: 20%; }
.map-node-5 { top: 60%; right: 30%; } .map-node-6 { top: 80%; right: 10%; }

.map-line {
  position: absolute;
  height: 1px;
  background: var(--line-strong);
  z-index: 1;
}
.map-line-a { top: 30%; left: 15%; width: 20%; transform: rotate(20deg); }
.map-line-b { top: 50%; left: 25%; width: 40%; transform: rotate(-10deg); }
.map-line-c { top: 40%; right: 25%; width: 25%; transform: rotate(35deg); }

.route-map-list { display: grid; gap: 10px; }
.route-map-list p { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600;}
.route-map-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.route-color { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.route-map-row strong { font-weight: 600; }
.route-map-row small { color: var(--muted); }

/* Filters */
.filter-form { padding: 0 28px 28px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--text); }
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
}
.form-input:focus { outline: none; border-color: var(--text); }
.tool-note { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.filter-actions { display: flex; gap: 12px; }
.filter-actions button { flex: 1; }

/* JS Injected Elements: Tables & Pagination */
.table-wrap { overflow-x: auto; padding: 0 28px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { padding: 16px; border-bottom: 1px solid var(--line-strong); color: var(--soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
td { padding: 16px; border-bottom: 1px solid var(--line); color: var(--text); }
tr:last-child td { border-bottom: none; }

.route-pill, .time-pill {
  background: #fff;
  border: 1px solid var(--line-strong);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
  color: var(--text);
}

.pagination-controls { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; font-size: 13px; color: var(--muted); }
.pagination-controls button {
  background: #fff; color: var(--text); border: 1px solid var(--line-strong);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pagination-controls button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Responsive Adjustments */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; align-items: flex-start; gap: 24px; }
  
  .nav-toggle { 
    display: block; 
    width: 42px; 
    height: 42px; 
    border: 1px solid var(--line-strong); 
    border-radius: 12px; 
    background: #fff; 
    cursor: pointer; 
  }
  
  .nav-toggle span { 
    display: block; 
    width: 16px; 
    height: 2px; 
    margin: 4px auto; 
    background: var(--text); 
    border-radius: 2px; 
  }

  .nav-links { 
    display: none; 
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.98);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
  }

  .nav-links.is-open {
    display: flex;
  }
  
  .nav-links a {
    padding: 12px;
  }
}

/* Ensure the mobile dropdown menu matches Dark Mode when toggled */
[data-theme="dark"] .nav-links {
  background: var(--card-bg);
  border-color: var(--line);
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .split-list { grid-template-columns: 1fr; }
  .active-route { flex-direction: column; align-items: flex-start; gap: 8px; }
  .active-route i { display: none; }
}
/* Share Page Specifics: Lookup Card */
.lookup-card {
  padding: 24px;
  align-self: center; 
  max-width: 420px;
  width: 100%;
}

.lookup-row {
  display: flex;
  align-items: center; /* Vertically centers the input and button */
  gap: 12px;           /* Adds space between them */
}

.lookup-row input {
  flex: 1;             /* Tells the input to take up all remaining space */
  width: auto;         /* Overrides the 100% width from .form-input */
}

.lookup-row button {
  white-space: nowrap; /* Prevents the button text from wrapping */
}
/* Route Planner Specifics */
.route-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  align-items: start;
}

.planner-map {
  background: var(--bg);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  min-height: 480px;
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
}

.planner-map::before {
  content: ""; 
  position: absolute; 
  inset: 0;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 20px 20px; 
  opacity: 0.5;
}

.airport-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(18, 24, 33, 0.05);
  transition: border-color 0.2s, transform 0.2s;
}

.airport-node:hover {
  border-color: var(--mint);
  transform: translateY(-2px);
}

.airport-node strong { font-size: 14px; font-weight: 700; color: var(--text); }
.airport-node small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;}

/* Map Node Fallback Positioning (for the extra nodes JS might render) */
.map-node-7 { top: 25%; right: 40%; } 
.map-node-8 { top: 55%; left: 45%; }

/* Route Cards (Injected by JS) */
.route-list {
  display: grid;
  gap: 16px;
  padding: 24px 28px;
}

.route-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.route-card-header { margin-bottom: 8px; }
.route-card-header h3 { margin: 4px 0 0; font-size: 1.8rem; font-family: var(--font-display); font-weight: 500; }
.route-card-meta { margin: 0 0 20px; color: var(--muted); font-size: 14px; font-weight: 500; }

.route-card-actions { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 12px; 
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .route-grid { grid-template-columns: 1fr; }
  .planner-map { min-height: 320px; }
  .filter-actions { width: 100%; justify-content: stretch; }
  .filter-actions button { flex: 1; }
}

@media (max-width: 500px) {
  .route-card-actions { grid-template-columns: 1fr; }
}
/* Fix form edge spacing */
#routes-filter-form .filter-grid {
  padding: 0 32px !important; /* Pushes inputs away from left/right edges */
}

#routes-filter-form .filter-actions {
  padding: 24px 32px 28px !important; /* Adds space around the buttons */
}

/* Optional: Prevent buttons from stretching too wide on desktop */
@media (min-width: 900px) {
  #routes-filter-form .filter-actions {
    justify-content: flex-end;
  }
  
  #routes-filter-form .filter-actions button {
    min-width: 160px; /* Gives buttons a neat, uniform size */
    flex: 0 auto !important;
  }
}

/* Shared Form Spacing Fix */
#routes-filter-form .filter-grid,
#events-filter-form .filter-grid {
  padding: 0 32px !important;
}

#routes-filter-form .filter-actions,
#events-filter-form .filter-actions {
  padding: 24px 32px 28px !important;
}

@media (min-width: 900px) {
  #routes-filter-form .filter-actions,
  #events-filter-form .filter-actions {
    justify-content: flex-end;
  }
  
  #routes-filter-form .filter-actions button,
  #events-filter-form .filter-actions button {
    min-width: 160px;
    flex: 0 auto !important;
  }
}

/* ATC Events Specifics */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.event-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.event-timeblock .event-date {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

.event-timeblock small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.event-actions {
  display: flex;
  gap: 10px;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
  .featured-grid { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 1fr; gap: 12px; align-items: start; }
  .event-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
}

/* CSP cleanup helpers */
.share-lookup-title {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

.share-lookup-label {
  margin-bottom: 8px;
}

.share-lookup-note {
  margin: 12px 0 0;
}

.form-group-flush {
  margin-bottom: 0;
}

.planner-title-accent {
  font-family: var(--font-display);
  font-style: italic;
}

.planner-filter-form {
  margin-bottom: 24px;
}

.planner-filter-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.planner-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 0 32px;
}

.planner-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px 32px 28px;
}

.native-select {
  appearance: auto;
}

.event-list-padded {
  padding: 24px 28px;
}

.event-card-title {
  margin: 8px 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
}

.event-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.event-main-title {
  display: block;
  margin: 4px 0;
  font-size: 1.1rem;
}

.event-main-detail {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.btn-center {
  display: flex;
  justify-content: center;
  text-align: center;
}

.route-map-empty-state {
  padding-top: 120px;
}

.simbrief-result-link {
  margin-left: 8px;
  color: var(--mint);
  font-weight: 700;
  text-decoration: underline;
}
/* Dashboard Login Specifics */
.auth-card {
  padding: 28px;
  align-self: center;
  max-width: 420px;
  width: 100%;
}

.auth-card h2 {
  margin: 0 0 24px;
  font-size: 1.45rem;
  line-height: 1.12;
}

.auth-submit {
  width: 100%;
}

.auth-card .status-band {
  margin-top: 24px;
  margin-bottom: 16px;
}

.auth-footnote {
  margin: 0;
  text-align: center;
}
/* Centered Login Page Layout */
.auth-layout {
  max-width: 480px;
  margin: 40px auto 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.auth-layout .profile-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-layout .auth-card {
  width: 100%;
  text-align: left;
}


