/*
 * "Instagram" theme (added 2026-09-14) — same mechanism as theme-facebook.css (re-targets the
 * app's existing Tailwind class vocabulary via an `html.theme-instagram` ancestor selector),
 * near-mirror selector list, Instagram's own colors instead. Independent of Dark Mode:
 * `html.theme-instagram` alone = IG's light look, `html.theme-instagram.dark` = IG's real dark
 * mode. The signature IG gradient (orange->pink->purple) is reserved for the theme-picker's own
 * preview swatches (see Views/Pages/Themes.cshtml, _Layout.cshtml's header dropdown) — IG's
 * actual UI chrome (buttons, links) uses their real, much more restrained action blue
 * `#0095f6`, not the gradient, same way Facebook's theme uses FB's real blue rather than
 * anything more decorative.
 */

/* ── Design tokens — LIGHT (Instagram's classic white/near-white look) ── */
html.theme-instagram:not(.dark) {
    --ig-bg: #fafafa;
    --ig-surface: #ffffff;
    --ig-surface-recessed: #fafafa;
    --ig-fill: #efefef;
    --ig-fill-strong: #dbdbdb;
    --ig-border: #dbdbdb;
    --ig-border-soft: #efefef;
    --ig-border-strong: #c7c7c7;
    --ig-text-heading: #262626;
    --ig-text-body: #8e8e8e;
    --ig-text-faint: #c7c7c7;
    --ig-accent: #0095f6;
    --ig-accent-solid: #0095f6;
    --ig-accent-hover: #1877a8;
    --ig-hover-tint: rgba(0, 149, 246, 0.06);
    --ig-hover-tint-strong: rgba(0, 149, 246, 0.1);
    --focus-accent: var(--ig-accent);
    --focus-ring: rgba(0, 149, 246, 0.25);
    color-scheme: light;
}

/* ── Design tokens — DARK (Instagram's own real dark-mode palette) ── */
html.theme-instagram.dark {
    --ig-bg: #000000;
    --ig-surface: #262626;
    --ig-surface-recessed: #121212;
    --ig-fill: #363636;
    --ig-fill-strong: #454545;
    --ig-border: #363636;
    --ig-border-soft: #2c2c2c;
    --ig-border-strong: #525252;
    --ig-text-heading: #fafafa;
    --ig-text-body: #a8a8a8;
    --ig-text-faint: #737373;
    --ig-accent: #4db5ff;
    --ig-accent-solid: #0095f6;
    --ig-accent-hover: #4db5ff;
    --ig-hover-tint: rgba(77, 181, 255, 0.1);
    --ig-hover-tint-strong: rgba(77, 181, 255, 0.16);
    --focus-accent: var(--ig-accent);
    --focus-ring: rgba(77, 181, 255, 0.25);
    color-scheme: dark;
}

/* "Personality" touches (added 2026-09-15) — beyond just recoloring, so each theme reads as
   more than a palette swap. Same zero-view-change mechanism as everything else here: real
   Instagram uses the OS's own system-font stack (no distinctive custom face, unlike Facebook's
   Helvetica-forward choice), so this is subtle on purpose. Border-radius is scoped to
   `button`/`a` elements specifically (not the bare `.rounded-lg` class, which is also used on
   cards/alert banners/badges) — IG's own buttons are a bit softer/rounder than this app's
   default, cards/banners stay exactly as they are. */
html.theme-instagram { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important; }
html.theme-instagram button.rounded-lg, html.theme-instagram a.rounded-lg { border-radius: 0.75rem !important; }
html.theme-instagram body { color: var(--ig-text-heading); }

/* ── Page background ── */
html.theme-instagram body.bg-white {
    background-color: var(--ig-bg) !important;
    background-image: none !important;
}

/* ── Surfaces ── */
html.theme-instagram .bg-white { background-color: var(--ig-surface) !important; }
html.theme-instagram .bg-zinc-50 { background-color: var(--ig-surface-recessed) !important; }
html.theme-instagram .bg-zinc-100 { background-color: var(--ig-fill) !important; }
html.theme-instagram .bg-zinc-200 { background-color: var(--ig-fill-strong) !important; }
html.theme-instagram .bg-zinc-900 { background-color: var(--ig-accent-solid) !important; }
html.theme-instagram .bg-zinc-700,
html.theme-instagram .bg-zinc-800 { background-color: var(--ig-accent-hover) !important; }
html.theme-instagram .bg-zinc-900\/40 { background-color: rgba(0, 0, 0, 0.5) !important; }
html.theme-instagram .bg-zinc-50\/40,
html.theme-instagram .bg-zinc-50\/50,
html.theme-instagram .bg-zinc-50\/60 { background-color: var(--ig-hover-tint) !important; }
html.theme-instagram .bg-zinc-200\/60 { background-color: var(--ig-hover-tint-strong) !important; }

