/* ═══════════════════════════════════════════════
   ToolPile Theme Override for PDFCraft
   Injects toolpile brand onto toolpile.dev/pdf/
   ═══════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&family=DM+Sans:opsz,wght@9..40,300..700&display=swap');

/* ── Font Override ── */
:root {
  --font-sans: "DM Sans", "Space Grotesk", system-ui, -apple-system, sans-serif;
  --default-font-family: "DM Sans", "Space Grotesk", system-ui, -apple-system, sans-serif;
}

/* Headings use Space Grotesk */
h1, h2, h3, h4, h5, h6 {
  font-family: "Space Grotesk", "DM Sans", system-ui, sans-serif !important;
  letter-spacing: -0.025em;
}

/* ── ToolPile Warm-White Design Tokens ── */
:root {
  --color-background: 45 30% 98%;
  --color-card: 0 0% 100%;
  --color-muted: 40 20% 95%;
  --color-border: 35 12% 89%;
  --color-primary: 239 84% 60%;
  --color-primary-hover: 239 84% 50%;
  --color-primary-foreground: 0 0% 100%;
  --color-accent: 40 96% 50%;
  --color-ring: 239 84% 60%;
  --color-secondary: 35 20% 92%;
  --color-secondary-hover: 35 20% 84%;
  --color-secondary-foreground: 45 15% 12%;
  --color-foreground: 45 15% 8%;
  --color-muted-foreground: 45 5% 40%;
  --color-card-foreground: 45 15% 8%;
  --color-input: 35 12% 92%;
  --tw-ring-color: hsl(239, 84%, 60%);
}

/* ── Page Background ── */
html, body {
  background-color: #fdfaf5 !important;
}

/* ── Header ── */
header, nav[class*="sticky"], [class*="sticky top-0"] {
  background: rgba(253, 250, 245, 0.88) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(35, 12%, 89%) !important;
}

/* ── Cards ── */
[class*="rounded-2xl"], [class*="rounded-xl"], [class*="rounded-lg"] {
  border-color: hsl(35, 12%, 89%) !important;
}

/* ── Primary Buttons ── */
.bg-primary, [class*="bg-primary"], button[class*="bg-blue-600"],
a[class*="bg-blue-600"] {
  background-color: hsl(239, 84%, 60%) !important;
  border-color: hsl(239, 84%, 60%) !important;
  color: white !important;
}
.bg-primary:hover, [class*="bg-primary"]:hover, button[class*="bg-blue-600"]:hover {
  background-color: hsl(239, 84%, 50%) !important;
}

/* ── Links ── */
a:not(header a):not(nav a):not(footer a):not([class*="text-white"]):not([class*="bg-"]) {
  color: hsl(239, 84%, 60%) !important;
}

/* ── Focus ring ── */
*:focus-visible {
  --tw-ring-color: hsl(239, 84%, 60%) !important;
  outline-color: hsl(239, 84%, 60%) !important;
}

/* ═══════════════════════════════════════════════
   Hide PDFCraft-specific elements
   ═══════════════════════════════════════════════ */

/* Hide nav items: Workflow, About, FAQ (empty text after our fix) */
header nav a:not([href="/"]):not([href="/pdf-tools/"]):empty,
header nav a[href*="workflow"],
header nav a[href*="about"],
header nav a[href*="faq"] {
  display: none !important;
}

/* Hide language switcher in footer */
footer button,
footer [class*="language"],
footer [class*="locale"] {
  display: none !important;
}

/* Hide breadcrumb "Organize & Manage" or broken category */
nav[aria-label="Breadcrumb"] a[href*="category"],
nav[aria-label="breadcrumb"] a[href*="category"],
a[href*="organize-manage"],
a[href*="Optimize"] {
  display: none !important;
}

/* Hide "Powered by PDFCraft" if it still exists */
footer p:has(a[href*="PDFCraft"]),
footer p:has(a[href*="pdfcraft"]) {
  display: none !important;
}

/* Hide broken related tool links */
a[href*="organize-pdf"],
a[href*="alternate-merge"],
a[href*="Optimize & Repair"] {
  display: none !important;
}

/* Hide search dialog trigger */
button[aria-label="Open search"],
button[aria-label*="search"] {
  display: none !important;
}

/* Hide Recent Files button */
button[aria-label="Recent Files"],
button[aria-label*="Recent"] {
  display: none !important;
}

/* Hide Security and Compliance empty sections */
footer h3:empty,
footer [class*="security"]:empty,
footer [class*="compliance"]:empty {
  display: none !important;
}

/* ── Dark Mode ── */
.dark,
[data-theme="dark"],
[class*="dark"] {
  --color-background: 240 10% 8%;
  --color-card: 240 8% 12%;
  --color-muted: 240 8% 15%;
  --color-border: 240 8% 22%;
  --color-foreground: 45 20% 90%;
  --color-muted-foreground: 45 10% 55%;
  --color-card-foreground: 45 20% 90%;
  --color-primary: 239 70% 65%;
  --color-primary-hover: 239 70% 55%;
  --color-accent: 40 90% 50%;
  --color-input: 240 8% 18%;
  --color-secondary: 240 8% 18%;
  --color-secondary-hover: 240 8% 24%;
}

.dark html, .dark body,
[data-theme="dark"] html, [data-theme="dark"] body {
  background-color: hsl(240, 10%, 8%) !important;
}

.dark header, .dark nav[class*="sticky"],
[data-theme="dark"] header, [data-theme="dark"] nav[class*="sticky"] {
  background: rgba(18, 18, 24, 0.88) !important;
  border-bottom: 1px solid hsl(240, 8%, 22%) !important;
}
