/* Buttertranslate theme variables for aioha modal (adapted from 3speak dark mode, gold accent) */
:root {
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --bg-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f1f1;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  --text-inverse: #000000;
  --border-color: #3d3d3d;
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.5);
  --accent-primary: #e5a00d;
  --accent-hover: #c48a0a;
  --input-bg: #2d2d2d;
  --input-border: #3d3d3d;
  --input-focus: rgba(229, 160, 13, 0.3);
}
#aioha-modal {
  padding: 1rem;
  font-family: "Roboto", "Arial", sans-serif;
}

/* Modal backdrop/overlay - semi-transparent */
/* The #aioha-modal element ITSELF is the backdrop */
#aioha-modal.bg-black,
#aioha-modal.bg-opacity-30,
#aioha-modal[class*="bg-black"] {
  background-color: rgba(0, 0, 0, 0.6) !important;
  --tw-bg-opacity: 0.6 !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Close button - ALL patterns */
/* Target by size (h-8 w-8, w-8 h-8) */
#aioha-modal button.text-gray-400.h-8.w-8,
#aioha-modal button.text-gray-400.w-8.h-8,
#aioha-modal button[class*="text-gray-400"][class*="h-8"][class*="w-8"],
/* Target by position (ms-auto = right-aligned in flex) */
#aioha-modal button.ms-auto,
#aioha-modal button[class*="ms-auto"],
/* Target inline-flex icon buttons */
#aioha-modal button.inline-flex.justify-center.items-center,
/* Target any small square button */
#aioha-modal button[class*="h-8"][class*="w-8"],
#aioha-modal button[class*="w-8"][class*="h-8"] {
  color: var(--text-primary) !important;
  background-color: var(--bg-hover) !important;
  border-radius: 0.5rem;
}

#aioha-modal button.text-gray-400.h-8.w-8:hover,
#aioha-modal button.text-gray-400.w-8.h-8:hover,
#aioha-modal button.ms-auto:hover,
#aioha-modal button[class*="ms-auto"]:hover,
#aioha-modal button[class*="h-8"][class*="w-8"]:hover {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

/* Close button SVG icon - target ALL SVGs in these buttons */
#aioha-modal button.text-gray-400 svg,
#aioha-modal button.ms-auto svg,
#aioha-modal button[class*="ms-auto"] svg,
#aioha-modal button[class*="h-8"][class*="w-8"] svg,
#aioha-modal button.inline-flex.justify-center.items-center svg,
/* Target w-3 h-3 SVGs specifically (the actual size used) */
#aioha-modal button svg.w-3.h-3,
#aioha-modal button svg[class*="w-3"][class*="h-3"] {
  width: 0.75rem !important;
  height: 0.75rem !important;
  color: var(--text-primary) !important;
}

/* SVG paths in close buttons - these use STROKE not fill */
#aioha-modal button.text-gray-400 svg path,
#aioha-modal button.ms-auto svg path,
#aioha-modal button[class*="ms-auto"] svg path,
#aioha-modal button[class*="h-8"][class*="w-8"] svg path,
#aioha-modal button.inline-flex svg path,
#aioha-modal button svg.w-3 path,
#aioha-modal button svg[class*="w-3"] path {
  stroke: var(--text-primary) !important;
  stroke-width: 2 !important;
}

/* Force color inheritance on close button SVGs */
#aioha-modal button.text-gray-400 svg[fill="none"],
#aioha-modal button svg[fill="none"] {
  color: var(--text-primary) !important;
}

#aioha-modal button.text-gray-400 svg[fill="none"] path[stroke="currentColor"],
#aioha-modal button svg[fill="none"] path[stroke="currentColor"] {
  stroke: var(--text-primary) !important;
}

/* sr-only text inside buttons should stay hidden */
#aioha-modal button .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Modal container */
#aioha-modal > div > div {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1.5rem;
  min-height: 300px;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
}

/* Exact Flowbite modal panel */
#aioha-modal .bg-white,
#aioha-modal .dark\:bg-gray-700,
#aioha-modal div[class*="bg-white"][class*="rounded-lg"] {
  background-color: var(--bg-secondary) !important;
}