/* ── Text ── */
html.theme-instagram .text-zinc-700,
html.theme-instagram .text-zinc-800,
html.theme-instagram .text-zinc-900 { color: var(--ig-text-heading) !important; }
html.theme-instagram .text-zinc-500,
html.theme-instagram .text-zinc-600 { color: var(--ig-text-body) !important; }
html.theme-instagram .text-zinc-300,
html.theme-instagram .text-zinc-400 { color: var(--ig-text-faint) !important; }
html.theme-instagram .placeholder\:text-zinc-400::placeholder { color: var(--ig-text-faint) !important; }

/* ── Borders / rings / dividers ── */
html.theme-instagram .border-zinc-100 { border-color: var(--ig-border-soft) !important; }
html.theme-instagram .divide-zinc-100 > :not([hidden]) ~ :not([hidden]) { border-color: var(--ig-border-soft) !important; }
html.theme-instagram .border-zinc-200 { border-color: var(--ig-border) !important; }
html.theme-instagram .border-zinc-300 { border-color: var(--ig-border-strong) !important; }
html.theme-instagram .border-zinc-400 { border-color: var(--ig-accent) !important; }
html.theme-instagram .border-zinc-900 { border-color: var(--ig-accent-solid) !important; }
html.theme-instagram .ring-zinc-100 { --tw-ring-color: rgba(0, 149, 246, 0.12) !important; }
html.theme-instagram .ring-zinc-500\/10,
html.theme-instagram .ring-zinc-900\/10 { --tw-ring-color: rgba(0, 149, 246, 0.2) !important; }

/* ── Hover / focus ── */
html.theme-instagram .hover\:bg-zinc-50:hover,
html.theme-instagram .hover\:bg-zinc-100:hover,
html.theme-instagram .hover\:bg-zinc-200:hover,
html.theme-instagram .hover\:bg-zinc-50\/40:hover,
html.theme-instagram .hover\:bg-zinc-50\/50:hover,
html.theme-instagram .hover\:bg-zinc-50\/60:hover { background-color: var(--ig-hover-tint) !important; }
html.theme-instagram .hover\:bg-zinc-200\/60:hover { background-color: var(--ig-hover-tint-strong) !important; }
html.theme-instagram .has-\[\:checked\]\:bg-zinc-50:has(:checked),
html.theme-instagram .has-\[\:checked\]\:bg-zinc-100:has(:checked) { background-color: var(--ig-hover-tint) !important; }
html.theme-instagram .capa-nc-group:hover td { background-color: var(--ig-hover-tint-strong) !important; }
html.theme-instagram .capa-nc-group:hover td:first-child,
html.theme-instagram tbody:not(.capa-nc-group) tr:not([class*="hover:bg"]):hover td:first-child {
    box-shadow: inset 3px 0 0 0 var(--ig-accent) !important;
}
html.theme-instagram tbody:not(.capa-nc-group) tr:not([class*="hover:bg"]):hover { background-color: var(--ig-hover-tint-strong) !important; }
html.theme-instagram .hover\:bg-zinc-700:hover,
html.theme-instagram .hover\:bg-zinc-800:hover { background-color: var(--ig-accent-hover) !important; }
html.theme-instagram .hover\:text-zinc-600:hover { color: var(--ig-text-body) !important; }
html.theme-instagram .hover\:text-zinc-700:hover,
html.theme-instagram .hover\:text-zinc-800:hover,
html.theme-instagram .hover\:text-zinc-900:hover { color: var(--ig-text-heading) !important; }
html.theme-instagram .hover\:border-zinc-400:hover { border-color: var(--ig-accent) !important; }
html.theme-instagram .hover\:border-zinc-900:hover { border-color: var(--ig-accent-solid) !important; }
html.theme-instagram .focus\:border-zinc-400:focus { border-color: var(--ig-accent) !important; }
html.theme-instagram .focus\:ring-zinc-100:focus { --tw-ring-color: rgba(0, 149, 246, 0.15) !important; }
html.theme-instagram .focus\:ring-zinc-900:focus { --tw-ring-color: rgba(0, 149, 246, 0.25) !important; }

