/* ============================================================
   NanoTech-kw | Light theme (home page + Tech Guide)
   Active when <html data-theme="light"> (js/theme.js). Dark stays
   the default design; this file only overrides colours.
   ============================================================ */

html[data-theme="light"] {
    color-scheme: light;
    --lt-bg: #f1f5f9;
    --lt-card: #ffffff;
    --lt-border: #e2e8f0;
    --lt-border-strong: #cbd5e1;
    --lt-text: #0f172a;
    --lt-text-2: #1e293b;
    --lt-text-3: #334155;
    --lt-muted: #475569;
    --lt-accent: #0284c7;

    /* Tech Guide variables */
    --dark-bg: var(--lt-bg);
    --card-bg: var(--lt-card);
    --border: var(--lt-border);
    --muted: var(--lt-muted);
    --text: var(--lt-text);
    --accent: var(--lt-accent);
}
html[data-theme="dark"] { color-scheme: dark; }

/* ---------- Shared ---------- */
html[data-theme="light"] body { background-color: var(--lt-bg); color: var(--lt-text); }
/* Animated network background: the dark design's pale sky blue at 30%
   nearly vanishes on light grey, so use a deeper blue and more strength. */
html[data-theme="light"] .net-bg svg,
html[data-theme="light"] svg.opacity-30 { opacity: .75; }
html[data-theme="light"] #lineGrad stop:first-child { stop-color: #0369a1; stop-opacity: .7; }
html[data-theme="light"] #lineGrad stop:last-child { stop-color: #0284c7; stop-opacity: .18; }
html[data-theme="light"] .node-pulse { fill: #0284c7; }
html[data-theme="light"] .sfx-top { background: rgba(255, 255, 255, .95); color: var(--lt-accent); box-shadow: 0 8px 22px rgba(15, 23, 42, .15); }
html[data-theme="light"] .sfx-top .sfx-ring { stroke: var(--lt-accent); }
html[data-theme="light"] .sfx-top .sfx-ring-bg { stroke: rgba(2, 132, 199, .18); }
html[data-theme="light"] mark { background: rgba(250, 204, 21, .45); }

/* ============================================================
   Home page (Tailwind classes)
   ============================================================ */
html[data-theme="light"] body.network-bg {
    background-image:
        radial-gradient(circle at 25% 25%, rgba(2, 132, 199, .07) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(14, 165, 233, .07) 0%, transparent 50%),
        linear-gradient(to right, rgba(148, 163, 184, .25) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148, 163, 184, .25) 1px, transparent 1px);
}
html[data-theme="light"] .bg-darkBg { background-color: var(--lt-bg); }
html[data-theme="light"] .bg-darkBg\/90 { background-color: rgba(255, 255, 255, .9); }
html[data-theme="light"] .bg-cardBg,
html[data-theme="light"] .bg-cardBg\/90,
html[data-theme="light"] .bg-cardBg\/95 { background-color: rgba(255, 255, 255, .95); }
html[data-theme="light"] .bg-slate-800,
html[data-theme="light"] .bg-slate-800\/90 { background-color: #e2e8f0; }
html[data-theme="light"] .bg-slate-800\/50 { background-color: rgba(226, 232, 240, .6); }
html[data-theme="light"] .bg-slate-900\/50,
html[data-theme="light"] .bg-slate-900\/70 { background-color: rgba(226, 232, 240, .55); }
html[data-theme="light"] .hover\:bg-slate-700:hover { background-color: #cbd5e1; }
html[data-theme="light"] .from-darkBg { --tw-gradient-from: var(--lt-bg) var(--tw-gradient-from-position); --tw-gradient-to: rgba(241, 245, 249, 0) var(--tw-gradient-to-position); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }

html[data-theme="light"] .text-white { color: var(--lt-text); }
html[data-theme="light"] .text-slate-100,
html[data-theme="light"] .text-slate-200 { color: var(--lt-text-2); }
html[data-theme="light"] .text-slate-300 { color: var(--lt-text-3); }
html[data-theme="light"] .text-slate-400,
html[data-theme="light"] .text-slate-500 { color: var(--lt-muted); }
html[data-theme="light"] .text-accentBlue,
html[data-theme="light"] .hover\:text-accentBlue:hover,
html[data-theme="light"] .group:hover .group-hover\:text-accentBlue { color: var(--lt-accent); }
/* Text that must stay light: on coloured hover backgrounds. */
html[data-theme="light"] .hover\:text-white:hover { color: #fff; }
/* Bright accents tuned for a dark page are too pale on white. */
html[data-theme="light"] .text-emerald-400 { color: #059669; }
html[data-theme="light"] .text-amber-400 { color: #d97706; }
html[data-theme="light"] .text-pink-400 { color: #db2777; }
html[data-theme="light"] .text-red-500 { color: #dc2626; }
html[data-theme="light"] .text-sky-400 { color: #0284c7; }

html[data-theme="light"] .border-slate-800,
html[data-theme="light"] .border-slate-800\/80 { border-color: var(--lt-border); }
html[data-theme="light"] .border-slate-700 { border-color: var(--lt-border-strong); }
html[data-theme="light"] .bg-white { box-shadow: 0 0 0 1px var(--lt-border); }
html[data-theme="light"] .interactive-card:hover,
html[data-theme="light"] .shadow-lg,
html[data-theme="light"] .shadow-xl,
html[data-theme="light"] .shadow-2xl { box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }

/* Form fields */
html[data-theme="light"] input.bg-darkBg,
html[data-theme="light"] select.bg-darkBg,
html[data-theme="light"] textarea.bg-darkBg { background-color: #fff; color: var(--lt-text); }
html[data-theme="light"] .text-white::placeholder { color: #94a3b8; }

/* Social buttons in the footer keep their brand colour as the icon. */
html[data-theme="light"] footer a.rounded-full.bg-cardBg { background-color: #fff; }

/* ============================================================
   Tech Guide (its own CSS uses the variables above)
   ============================================================ */
html[data-theme="light"] body:not(.network-bg) {
    background:
        radial-gradient(circle at 25% 25%, rgba(2, 132, 199, .07), transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(14, 165, 233, .07), transparent 50%),
        linear-gradient(rgba(148, 163, 184, .22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .22) 1px, transparent 1px),
        var(--lt-bg);
    background-size: 100% 100%, 100% 100%, 50px 50px, 50px 50px, auto;
}
html[data-theme="light"] :is(.hero h1, .card h3, #fallback h2, .ai-response h2, .ai-response h3, .ai-response h4, .ht-card h3, .proto-card h3, .video-card h3) { color: var(--lt-text); }
html[data-theme="light"] .ai-response pre code,
html[data-theme="light"] :is(.card, .ht-card, .proto-card) code { color: #075985; }
html[data-theme="light"] .ai-response pre { background: #f8fafc; border-color: var(--lt-border); }
html[data-theme="light"] :is(.global-results, .saved-panel) { background: #fff; box-shadow: 0 18px 40px rgba(15, 23, 42, .15); }
html[data-theme="light"] .stats:not(.loaded) .stat-value { background-image: linear-gradient(90deg, #e2e8f0 0, #f1f5f9 50%, #e2e8f0 100%); }
html[data-theme="light"] .tabs button.active { color: #fff; }
html[data-theme="light"] .tg-toast { box-shadow: 0 8px 24px rgba(15, 23, 42, .2); }
html[data-theme="light"] .also-found { background: rgba(2, 132, 199, .04); }
html[data-theme="light"] code.command { color: #075985; background: #e0f2fe; border-color: #bae6fd; }
html[data-theme="light"] .subnet-error { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }

/* ---------- The toggle button itself ---------- */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 40px; height: 36px; padding: 0 10px; border-radius: 999px; cursor: pointer;
    background: var(--card-bg, #131f3b); color: var(--accent, #38bdf8);
    border: 1px solid var(--border, #334155); font: 600 13px/1 system-ui, sans-serif;
    transition: background-color .2s, border-color .2s, transform .15s;
}
.theme-toggle:hover { border-color: var(--accent, #38bdf8); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle .ti { font-size: 15px; line-height: 1; transition: rotate .4s ease; }
.theme-toggle:hover .ti { rotate: 25deg; }
html[data-theme="light"] .theme-toggle { background: #fff; border-color: var(--lt-border-strong); }

/* Smooth colour change when switching (not on first paint). */
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important;
}
