/* ===== 1) Core Palette ===== */
:root {
  /* Neutrals */
  --white: #ffffff;
  --black: #0b0f14;

  /* Brand / Primary */
  --brand-900: #1a2238;
  /* header/nav dark */
  --brand-700: #1e40af;
  /* primary hover/deeper */
  --brand-600: #1d4ed8;
  /* primary base */
  --brand-100: #e0e7ff;
  /* subtle brand tint (top bars, hovers) */

  /* Status / Accents */
  --accent-amber: #fbbf24;
  /* major */
  --accent-red: #ef4444;
  /* super major */
  --danger: #b91c1c;
  /* danger text/bg accents */

  /* Greys (merged + standardized) */
  --grey-900: #111827;
  --grey-800: #1f2933;
  /* body text */
  --grey-700: #374151;
  /* hover text / strong */
  --grey-600: #4b5563;
  /* secondary text */
  --grey-500: #64748b;
  /* slate-muted text (merged) */
  --grey-400: #94a3b8;
  /* subtle icon/hover borders */
  --grey-300: #cbd5e0;
  /* PRIMARY BORDER (merged d1d5db/cbd5e0 -> cbd5e0) */
  --grey-200: #e5e7eb;
  /* table row borders */
  --grey-100: #f3f4f6;
  /* subtle header bg */
  --grey-050: #f7f9fc;
  /* app background */

  /* Link hover tint */
  --blue-500: #2563eb;
  /* alternative hover for CTA */
}

/* ===== 2) Semantic Color Tokens ===== */
:root {
  /* App surfaces & text */
  --color-bg: var(--grey-050);
  --color-text: var(--grey-800);
  --color-text-strong: var(--grey-700);
  --color-text-muted: var(--grey-500);

  --color-surface: var(--white);
  /* cards, panels */
  --color-surface-muted: var(--grey-100);
  /* table th, subtle sections */
  --color-elevated-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  --color-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  --color-soft-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

  --color-border: var(--grey-300);
  /* primary border */
  --color-border-subtle: var(--grey-200);

  /* Brand & actions */
  --color-brand: var(--brand-900);
  --color-primary: var(--brand-600);
  --color-primary-hover: var(--brand-700);
  --color-brand-tint: var(--brand-100);

  /* Links */
  --color-link: var(--brand-600);
  --color-link-hover: var(--blue-500);

  /* Header / Nav */
  --color-header-bg: var(--brand-900);
  --color-header-text: var(--white);
  --color-nav-link: var(--white);
  --color-nav-link-hover-bg: #2e3b55;
  /* keep distinct for contrast on dark */

  /* Top bar */
  --color-topbar-bg: var(--brand-100);
  --color-topbar-text: var(--brand-900);
  --color-topbar-hover-text: var(--grey-700);
  --color-topbar-hover-border: var(--grey-400);

  /* Badges, statuses */
  --color-badge-bg: var(--grey-500);
  --color-badge-text: var(--white);
  --color-card-major: var(--accent-amber);
  --color-card-super-major: var(--accent-red);

  /* Modal */
  --color-modal-bg: var(--brand-900);
  --color-modal-text: var(--white);

  /* Misc */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-2xl: 12px;
}

/* dark mode */

/* =========================================================
   Dark Mode — variable overrides
   Triggered by <html data-theme="dark-mode">
   ========================================================= */