/* Modal header with border */
#aioha-modal .border-b,
#aioha-modal .dark\:border-gray-600 {
  border-color: var(--border-color) !important;
}

/* Headings */
#aioha-modal h2,
#aioha-modal h3,
#aioha-modal .text-lg {
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Text */
#aioha-modal p,
#aioha-modal span,
#aioha-modal .text-sm {
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

#aioha-modal .font-semibold {
  font-weight: 600;
  color: var(--text-primary);
}

/* Primary buttons (login/action buttons) */
#aioha-modal button {
  font-family: "Roboto", "Arial", sans-serif;
  padding: 0.625rem 1.25rem;
  margin: 0.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

#aioha-modal button[class*="bg-blue"],
#aioha-modal button[class*="bg-primary"],
#aioha-modal button:not([class*="bg-gray"]):not([class*="bg-red"]):not([class*="text-gray"]):not([class*="absolute"]):not([class*="close"]) {
  background-color: var(--accent-primary);
  color: var(--text-inverse);
  border: none;
}

#aioha-modal button[class*="bg-blue"]:hover,
#aioha-modal button[class*="bg-primary"]:hover,
#aioha-modal button:not([class*="bg-gray"]):not([class*="bg-red"]):not([class*="text-gray"]):not([class*="absolute"]):not([class*="close"]):hover {
  background-color: var(--accent-hover);
}

/* Secondary/cancel buttons */
#aioha-modal button[class*="bg-gray"],
#aioha-modal button[class*="text-gray"] {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

#aioha-modal button[class*="bg-gray"]:hover,
#aioha-modal button[class*="text-gray"]:hover {
  background-color: var(--bg-hover);
}

/* Input fields */
#aioha-modal input {
  font-family: "Roboto", "Arial", sans-serif;
  padding: 0.625rem 0.75rem;
  margin: 0.5rem 0;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0.5rem;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#aioha-modal input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--input-focus);
}

#aioha-modal input::placeholder {
  color: var(--text-muted);
}

/* Spacing utilities */
#aioha-modal .p-4 { padding: 1rem; }
#aioha-modal .p-5 { padding: 1.25rem; }
#aioha-modal .px-4 { padding-left: 1rem; padding-right: 1rem; }
#aioha-modal .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
#aioha-modal .py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
#aioha-modal .mb-4 { margin-bottom: 1rem; }
#aioha-modal .mb-5 { margin-bottom: 1.25rem; }
#aioha-modal .mt-2 { margin-top: 0.5rem; }
#aioha-modal .mt-4 { margin-top: 1rem; }
#aioha-modal .gap-2 { gap: 0.5rem; }
#aioha-modal .gap-4 { gap: 1rem; }
#aioha-modal .space-y-4 > * + * { margin-top: 1rem; }

/* Switch user modal / user list */
#aioha-modal .min-w-sm {
  min-width: 20rem;
}

/* Override all blue/gray Tailwind backgrounds in modal */
#aioha-modal [class*="bg-blue"],
#aioha-modal [class*="bg-gray"],
#aioha-modal [class*="bg-slate"],
#aioha-modal [class*="bg-zinc"],
#aioha-modal [class*="bg-neutral"],
#aioha-modal .bg-white,
#aioha-modal [class*="dark:bg-"] {
  background-color: var(--bg-secondary) !important;
}

/* Override blue/gray text colors */
#aioha-modal [class*="text-blue"],
#aioha-modal [class*="text-gray"],
#aioha-modal [class*="text-slate"] {
  color: var(--text-secondary) !important;
}

/* Ensure modal panels/cards use correct background */
#aioha-modal [class*="rounded"][class*="shadow"],
#aioha-modal [class*="panel"],
#aioha-modal [class*="card"],
#aioha-modal [class*="dialog"] {
  background-color: var(--bg-secondary) !important;
}

/* Table and user list styling */
#aioha-modal table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-secondary);
}

#aioha-modal thead {
  background-color: var(--bg-tertiary);
}

#aioha-modal tr {
  padding: 0.75rem 0;
  background-color: var(--bg-secondary);
}

