/* =============================================================================
   HydroScout Global Stylesheet (v1.1)
   Shared base resets, typography, links/buttons, top navigation, footer, and
   modal chrome used across the static HTML pages. Page-specific functional CSS
   (map, matrix drawer, WSC widget, feature grid, etc.) remains in each page's
   embedded <style> tag to avoid global namespace pollution.
   ============================================================================= */

/* ---- Root color tokens (superset union; pages may override inline) --------- */
:root {
    --bg: #0b0f19;
    --bg-dark: #0f172a;
    --card: #111827;
    --card-soft: rgba(17, 24, 39, 0.6);
    --text: #f9fafb;
    --text-main: #f8fafc;
    --muted: #94a3b8;
    --muted-dark: #64748b;
    --accent: #0284c7;
    --accent-blue: #38bdf8;
    --accent-light: #38bdf8;
    --accent-green: #22c55e;
    --border: rgba(255, 255, 255, 0.1);
    --border-color: #334155;
    --panel-bg: rgba(30, 41, 59, 0.85);
    --green: #22c55e;
}

/* ---- Universal resets ------------------------------------------------------ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, html {
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
}
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background-color: #0b0f19;
}

/* ---- Standard links -------------------------------------------------------- */
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: none; }

/* ---- Standard button base --------------------------------------------------- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
    border: 0;
    cursor: pointer;
}
.btn:hover {
    background: #0369a1;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ---- Top navigation bar (sticky site chrome) ------------------------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-brand { color: var(--text); text-decoration: none; }
.nav-brand:hover { text-decoration: none; }
.logo-container { display: flex; align-items: center; gap: 0.5rem; }
.logo-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}
.logo-title .brand-white { color: var(--text); }
.logo-title .brand-blue { color: var(--accent-light); }
.nav-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-links a.plain { color: var(--muted); font-size: 0.85rem; font-weight: 600; transition: color 0.15s ease; }
.nav-links a.plain:hover { color: var(--text); }
.nav-link {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.nav-link.cta {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.nav-link.cta:hover { background: #0369a1; }

/* ---- Footer chrome ---------------------------------------------------------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px 24px;
    background-color: #0b0f19;
    color: var(--muted-dark);
    font-size: 0.85rem;
    margin-top: 64px;
}
.footer-grid {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}
.footer h4 { color: var(--text); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 12px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer ul a { color: var(--muted); transition: color 0.2s; }
.footer ul a:hover { color: var(--text); }
.footer .brand { font-size: 1.15rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.footer .brand span { color: var(--accent-light); }
.subfooter {
    max-width: 1120px;
    margin: 24px auto 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--muted-dark);
}

/* ---- Footer / standard modal chrome ----------------------------------------- */
#footerModalOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.f-modal-body {
    display: none;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    width: 100%;
    color: #cbd5e1;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}
.f-modal-body h3 { margin: 0; color: #f8fafc; font-size: 1.25rem; }
.f-modal-body input,
.f-modal-body textarea {
    width: 100%;
    padding: 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #f8fafc;
}

/* ---- Common responsive tweaks ----------------------------------------------- */
@media (max-width: 600px) {
    .nav { padding: 10px 16px; }
    .nav-link { font-size: 0.78rem; padding: 7px 10px; }
}