html[data-theme="dark-mode"] {
  /* Neutrals */
  --white: #94a3b8;
  --black: #0b0f14;
  /* App surfaces & text */
  --color-bg: #55545c;
  /* slate-900 */
  --color-text: var(--white);
  /* slate-200 */
  --color-text-strong: #f8fafc;
  /* slate-50 */
  --color-text-muted: #94a3b8;
  /* slate-400 */

  --color-surface: var(--brand-900);
  /* slate-800 */
  --color-surface-muted: #1f2937;
  /* slate-700 */
  --color-elevated-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  --color-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  --color-soft-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);

  --color-border: #334155;
  /* slate-600 */
  --color-border-subtle: #1f2937;
  /* slate-700 */

  /* Brand & actions */
  --color-brand: #b2afaf;
  --color-primary: var(--brand-600);
  --color-primary-hover: var(--brand-700);
  --color-brand-tint: #0b1220;
  /* deeper tint for hover backgrounds */

  /* Links */
  --color-link: var(--brand-600);
  --color-link-hover: #3b82f6;
  /* brighter hover on dark */

  /* Header / Nav */
  --color-header-bg: var(--brand-900);
  --color-header-text: var(--white);
  --color-nav-link: var(--white);
  --color-nav-link-hover-bg: #2a3654;
  /* softer contrast for hover */

  /* Top bar */
  --color-topbar-bg: #111827;
  /* align with surface */
  --color-topbar-text: #e5e7eb;
  --color-topbar-hover-text: #cbd5e1;
  --color-topbar-hover-border: #64748b;

  /* Badges, statuses */
  --color-badge-bg: #475569;
  /* slate-600 */
  --color-badge-text: var(--white);
  --color-card-major: var(--accent-amber);
  --color-card-super-major: var(--accent-red);

  /* Modal */
  --color-modal-bg: #0b1220;
  /* deep navy */
  --color-modal-text: var(--white);
}



/* End Dark Mode */


/* ===== 3) Base / Reset ===== */
* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* ===== 4) Utilities ===== */
.units {
  padding-top: 8px;
}

.hidden {
  display: none !important;
}

a.user-link {
  color: var(--black);
}

/* Desktop/Mobile display toggles */
.desktop-display {
  display: block;
}

.mobile-display {
  display: none;
}

@media (max-width: 768px) {
  .desktop-display {
    display: none !important;
  }

  .mobile-display {
    display: block !important;
  }
}

/* ===== 5) Header & Nav ===== */
header {
  background-color: var(--color-header-bg);
  padding: 1rem;
  color: var(--color-header-text);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.title-link a {
  font-size: 1.1rem;
  color: var(--color-header-text);
  text-decoration: none;
  font-weight: 600;
}

.menu-toggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--color-header-text);
  cursor: pointer;
  display: inline-block;
}

.header-nav {
  display: none;
  flex-direction: column;
  width: 100%;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.header-nav a {
  color: var(--color-nav-link);
  font-size: 1rem;
  text-decoration: none;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.header-nav a:hover {
  background-color: var(--color-nav-link-hover-bg);
}

.header-inner.active .header-nav {
  display: flex;
}

@media (min-width: 640px) {
  .menu-toggle {
    display: none;
  }

  .header-nav {
    display: flex !important;
    flex-direction: row;
    gap: 1rem;
    margin-top: 0;
    padding-right: 8px;
    width: auto;
  }
}

nav a {
  color: var(--color-nav-link);
  margin-left: 1rem;
  text-decoration: none;
  font-weight: 600;
}

nav a:hover {
  color: var(--grey-300);
}

/* ===== 6) Top Bar ===== */
.top-bar {
  background: var(--color-topbar-bg);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: flex-end;
}

.top-bar a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--color-link);
  font-weight: 600;
}

/* ===== 7) Auth Links ===== */
.auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth a {
  text-decoration: none;
  color: var(--color-topbar-text);
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.auth a:hover {
  background-color: var(--color-topbar-hover-text);
  color: var(--white);
  border-color: var(--color-topbar-hover-border);
}

/* ===== 8) Layout ===== */
.container {
  display: flex;
  flex-direction: row;
  padding: 1.5rem;
  gap: 2rem;
}

.incident-list {
  flex: 1;
  overflow-y: auto;
  max-height: 80vh;
}

.map-container {
  flex: 2;
  height: 80vh;
  border-radius: var(--radius-xl);
}

/* ===== 9) Cards / Panels ===== */
.card {
  background-color: var(--color-surface);
  border-left: 5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--color-soft-shadow);
}

.card.major {
  border-left-color: var(--color-card-major);
}

.card.super-major {
  border-left-color: var(--color-card-super-major);
}

.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.incident-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.25rem;
}

.units {
  font-size: 0.875rem;
  color: var(--grey-600);
}