#aioha-modal td,
#aioha-modal th {
  padding: 0.75rem 0.5rem;
  background-color: transparent;
}

#aioha-modal tbody tr {
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

#aioha-modal tbody tr:hover {
  background-color: var(--bg-hover) !important;
}

/* Override hover states with blue colors */
#aioha-modal [class*="hover:bg-blue"]:hover,
#aioha-modal [class*="hover:bg-gray"]:hover,
#aioha-modal .hover\:bg-gray-50:hover,
#aioha-modal .hover\:bg-gray-100:hover {
  background-color: var(--bg-hover) !important;
}

#aioha-modal .rounded-lg {
  border-radius: 0.5rem;
  padding: 1.5rem;
  background-color: var(--bg-secondary);
}

/* User list items */
#aioha-modal .flex.items-center {
  padding: 0.75rem 0.5rem;
}

#aioha-modal .cursor-pointer {
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

#aioha-modal .cursor-pointer:hover,
#aioha-modal .hover\:bg-gray-100:hover {
  background-color: var(--bg-hover);
}

/* Avatar */
#aioha-modal img.rounded-full {
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 0.75rem;
  border-radius: 50%;
}

/* Provider buttons (Keychain, HiveAuth, etc.) */
#aioha-modal [class*="provider"],
#aioha-modal button img {
  border-radius: 0.5rem;
}

/* Provider button containers - add spacing and borders */
#aioha-modal [class*="grid"],
#aioha-modal [class*="flex"][class*="gap"],
#aioha-modal .space-y-2,
#aioha-modal .space-y-3,
#aioha-modal .space-y-4 {
  gap: 0.75rem;
}

/* Style provider/login method buttons with borders */
#aioha-modal button[class*="flex"][class*="items-center"],
#aioha-modal button:has(img),
#aioha-modal [class*="provider"] button,
#aioha-modal button[class*="w-full"] {
  border: 1px solid var(--border-color) !important;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem !important;
  margin: 0.375rem 0 !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  transition: all 0.2s ease;
}

#aioha-modal button[class*="flex"][class*="items-center"]:hover,
#aioha-modal button:has(img):hover,
#aioha-modal [class*="provider"] button:hover,
#aioha-modal button[class*="w-full"]:hover {
  background-color: var(--bg-hover) !important;
  border-color: var(--accent-primary) !important;
}

/* Links */
#aioha-modal a {
  color: var(--accent-primary);
  transition: color 0.2s ease;
}

#aioha-modal a:hover {
  color: var(--accent-hover);
}

/* Close button - positioned absolutely in top-right */
#aioha-modal button.absolute,
#aioha-modal button[class*="close"],
#aioha-modal button[aria-label="Close"],
#aioha-modal .absolute.top-2.right-2,
#aioha-modal .absolute.top-4.right-4,
#aioha-modal button[class*="top-"][class*="right-"],
#aioha-modal div[class*="relative"] > button:first-of-type {
  color: var(--text-primary) !important;
  background: transparent !important;
  padding: 0.5rem !important;
  border-radius: 0.375rem;
  min-width: auto;
}

#aioha-modal button.absolute:hover,
#aioha-modal button[class*="close"]:hover,
#aioha-modal button[aria-label="Close"]:hover,
#aioha-modal button[class*="top-"][class*="right-"]:hover {
  color: var(--text-primary) !important;
  background: var(--bg-hover) !important;
}

/* Ensure SVG icons in close button are visible */
#aioha-modal button.absolute svg,
#aioha-modal button[class*="close"] svg,
#aioha-modal button[aria-label="Close"] svg,
#aioha-modal button[class*="top-"][class*="right-"] svg,
#aioha-modal div[class*="relative"] > button:first-of-type svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke: currentColor !important;
  fill: none;
  color: var(--text-primary) !important;
}

/* Fallback: style all small icon-only buttons as close buttons */
#aioha-modal button:not([class*="bg-"]):has(svg:only-child) {
  color: var(--text-primary) !important;
  background: transparent !important;
}

/* NUCLEAR: Force ALL SVGs in modal to be visible */
#aioha-modal svg {
  color: var(--text-primary) !important;
}

