/* ================================================================
   style.css — DRONNR global stylesheet (Redesigned for Light Mode)
   Modern, high-usability style with a white background.
================================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --bg:       #fcfcfc;   /* Soft white page background */
  --surface:  #f3f4f6;   /* Input and surface backgrounds */
  --card:     #ffffff;   /* Pure white card backgrounds */
  --border:   #e5e7eb;   /* Light gray borders */
  --accent:   #1e3a8a;   /* Deep Blue from logo */
  --accent-light: #3b82f6; /* Lighter blue for hover/selection */
  --accent-alt: #ea580c; /* Orange from logo drone */
  --text:     #111827;   /* Slate 900 - nearly black text */
  --muted:    #6b7280;   /* Slate 500 - secondary text */
  --success:  #10b981;   /* Emerald 500 */
  --warning:  #f59e0b;   /* Amber 500 */
  --danger:   #ef4444;   /* Red 500 */
  --purple:   #8b5cf6;   /* Violet 500 */
  --shadow:   0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ───────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Subtle pattern for background depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* ── Navigation bar ─────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 72px;
  background: #000000; /* Black background to blend with the logo */
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.logo {
  cursor: pointer;
  display: flex;
  align-items: center;
}
.logo img {
  height: 48px; /* Increased size for visibility */
  display: block;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  color: #a1a1aa; /* Zinc 400 */
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-decoration: none;
  transition: all 0.2s;
}
.nav-link:hover { color: #ffffff; background: rgba(255,255,255,0.05); }
.nav-link.active {
  color: #ffffff;
  background: var(--accent-light);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  color: #a1a1aa;
}

/* ── Main view container ────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

#app.fade-in {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page hero heading ──────────────────────────────────────── */
.view-hero { padding: 3rem 0 2rem; }

.hero-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--accent-alt);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.view-hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.view-hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  color: var(--muted);
  font-size: 1rem;
}

/* ── Stats row ──────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-val.green  { color: var(--success); }
.stat-val.red    { color: var(--danger); }
.stat-val.purple { color: var(--purple); }
.stat-val.cyan   { color: var(--accent-light); }

.stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── Action buttons ─────────────────────────────────────────── */
.action-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tab-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  justify-content: center;
}
.tab-btn {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 99px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
}
.tab-btn:hover { background: var(--surface); }
.tab-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
}

.hidden { display: none !important; }

/* ── Section Header ─────────────────────────────────────────── */
.section-header {
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
}
.section-sub { font-size: 0.8rem; color: var(--muted); }

/* ── Card Grids ────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

/* ── Mission Card ───────────────────────────────────────────── */
.mission-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.mission-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.mission-card::before,
.mission-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--accent-light);
}
.mission-card.bar-yellow::before, .mission-row.bar-yellow::before { background: var(--warning); }
.mission-card.bar-red::before, .mission-row.bar-red::before       { background: var(--danger); }
.mission-card.bar-purple::before, .mission-row.bar-purple::before { background: var(--purple); }

.mc-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.mc-id { font-family: 'Share Tech Mono', monospace; font-size: 0.7rem; color: var(--muted); }

.drone-photo-wrap {
  width: 100%;
  height: 160px;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drone-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.mission-card:hover .drone-photo {
  transform: scale(1.05);
}

.mc-notes {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  line-height: 1.5;
}

.mc-meta {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.mc-meta span { display: flex; align-items: center; gap: 0.5rem; }

.mc-status {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
}
.status-planned  { background: #eff6ff; color: #1e40af; }
.status-active   { background: #ecfdf5; color: #065f46; }
.status-complete { background: #f3f4f6; color: #374151; }
.status-aborted  { background: #fef2f2; color: #991b1b; }

/* ── Mission Row ────────────────────────────────────────────── */
.mission-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.mr-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.status-btn-group {
  display: flex;
  gap: 0.25rem;
}
.status-btn {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
}
.status-btn.active-status {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── Register Form ──────────────────────────────────────────── */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 0 auto;
}
.form-card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.form-body { padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }

.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
}
.field input:focus { border-color: var(--accent-light); outline: none; ring: 2px var(--accent-light); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-light); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 1rem 2rem;
  border-radius: 99px;
  font-weight: 500;
  z-index: 1000;
  transition: transform 0.3s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Live Dot ───────────────────────────────────────────────── */
.live-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-links { display: none; } /* Simplified for mobile */
  .view-hero h1 { font-size: 2rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
