/* Leaflet map CSS (vendored) */
@import "../vendor/leaflet/leaflet.css";

/* Inter — primary UI font. Design spec calls for weights 400/500/600/700.
   JetBrains Mono kept as escape hatch for code blocks. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* See the Tailwind configuration guide for advanced usage
   https://tailwindcss.com/docs/configuration */

@import "tailwindcss" source(none);
@source "../css";
@source "../js";
@source "../../lib/microwaveprop_web";
@source "../../deps/live_table/lib";
@source "../../deps/sutra_ui/lib";

/* live_table / sutra_ui compat: maps shadcn tokens live_table uses to
   daisyUI base colors and provides component CSS for the SutraUI
   primitives wrapped by live_table (select, input-group, dropdown,
   empty state). Must come before the daisyUI plugins so daisyUI's
   primary/accent/error tokens still win in @theme resolution. */
@import "./live_table_compat.css";

/* A Tailwind plugin that makes "hero-#{ICON}" classes available.
   The heroicons installation itself is managed by your mix.exs */
@plugin "../vendor/heroicons";

/* daisyUI Tailwind Plugin. You can update this file by fetching the latest version with:
   curl -sLO https://github.com/saadeghi/daisyui/releases/latest/download/daisyui.js
   Make sure to look at the daisyUI changelog: https://daisyui.com/docs/changelog/ */
@plugin "../vendor/daisyui" {
  themes: false;
}

/* daisyUI theme plugin. You can update this file by fetching the latest version with:
  curl -sLO https://github.com/saadeghi/daisyui/releases/latest/download/daisyui-theme.js
  We ship with two themes, a light one inspired on Phoenix colors and a dark one inspired
  on Elixir colors. Build your own at: https://daisyui.com/theme-generator/ */
/* NTMS Propagation Prediction — dark theme (primary).
   Navy-slate surfaces, indigo-violet accent. Values derived from the
   design-system handoff: bg-2 (#1E2230) is the elevated surface class
   (cards, nav), bg-1 (#161922) is the app body, bg-0 (#0F1218) is the
   deepest page fill. Kept in this codebase's base-100/200/300 convention
   where base-100 is the *lightest* dark surface (elevated). */
@plugin "../vendor/daisyui-theme" {
  name: "dark";
  default: false;
  prefersdark: true;
  color-scheme: "dark";
  --color-base-100: #1E2230;
  --color-base-200: #161922;
  --color-base-300: #0F1218;
  --color-base-content: #F5F6FA;
  --color-primary: #6366F1;
  --color-primary-content: #FFFFFF;
  --color-secondary: #7376F4;
  --color-secondary-content: #FFFFFF;
  --color-accent: #6366F1;
  --color-accent-content: #FFFFFF;
  --color-neutral: #262B3B;
  --color-neutral-content: #F5F6FA;
  --color-info: #60A5FA;
  --color-info-content: #0A1A2B;
  --color-success: #2BD4A4;
  --color-success-content: #052A1E;
  --color-warning: #F5A524;
  --color-warning-content: #2A1A00;
  --color-error: #F05674;
  --color-error-content: #FFFFFF;
  --radius-selector: 0.375rem;
  --radius-field: 0.375rem;
  --radius-box: 0.75rem;
  --size-selector: 0.21875rem;
  --size-field: 0.21875rem;
  --border: 1px;
  --depth: 0;
  --noise: 0;
}

@plugin "../vendor/daisyui-theme" {
  name: "light";
  default: true;
  prefersdark: false;
  color-scheme: "light";
  --color-base-100: #FFFFFF;
  --color-base-200: #F7F8FB;
  --color-base-300: #F1F3F8;
  --color-base-content: #10131C;
  --color-primary: #5458E3;
  --color-primary-content: #FFFFFF;
  --color-secondary: #4A4ED1;
  --color-secondary-content: #FFFFFF;
  --color-accent: #5458E3;
  --color-accent-content: #FFFFFF;
  --color-neutral: #323849;
  --color-neutral-content: #FFFFFF;
  --color-info: #2563EB;
  --color-info-content: #FFFFFF;
  --color-success: #149E74;
  --color-success-content: #FFFFFF;
  --color-warning: #C77700;
  --color-warning-content: #FFFFFF;
  --color-error: #D0324D;
  --color-error-content: #FFFFFF;
  --radius-selector: 0.375rem;
  --radius-field: 0.375rem;
  --radius-box: 0.75rem;
  --size-selector: 0.21875rem;
  --size-field: 0.21875rem;
  --border: 1px;
  --depth: 0;
  --noise: 0;
}