/* Apply stroke ONLY to SVGs that are NOT QR codes (QR codes have w-full h-full classes) */
#aioha-modal svg:not(.w-full):not(.h-full) path {
  stroke: var(--text-primary) !important;
}

/* ===== AGGRESSIVE CLOSE BUTTON FIX ===== */
/* The close button uses text-gray-400 which sets currentColor for SVG stroke */
/* Override text-gray-400 color directly on buttons in the modal */
#aioha-modal button.text-gray-400 {
  color: var(--text-primary) !important;
}

/* Target the exact button pattern from aioha modal */
#aioha-modal button.text-gray-400.bg-transparent.h-8.w-8,
#aioha-modal button.text-gray-400.bg-transparent.rounded-lg.text-sm.h-8.w-8,
#aioha-modal button.text-gray-400.bg-transparent.rounded-lg.text-sm.h-8.w-8.ms-auto.inline-flex.justify-center.items-center {
  color: var(--text-primary) !important;
  background-color: var(--bg-hover) !important;
}

/* Target SVGs with w-3 h-3 classes inside buttons */
#aioha-modal button svg.w-3.h-3,
#aioha-modal button.text-gray-400 svg.w-3.h-3,
#aioha-modal button.text-gray-400 svg[class="w-3 h-3"] {
  color: var(--text-primary) !important;
}

/* Target path elements with stroke="currentColor" directly */
#aioha-modal button svg path[stroke="currentColor"],
#aioha-modal button.text-gray-400 svg path[stroke="currentColor"],
#aioha-modal svg[fill="none"] path[stroke="currentColor"] {
  stroke: var(--text-primary) !important;
}

/* Last resort: Override Tailwind gray colors entirely within #aioha-modal */
#aioha-modal .text-gray-400,
#aioha-modal .dark\:hover\:text-white {
  color: var(--text-primary) !important;
}

/* Ensure close button SVG has proper size and visibility */
#aioha-modal button.text-gray-400 svg,
#aioha-modal button.ms-auto svg,
#aioha-modal button.h-8.w-8 svg,
#aioha-modal button.inline-flex svg {
  width: 12px !important;
  height: 12px !important;
  min-width: 12px !important;
  min-height: 12px !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Target X/close icons specifically (common SVG patterns) */
#aioha-modal svg[class*="x"],
#aioha-modal svg[class*="close"],
#aioha-modal svg[class*="X"],
#aioha-modal button > svg:only-child {
  width: 1.25rem !important;
  height: 1.25rem !important;
  color: var(--text-primary) !important;
}

#aioha-modal button > svg:only-child path,
#aioha-modal button > svg:only-child line {
  stroke: var(--text-primary) !important;
  stroke-width: 2;
}

/* Heroicons X mark pattern */
#aioha-modal svg[viewBox="0 0 24 24"] path[d*="M6"],
#aioha-modal svg path[stroke-linecap="round"] {
  stroke: var(--text-primary) !important;
}

#aioha-modal button:not([class*="bg-"]):has(svg:only-child) svg {
  stroke: var(--text-primary) !important;
}

/* ===== PROVIDER LIST STYLING ===== */
/* Provider list container - add more spacing */
#aioha-modal ul.space-y-3,
#aioha-modal ul[class*="space-y"] {
  margin-top: 1.5rem !important;
  margin-bottom: 1rem !important;
}

#aioha-modal ul.space-y-3 > li,
#aioha-modal ul[class*="space-y"] > li {
  margin-bottom: 0.75rem !important;
}

/* Provider list items - the clickable links */
#aioha-modal ul li a.flex.items-center,
#aioha-modal ul.space-y-3 li a,
#aioha-modal li a[class*="flex"][class*="items-center"][class*="p-3"] {
  border: 1px solid var(--border-color) !important;
  border-radius: 0.5rem !important;
  padding: 1rem !important;
  margin: 0.5rem 0 !important;
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center !important;
}

#aioha-modal ul li a.flex.items-center:hover,
#aioha-modal ul.space-y-3 li a:hover,
#aioha-modal li a[class*="flex"][class*="items-center"][class*="p-3"]:hover {
  background-color: var(--bg-hover) !important;
  border-color: var(--accent-primary) !important;
}

