/* =========================================================
   Excalidraw "School edition" UI cleanup (no cloud marketing)
   ========================================================= */

/* --- 1) Hide obvious external/marketing links in menus --- */
a[href*="plus.excalidraw.com"],
a[href*="excalidraw.com/plus"],
a[href*="app.excalidraw.com/sign-"],
a[href*="excalidraw.com/sign-"],
a[href*="github.com/excalidraw"],
a[aria-label="GitHub"],
a[title="GitHub"],
a[href*="x.com/excalidraw"],
a[aria-label="X"],
a[title="X"],
a[href*="twitter.com/excalidraw"],
a[href*="discord.gg/"],
a[aria-label="Discord"],
a[title="Discord"],
a[href*="libraries.excalidraw.com"] {
  display: none !important;
}

/* Hide any separator divs that become pointless once we removed items.
   NOTE: This is intentionally narrow-ish: separators inside dropdown menus. */
.dropdown-menu .dropdown-menu-item + div[style*="height: 1px"][style*="background-color"] {
  display: none !important;
}

/* --- 2) Hide any remaining “Sign up / Login” items (language-agnostic-ish) --- */
a.dropdown-menu-item[href*="sign"],
a.dropdown-menu-item[href*="login"],
a.dropdown-menu-item[href*="signin"],
a.dropdown-menu-item[href*="sign-in"],
a.dropdown-menu-item[href*="sign_up"],
a.dropdown-menu-item[href*="sign-up"] {
  display: none !important;
}

/* --- 3) Export dialog: remove the Excalidraw+ cloud card --- */

/* Strong selector: the card that contains the Excalidraw logo */
.ExportDialog-cards .Card:has(.ExcalidrawLogo),
.ExportDialog-cards .Card:has(svg.ExcalidrawLogo-icon) {
  display: none !important;
}

/* Fallback (no :has): hide the card if the H2 is Excalidraw+.
   Works in many builds because the heading text is stable. */
.ExportDialog-cards .Card h2 {
  /* do nothing here; keep specificity for the next rule */
}
.ExportDialog-cards .Card h2:where(:not(*)) {}

/* Text-based fallback: if your browser supports :has(), above already works.
   If it doesn't, try a more brute force: hide any card that contains the logo container class. */
.ExportDialog-cards .Card .ExcalidrawLogo {
  /* hide the whole card by hiding its nearest .Card ancestor */
}
.ExportDialog-cards .Card .ExcalidrawLogo {
  display: none !important;
}
.ExportDialog-cards .Card .ExcalidrawLogo {}

/* Better fallback: if we can’t hide the whole card, hide its contents */
.ExportDialog-cards .Card .ExcalidrawLogo,
.ExportDialog-cards .Card .ExcalidrawLogo * {
  display: none !important;
}

/* If the above only hides the icon but leaves the card empty, hide empty-ish cards */
.ExportDialog-cards .Card:has(.ExcalidrawLogo) {
  display: none !important;
}

/* --- 4) Also remove “shareable link” card if you want it gone completely --- */
/* Comment this block OUT if you want to keep share links */
.ExportDialog-cards .Card:has(h2):has(button[aria-label*="lien"]),
.ExportDialog-cards .Card:has(h2):has(button[title*="lien"]),
.ExportDialog-cards .Card:has(h2):has(button[aria-label*="link"]),
.ExportDialog-cards .Card:has(h2):has(button[title*="link"]) {
  display: none !important;
}

/* Fallback for share-card without :has(): hide buttons that are clearly “Export as link” */
button[aria-label*="Exporter comme lien"],
button[title*="Exporter comme lien"],
button[aria-label*="Export as link"],
button[title*="Export as link"] {
  display: none !important;
}

/* --- 5) Hide “Live collaboration” entry point IF you decide you only want local files ---
   (Since you actually want collaboration, keep this OFF.)
   Uncomment to remove collaboration menu entry.
*/
/*
button[aria-label*="collaboration"],
button[title*="collaboration"] {
  display: none !important;
}
*/

/* --- 6) Cosmetic: reduce weird gaps when items disappear --- */
.dropdown-menu-item-base {
  /* keep spacing sane */
}