/* Add variants based on LiveView classes */
@custom-variant phx-click-loading (.phx-click-loading&, .phx-click-loading &);
@custom-variant phx-submit-loading (.phx-submit-loading&, .phx-submit-loading &);
@custom-variant phx-change-loading (.phx-change-loading&, .phx-change-loading &);

/* Use the data attribute for dark mode  */
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));

/* Make LiveView wrapper divs transparent for layout */
[data-phx-session], [data-phx-teleported-src] { display: contents }

/* ==========================================================================
   NTMS design tokens — propagation quality + band palette.
   Held outside daisyUI's theme plugin so they can be referenced directly
   from HEEx templates and JS hooks (e.g. the heatmap canvas).
   ========================================================================== */
:root,
:root[data-theme="dark"] {
  --prop-excellent:  #2BD4A4;
  --prop-good:       #9FE6C8;
  --prop-marginal:   #F5D968;
  --prop-poor:       #F59E4B;
  --prop-negligible: #EF6B6B;

  --band-2m:     #60A5FA;
  --band-70cm:   #A78BFA;
  --band-23cm:   #F472B6;
  --band-13cm:   #FB7185;
  --band-9cm:    #FB923C;
  --band-6cm:    #FBBF24;
  --band-3cm:    #A3E635;
  --band-1-25cm: #34D399;
  --band-6mm:    #22D3EE;
}

:root[data-theme="light"] {
  --prop-excellent:  #149E74;
  --prop-good:       #5FC79D;
  --prop-marginal:   #E5B83B;
  --prop-poor:       #E58A3B;
  --prop-negligible: #D45757;

  --band-2m:     #2563EB;
  --band-70cm:   #7C3AED;
  --band-23cm:   #DB2777;
  --band-13cm:   #E11D48;
  --band-9cm:    #EA580C;
  --band-6cm:    #B45309;
  --band-3cm:    #65A30D;
  --band-1-25cm: #059669;
  --band-6mm:    #0891B2;
}

/* Inter as the default UI font. JetBrains Mono reserved for code blocks.
   Callsigns and grid squares are intentionally sans + uppercase (not mono)
   to match product convention. */
html, body {
  font-family:
    "Inter", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

/* Callsign / grid styling helpers. Sans with tight tracking in upper
   case; tabular digits so columns align. */
.callsign { font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.grid-square { font-weight: 500; color: var(--color-base-content); opacity: 0.85; }

/* Fix daisyUI select text alignment — when select class is on the <select>
   element directly, the nested .select select rules cause negative margins
   and misaligned text. Reset them so text sits centered like <input>. */
select.select {
  margin: 0;
  display: flex;
  align-items: center;
}

/* Markdown rendered content — uses daisyUI theme variables for auto dark/light */
.markdown-content {
  max-width: 88rem;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.75;
  color: var(--color-base-content);
}


.markdown-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  border-bottom: 1px solid var(--color-base-300);
  padding-bottom: 0.5rem;
}

.markdown-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  border-bottom: 1px solid var(--color-base-300);
  padding-bottom: 0.25rem;
}

.markdown-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.markdown-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.markdown-content p {
  margin: 0.75rem 0;
}

.markdown-content ul, .markdown-content ol {
  margin: 0.75rem 0;
  padding-left: 2rem;
}

.markdown-content ul { list-style-type: disc; }
.markdown-content ol { list-style-type: decimal; }

.markdown-content li {
  margin: 0.25rem 0;
}

.markdown-content code {
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
  background: var(--color-base-300);
  padding: 0.15em 0.35em;
  border-radius: 0.25rem;
}

.markdown-content pre {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--color-neutral);
  color: var(--color-neutral-content);
  border-radius: 0.5rem;
  overflow-x: auto;
}

.markdown-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
  color: inherit;
}

.markdown-content table {
  display: block;
  overflow-x: auto;
  width: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9em;
}

.markdown-content th, .markdown-content td {
  border: 1px solid var(--color-base-300);
  padding: 0.5rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}

.markdown-content th {
  background: var(--color-base-300);
  font-weight: 600;
}

.markdown-content tbody tr:nth-child(even) {
  background: var(--color-base-200);
}

.markdown-content hr {
  border: none;
  border-top: 2px solid var(--color-base-300);
  margin: 2rem 0;
}

.markdown-content strong {
  font-weight: 700;
}

.markdown-content blockquote {
  border-left: 4px solid var(--color-primary);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  background: var(--color-base-200);
}

.markdown-content a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Allow map interaction through non-content parts of Leaflet popups */
.leaflet-popup { pointer-events: none; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip, .leaflet-popup-close-button { pointer-events: auto; }

/* This file is for your main application CSS */