.badge {
  background-color: var(--color-badge-bg);
  color: var(--color-badge-text);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

/* ===== 10) Modal ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--color-modal-bg);
  color: var(--color-modal-text);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  animation: fadeIn 0.3s ease-out;
}

.modal-close {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--grey-400);
  float: right;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--white);
}

h1 {
  margin-top: 0;
  color: var(--color-brand);
}

#modalBody h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--color-modal-text);
}

#modalBody p {
  margin: 0.5rem 0;
  color: var(--white);
}

#viewDetailsBtn {
  margin-top: 1rem;
  width: 100%;
  background: var(--color-primary);
  color: var(--white);
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

#viewDetailsBtn:hover {
  background: var(--color-link-hover);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 11) Incident Summary & Tables ===== */
.incident-summary {
  background: var(--color-header-bg);
  color: var(--white);
  border-radius: var(--radius-2xl);
  padding: 1.25rem;
  box-shadow: var(--color-card-shadow);
}

.incident-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
  margin-top: 1rem;
}

.incident-fields p {
  margin: 0;
}

.table,
.uci-card-list {
  width: 100%;
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--color-card-shadow);
  padding: 1rem;
}

.table summary {
  cursor: pointer;
  font-weight: 600;
}

.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
}

.table th {
  background-color: var(--color-surface-muted);
}

/* ===== 12) UCI / Radio Sections ===== */
.uci-section,
.radio-section {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: 1rem;
  box-shadow: var(--color-card-shadow);
}

.uci-card {
  background: #f9fafb;
  border-left: 5px solid var(--color-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  margin-top: 0.75rem;
}

.uci-verified {
  border-left: 5px solid #0fba1a;
}

/* verification green left as distinct */

.uci-meta {
  font-size: 0.8rem;
  text-align: right;
  color: var(--grey-600);
  margin-top: 0.25rem;
}

textarea[name="message"] {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  width: 100%;
  background-color: #f9fafb;
  resize: vertical;
  margin-bottom: 0.5rem;
}

/* ===== 13) Buttons & Links ===== */
.send-button,
.login-button {
  background-color: var(--color-primary);
  color: var(--white);
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.send-button:hover,
.login-button:hover {
  background-color: var(--color-primary-hover);
}

.uci-form-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem 0;
}

.uci-guidelines {
  font-size: 0.85rem;
  color: var(--grey-400);
  margin: 0.25rem 0 0.5rem;
}

.uci-guidelines a {
  color: var(--color-link);
  text-decoration: underline;
}

/* Toggle chip */
.toggle-button {
  cursor: pointer;
  background-color: var(--grey-200);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
}

/* ===== 14) Login ===== */
.login-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
}

.login-footer a {
  color: var(--color-brand);
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-container {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: var(--radius-2xl);
  box-shadow: var(--color-elevated-shadow);
  width: 100%;
  max-width: 400px;
}

.login-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--color-brand);
  text-align: center;
}

/* ===== 15) Admin Panel ===== */
.admin-panel {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.admin-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-brand);
}

.admin-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-btn {
  background-color: #f1f5f9;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn:hover {
  background-color: var(--color-brand-tint);
  border-color: #93c5fd;
}

.danger-zone .admin-btn {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: var(--danger);
}

.danger-zone .admin-btn:hover {
  background-color: #fecaca;
}

.yeeeeer {
  color: var(--black);
}

/* ===== 16) TX Player ===== */
.tx-player {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: 1.25rem;
  box-shadow: var(--color-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tx-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tx-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-brand);
}

.tx-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.tx-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.tx-btn {
  background-color: var(--color-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--color-brand);
  transition: background-color 0.2s ease;
}

.tx-btn:hover {
  background-color: var(--color-surface);
}

.tx-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--grey-600);
}

.tx-bar-wrapper {
  flex-grow: 1;
  height: 6px;
  border-radius: 4px;
  background-color: #e2e8f0;
  overflow: hidden;
  position: relative;
}

.tx-bar-bg {
  height: 100%;
  background-color: transparent;
}

.tx-bar-fill {
  height: 100%;
  width: 0%;
  background-color: var(--color-primary);
  transition: width 0.1s linear;
}

.prefs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.prefs-section {
  background: var(--white);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}