/* ==========================================================================
   BayBot Dynamics - dark theme
   Applies only when <html data-theme="dark"> (the sun / moon button in the menu bar;
   the server adds the button and this file to every page, see lib/theme.js).
   The "site plan" idea carries over: a night-time blueprint. Deep navy paper,
   fine blue lines, light ink. Product photos keep a white plate so they look right.
   ========================================================================== */

/* ---- the switch (shown in both themes) ---------------------------------- */
.theme-toggle {
    order: 3; flex: none; display: inline-grid; place-items: center;
    width: 40px; height: 40px; margin-left: 12px; padding: 0;
    color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
    cursor: pointer; transition: background-color .2s ease, border-color .2s ease;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.theme-toggle:focus-visible { outline: 3px solid #8fb4ff; outline-offset: 2px; }
.theme-toggle .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
.nav-container > .nav-menu { order: 2; margin-left: auto; }
.nav-container > .mobile-menu-toggle { order: 4; }
@media (min-width: 969px) {
    .nav-links > li > a { white-space: nowrap; }
}
.nav-container > .logo { flex: none; }
@media (min-width: 969px) and (max-width: 1120px) {
    .nav-links > li > a, .nav-links > li > a:visited { font-size: .9rem; }
    .nav-menu .btn-primary { padding: .6rem .9rem; }
    .theme-toggle { margin-left: 8px; }
}
@media (min-width: 969px) and (max-width: 1320px) {
    .nav-links { gap: clamp(14px, 1.6vw, 24px); }
    .nav-menu { gap: 18px; }
}
@media (max-width: 968px) {
    .theme-toggle { margin-left: auto; margin-right: 8px; }
}

/* ---- tokens ---------------------------------------------------------------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --paper: #0b1426;
    --tint: #0f1c35;
    --tint-2: #15264a;
    --line: #22365c;
    --line-strong: #34507f;
    --ink: #e6eefb;
    --muted: #a7b8d8;
    --blue: #6b97ff;
    --blue-deep: #a9c2ff;
    --navy: #060e1f;
    --navy-2: #0a1730;
    --on-navy: #dce7fb;
    --card: #101d38;
    /* the older stylesheet uses these mostly as TEXT colours (headings, labels, table values) */
    --dark-bg: #e6eefb;
    --dark-gray: #c9d6ee;
    --dark-blue: #c9d6ee;
    --medium-gray: #a7b8d8;
    /* the older "frosted glass" layer: translucent dark instead of translucent white */
    --glass: rgba(16, 29, 56, .6);
    --glass-strong: rgba(16, 29, 56, .8);
    --glass-blue: rgba(43, 76, 140, .28);
    --page-blue: #0b1426;
    --page-blue-soft: #0b1426;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, .45);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }

/* ---- surfaces that were hard-coded white -> dark cards ------------------- */
html[data-theme="dark"] :is(.about-section, .faq-section, .chat-messages, .chat-input-row, .chat-status,
    .model-card, .product-feature, .spec-block, .spec-blocks > *, .featured-product-card, .wizard-card, .wizard-option,
    .radio-card-body, .loc-card, .loc-chip, .industry-chips > *, .industry-chips a, .category-tab-bar, .category-tab-menu,
    .family-fold-btn, .pl-disclaimer, .chat-panel .chat-card, .industry-card, .form-card, .contact-form, .demo-form) {
    background: var(--card);
    color: var(--ink);
}
html[data-theme="dark"] :is(.contact-card, .chat-card, .buy-card) { background: var(--card); color: var(--ink); }
html[data-theme="dark"] .hero-media-caption { background: var(--card); color: var(--ink); }
html[data-theme="dark"] .hero-media-caption:hover { color: #fff; }
html[data-theme="dark"] .hero-product-image:not(.is-photo):not(.is-new) { filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .55)); }
html[data-theme="dark"] .dropdown { background: var(--card); border-color: var(--line-strong); }
html[data-theme="dark"] .dropdown a, html[data-theme="dark"] .dropdown a:visited { color: var(--ink); }
html[data-theme="dark"] .dropdown a:hover { background: var(--tint-2); color: #fff; }
html[data-theme="dark"] .industries-grid > .industry-card:hover { background: var(--tint-2); }
html[data-theme="dark"] .brand-band-hivebotics { background: var(--tint); }
html[data-theme="dark"] .notice-warning { background: #2a2210; color: #f3dca0; border-color: #5c4a1c; }
html[data-theme="dark"] .hero-dot { background: var(--paper); }
html[data-theme="dark"] .accordion-header:hover { background: var(--tint-2); }

/* ---- forms ----------------------------------------------------------------- */
html[data-theme="dark"] :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"],
    input[type="search"], input[type="date"], select, textarea, .form-group input, .form-group select, .form-group textarea) {
    background: #0a1630; color: var(--ink); border-color: var(--line-strong);
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #8a9cc0; }
html[data-theme="dark"] .form-status.is-error, html[data-theme="dark"] input[aria-invalid="true"] { color: #ff9b8f; border-color: #ff9b8f; }

/* ---- buttons that were white on light ---------------------------------------- */
html[data-theme="dark"] .btn-outline { color: var(--ink); border-color: var(--line-strong); }
html[data-theme="dark"] .btn-outline:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn-secondary { background: #2f6cf0; border-color: #2f6cf0; color: #fff; }
html[data-theme="dark"] .btn-primary:hover, html[data-theme="dark"] .btn-secondary:hover { background: #4a80f5; border-color: #4a80f5; }
html[data-theme="dark"] .nav-menu .btn-primary, html[data-theme="dark"] .cta-section .btn-primary { background: #fff; color: #0a1f44; border-color: #fff; }

/* ---- product photos keep a white plate -------------------------------------- */
html[data-theme="dark"] :is(.model-card img, .featured-product-card img, .product-hero img, .pl-gallery img,
    .why-choose-image .feature-image, .product-image img, .dropdown-industries img) {
    background-color: #fff;
}

/* ---- tables, quotes, code ---------------------------------------------------- */
html[data-theme="dark"] table { color: var(--ink); }
html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: var(--line); }
html[data-theme="dark"] .comparison-table th { background: #13244a; }
html[data-theme="dark"] main a:not([class]), html[data-theme="dark"] section p a:not([class]) { color: #8fb0ff; }

/* white text on blue: use a deeper blue so it stays readable */
html[data-theme="dark"] :is(.chat-launcher-btn, .back-to-top, .video-embed-play, .pl-preview-bar, .loc-chip:hover, .chat-send, .chat-input-row button, .category-tab.active, .category-tab[aria-selected="true"]) { background-color: #2f6cf0; border-color: #2f6cf0; color: #fff; }

/* ...and in these few places as BACKGROUNDS: keep them dark */
html[data-theme="dark"] :is(.navbar, .navbar.scrolled, .why-choose-section, .chat-header, .footer, .product-video-section, .loc-hq-card) { background: var(--navy); }
@media (max-width: 968px) { html[data-theme="dark"] .nav-menu { background: var(--navy); } }
html[data-theme="dark"] .skip-link:focus { background: #2f6cf0; color: #fff; }

/* parts store */
html[data-theme="dark"] :is(.pl-toolbar, .pl-table-wrap, .pl-tab) { background: var(--card); }
html[data-theme="dark"] .pl-tab:hover, html[data-theme="dark"] .pl-tab.is-active { background: #2f6cf0; color: #fff; border-color: #2f6cf0; }
html[data-theme="dark"] .pl-table-wrap tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
html[data-theme="dark"] .pl-price { color: #a9c2ff; }

/* product pages: wizard, buy box */
html[data-theme="dark"] .product-wizard { background: var(--tint); }
html[data-theme="dark"] .stripe-test-banner { background: #2a2210; color: #f3dca0; border-color: #5c4a1c; }
html[data-theme="dark"] body::before { display: none; }

/* blog */
html[data-theme="dark"] .blog-card { background: var(--card); }
html[data-theme="dark"] .blog-card:hover { box-shadow: 0 14px 30px rgba(0, 0, 0, .45); }
html[data-theme="dark"] .blog-card-body h2 a, html[data-theme="dark"] .blog-card-body h3 a { color: var(--ink); }
html[data-theme="dark"] .blog-card-body h2 a:hover, html[data-theme="dark"] .blog-card-body h3 a:hover, html[data-theme="dark"] .blog-more, html[data-theme="dark"] .blog-body a { color: #8fb0ff; }
html[data-theme="dark"] .blog-table th { background: #13244a; }
html[data-theme="dark"] .blog-cta { background: #13244a; }