/* ── Form controls ── */
html.theme-instagram input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html.theme-instagram select,
html.theme-instagram textarea {
    background-color: var(--ig-surface) !important;
    color: var(--ig-text-heading) !important;
    border-color: var(--ig-border) !important;
}
html.theme-instagram input::placeholder,
html.theme-instagram textarea::placeholder { color: var(--ig-text-faint) !important; }
html.theme-instagram input[type="checkbox"],
html.theme-instagram input[type="radio"] { accent-color: var(--ig-accent-solid); }
html.theme-instagram.dark input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }
html.theme-instagram input[type="date"],
html.theme-instagram input[type="time"],
html.theme-instagram input[type="datetime-local"],
html.theme-instagram input[type="month"],
html.theme-instagram input[type="week"] { color-scheme: inherit; }

/* ── Scrollbar ── */
html.theme-instagram ::-webkit-scrollbar-track { background: transparent; }
html.theme-instagram ::-webkit-scrollbar-thumb { background: var(--ig-border-strong); border-radius: 999px; }
html.theme-instagram ::-webkit-scrollbar-thumb:hover { background: var(--ig-accent); }

/* Status/badge colors — dark variant only (light reads fine unchanged, same rationale as
   theme-facebook.css). */
html.theme-instagram.dark .bg-amber-50, html.theme-instagram.dark .bg-amber-100 { background-color: rgba(245, 158, 11, 0.14) !important; }
html.theme-instagram.dark .text-amber-600, html.theme-instagram.dark .text-amber-700, html.theme-instagram.dark .text-amber-800 { color: #fbbf24 !important; }
html.theme-instagram.dark .bg-blue-50, html.theme-instagram.dark .bg-blue-100 { background-color: rgba(77, 181, 255, 0.16) !important; }
html.theme-instagram.dark .text-blue-600, html.theme-instagram.dark .text-blue-700, html.theme-instagram.dark .text-blue-800 { color: #7cc6ff !important; }
html.theme-instagram.dark .bg-emerald-50, html.theme-instagram.dark .bg-emerald-100 { background-color: rgba(16, 185, 129, 0.14) !important; }
html.theme-instagram.dark .text-emerald-600, html.theme-instagram.dark .text-emerald-700, html.theme-instagram.dark .text-emerald-800 { color: #34d399 !important; }
html.theme-instagram.dark .bg-red-50, html.theme-instagram.dark .bg-red-100 { background-color: rgba(239, 68, 68, 0.14) !important; }
html.theme-instagram.dark .text-red-600, html.theme-instagram.dark .text-red-700 { color: #f87171 !important; }
html.theme-instagram.dark .bg-violet-50 { background-color: rgba(139, 92, 246, 0.14) !important; }
html.theme-instagram.dark .text-violet-600, html.theme-instagram.dark .text-violet-700 { color: #a78bfa !important; }
html.theme-instagram.dark .bg-sky-50 { background-color: rgba(77, 181, 255, 0.14) !important; }
html.theme-instagram.dark .text-sky-600 { color: #7cc6ff !important; }
html.theme-instagram.dark .bg-teal-50 { background-color: rgba(20, 184, 166, 0.14) !important; }
html.theme-instagram.dark .text-teal-600, html.theme-instagram.dark .text-teal-700 { color: #2dd4bf !important; }
html.theme-instagram.dark .bg-rose-50 { background-color: rgba(244, 63, 94, 0.14) !important; }
html.theme-instagram.dark .text-rose-600 { color: #fb7185 !important; }
html.theme-instagram.dark .bg-orange-50 { background-color: rgba(249, 115, 22, 0.14) !important; }
html.theme-instagram.dark .text-orange-600, html.theme-instagram.dark .text-orange-700 { color: #fb923c !important; }
html.theme-instagram.dark .bg-indigo-50 { background-color: rgba(99, 102, 241, 0.14) !important; }
html.theme-instagram.dark .text-indigo-600 { color: #818cf8 !important; }