/* Provider icons - basic styling */
#aioha-modal ul li a svg,
#aioha-modal ul.space-y-3 li a svg {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  margin-right: 0.75rem !important;
  flex-shrink: 0;
  display: block !important;
  align-self: center !important;
}

/* Provider icon images inside SVGs */
#aioha-modal ul li a svg image,
#aioha-modal ul.space-y-3 li a svg image {
  width: 100% !important;
  height: 100% !important;
}

/* Force correct icon visibility based on theme (override Tailwind's dark: classes) */
/* Light mode: hide dark icons (have dark:block), show light icons (have dark:hidden) */
:root:not([data-theme="dark"]) #aioha-modal .dark\:block,
:root:not([data-theme="dark"]) #aioha-modal [class*="dark:block"] {
  display: none !important;
}
:root:not([data-theme="dark"]) #aioha-modal .dark\:hidden,
:root:not([data-theme="dark"]) #aioha-modal [class*="dark:hidden"] {
  display: block !important;
}

/* Dark mode: show dark icons, hide light icons */
[data-theme="dark"] #aioha-modal .dark\:block,
[data-theme="dark"] #aioha-modal [class*="dark:block"] {
  display: block !important;
}
[data-theme="dark"] #aioha-modal .dark\:hidden,
[data-theme="dark"] #aioha-modal [class*="dark:hidden"] {
  display: none !important;
}

/* Provider name text */
#aioha-modal ul li a span.flex-1,
#aioha-modal ul.space-y-3 li a span[class*="flex-1"] {
  color: var(--text-primary) !important;
  font-weight: 600;
  margin-left: 0.5rem !important;
}

/* Popular/badge labels */
#aioha-modal ul li a span[class*="bg-gray-200"],
#aioha-modal ul li a span[class*="text-gray-500"] {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
}

/* ===== QR CODE PROTECTION ===== */
/* QR codes in aioha use w-full h-full classes - protect them from stroke rules */
/* The QR SVG has two paths: one with fill="#FFFFFF" (background) and one with fill="#000000" (pattern) */
#aioha-modal svg.w-full.h-full,
#aioha-modal svg.w-full,
#aioha-modal svg.h-full {
  /* Don't override QR code colors */
  color: inherit !important;
}

#aioha-modal svg.w-full path,
#aioha-modal svg.h-full path,
#aioha-modal svg.w-full.h-full path {
  /* Preserve the inline fill colors and remove any stroke */
  stroke: none !important;
  stroke-width: 0 !important;
}

/* Also protect QR codes with shape-rendering attribute (qrcode.react library) */
#aioha-modal svg[shape-rendering] path,
#aioha-modal svg[shapeRendering] path {
  stroke: none !important;
  stroke-width: 0 !important;
}






/* button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}
button:hover {
  border-color: #646cff;
}
button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
} */

/* Chevron to hide a comment — right-aligned in header */
.comment-collapse-chevron {
  margin-left: auto;
  display: flex;
  align-items: center;
  color: var(--text-muted, #888);
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-tertiary, rgba(255,255,255,0.08));
  transition: color 0.15s ease, background 0.15s ease;
}
.comment-collapse-chevron:hover {
  color: var(--text-secondary, #aaa);
  background: var(--bg-hover, rgba(255,255,255,0.14));
}

/* Collapsed comment bar — slim row with avatar + name, click to expand */
.comment-collapsed-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted, #888);
  background: var(--bg-tertiary, rgba(255,255,255,0.04));
  border-radius: 6px;
  cursor: pointer;
  margin: 2px 0;
  transition: background 0.15s ease;
}
.comment-collapsed-bar:hover {
  background: var(--bg-hover, rgba(255,255,255,0.08));
}
.comment-collapsed-bar .author-badge {
  flex-shrink: 0;
}
.comment-collapsed-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-collapsed-name {
  font-size: 12px;
  color: var(--text-secondary, #aaa);
  white-space: nowrap;
}
.comment-collapsed-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted, #888);
  transform: rotate(180deg);
}


