/* ANC-branded overrides for NocoDB nc-gui.
 *
 * Hides upsell elements that the official EE-built image renders even on
 * self-hosted instances (FREE PLAN badge, +Enterprise pills, "Create Workspace
 * — Enterprise" button). Applies ANC dark mode + brand color. Loaded as a
 * <link rel="stylesheet"> injected into every HTML file by the overlay
 * Dockerfile.
 */

/* ---------- Hide upsell / paywall UI ---------------------------------- */

/* Workspace topbar plan badge — "FREE PLAN" pill next to workspace title */
[data-testid="nc-ws-home-topbar-title"] + div[class*="rounded-full"] {
  display: none !important;
}

/* +Enterprise pill on the New Workspace button (bottom-left of workspaces list) */
[class*="enterprise"][class*="tag"],
[class*="Enterprise"][class*="tag"] {
  display: none !important;
}

/* Upgrade buttons / banners scattered across settings + sidebars */
[data-testid*="upgrade"],
[data-testid*="upsell"],
[class*="paymentUpgrade"],
[class*="upgrade-banner"],
[class*="ee-only-tag"],
.nc-upgrade-banner {
  display: none !important;
}

/* PaymentUpgradeBadge component renders a green/blue tag everywhere a feature
 * is gated. Source: components/payment/upgrade/Badge.vue. The component wraps
 * children in a payment-related class. Hide all instances. */
[class*="payment-upgrade"],
[class*="upgrade-badge"],
.payment-upgrade-badge,
.nc-payment-upgrade-badge,
.nc-upgrade-tag,
[data-testid*="payment-upgrade"],
[data-testid*="upgrade-tag"] {
  display: none !important;
}

/* Hide the entire +New Workspace button — single-workspace ANC ops doesn't
 * need multi-workspace creation, and that button hosts the +Enterprise pill. */
[data-testid="nc-create-workspace-btn"],
[data-testid="nc-new-workspace-btn"],
.nc-new-workspace-btn,
.nc-create-workspace-btn {
  display: none !important;
}

/* Last-resort: any green/blue rounded tag inside the workspaces sidebar that
 * sits next to a "New Workspace" button is the +Enterprise pill. Target the
 * common ant-design tag class inside the workspaces section. */
.nc-workspaces-sidebar .ant-tag,
[class*="workspace-sidebar"] .ant-tag,
[class*="WorkspaceList"] .ant-tag {
  display: none !important;
}

/* "+" icons next to Teams and Audits tab labels (premium-feature indicator) */
.nc-tab-title [class*="payment"],
.nc-tab-title .ant-tag,
[class*="ws-tab-title"] [class*="payment"],
[class*="ws-tab-title"] .ant-tag {
  display: none !important;
}

/* Hide "Sign up for free" button (cloud-mode artifact in bottom-right) */
a[href*="nocodb.com/signup"],
a[href*="nocodb.com/cloud"] {
  display: none !important;
}

/* ---------- ANC brand color overrides --------------------------------- */
/* Override NocoDB's primary blue with ANC blue (#0A52EF). NocoDB uses
 * Tailwind/Windi utility classes baked into the bundle — overrides target
 * the resolved CSS custom properties + a few high-traffic class names. */

:root {
  --nc-content-brand: #0A52EF !important;
  --nc-fill-primary: #0A52EF !important;
  --nc-border-brand: #0A52EF !important;
  --nc-bg-brand: rgba(10, 82, 239, 0.08) !important;
}

/* ---------- Dark-mode niceties ---------------------------------------- */
/* Match anc-services dark mode page background when dark theme is on */
html[data-theme="dark"], .dark {
  --nc-bg-page: #0b1220;
  --nc-bg-surface: #111827;
  --nc-bg-sidebar: #07101f;
}
