/* HonmeiDate — Custom Styles
   Supplements DaisyUI night theme with brand-specific overrides.
   All new CSS appended here. Never modify existing rules. */

/* ═══════════════════════════════════════════════
   Brand Color Tokens
   ═══════════════════════════════════════════════ */
:root {
  --hd-bg-deep: #0f1729;
  --hd-bg-card: #1d283a;
  --hd-bg-hover: #243044;
  --hd-border: #2a3548;
  --hd-border-light: #354460;
  --hd-text-heading: #d4dae3;
  --hd-text-body: #a6adbb;
  --hd-text-muted: #8a95a5;
  --hd-text-faint: #586a80;
  --hd-primary: #6d9eff;
  --hd-pink: #f471b5;
  --hd-purple: #a78bfa;
  --hd-green: #36d399;
  --hd-red: #e24b4a;
}

/* ═══════════════════════════════════════════════
   Self-Message Highlight (Chat)
   Blue-tinted background with left border accent
   ═══════════════════════════════════════════════ */
.hd-self-message {
  background: rgba(109, 158, 255, 0.08);
  border-left: 3px solid var(--hd-primary);
  margin-left: -1rem;
  padding-left: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* ═══════════════════════════════════════════════
   Gender Ring Colors
   Applied via ring-{color} utilities, but these
   provide explicit fallback for custom contexts
   ═══════════════════════════════════════════════ */
.hd-ring-male { --tw-ring-color: #60a5fa; }
.hd-ring-female { --tw-ring-color: #f472b6; }
.hd-ring-nonbinary { --tw-ring-color: #a78bfa; }
.hd-ring-hidden { --tw-ring-color: #6b7280; }

/* ═══════════════════════════════════════════════
   Scrollbar Styling
   ═══════════════════════════════════════════════ */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Thin scrollbar for chat and lists */
.overflow-y-auto::-webkit-scrollbar {
  width: 4px;
}
.overflow-y-auto::-webkit-scrollbar-track {
  background: transparent;
}
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: var(--hd-border);
  border-radius: 2px;
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: var(--hd-border-light);
}

/* ═══════════════════════════════════════════════
   Mobile Bottom Dock Spacing
   Dock visible below 1024px (lg:hidden).
   Default dock-sm = 3.5rem, shrinks on short viewports.
   ═══════════════════════════════════════════════ */
@media (max-width: 1023px) {
  body {
    padding-bottom: 3.75rem;
  }
}

/* Short viewport: shrink dock to xs (3rem / 48px)
   Covers landscape phones, small embedded views, etc. */
@media (max-height: 500px) {
  .hd-dock {
    height: 2.75rem !important;
    padding: 0.25rem 0;
  }
  .hd-dock .dock-label {
    display: none;
  }
  .hd-dock a {
    gap: 0;
  }
  body {
    padding-bottom: 3rem;
  }
}

/* Very short viewport (<400px height): hide dock labels,
   minimize to icon-only bar */
@media (max-height: 360px) {
  .hd-dock {
    height: 2.25rem !important;
    padding: 0.125rem 0;
  }
  body {
    padding-bottom: 2.5rem;
  }
}

/* ═══════════════════════════════════════════════
   Card Hover Enhancement
   ═══════════════════════════════════════════════ */
.card {
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover {
  border-color: var(--hd-border-light);
}

/* ═══════════════════════════════════════════════
   Gradient Backgrounds for Profile Placeholders
   These pair with Tailwind's gradient utilities
   ═══════════════════════════════════════════════ */
.hd-gradient-1 { background: linear-gradient(135deg, #ef4444, #ec4899); }
.hd-gradient-2 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.hd-gradient-3 { background: linear-gradient(135deg, #22c55e, #3b82f6); }
.hd-gradient-4 { background: linear-gradient(135deg, #f97316, #ef4444); }
.hd-gradient-5 { background: linear-gradient(135deg, #a855f7, #6366f1); }
.hd-gradient-6 { background: linear-gradient(135deg, #14b8a6, #10b981); }

/* ═══════════════════════════════════════════════
   Animation
   ═══════════════════════════════════════════════ */
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.animate-pulse-soft {
  animation: pulse-soft 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════
   Photo Thumbnail States
   TODO: Implement black default, gray hover, white active.
   Deferred — CSS layer specificity conflict with
   Tailwind/DaisyUI needs resolution.
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════
   Pill-style Hidden Input
   Used on announcement form + anywhere a styled label
   wraps a native radio/checkbox. Tailwind's `sr-only`
   gets overridden by DaisyUI's form reset, so we use a
   standard visually-hidden pattern with !important to
   beat the override. Do NOT add pointer-events:none —
   it breaks label-to-input click propagation in some
   browsers and prevents the peer-checked state from
   updating when the user clicks the styled span.
   ═══════════════════════════════════════════════ */
.hd-pill-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ═══════════════════════════════════════════════
   Discover Distance Slider
   Overrides DaisyUI range component CSS variables
   for a thin track with a white thumb.
   ═══════════════════════════════════════════════ */
.discover-slider {
  --range-thumb: #ffffff !important;
  --range-thumb-size: 1rem !important;
  --range-p: 0.125rem !important;
  --range-fill: 0 !important;
  height: 1rem !important;
}

/* ═══════════════════════════════════════════════
   Theme Switching — Twilight + Light
   ═══════════════════════════════════════════════
   The app's surface colors are baked into Tailwind arbitrary-value
   classes (e.g. `bg-[#0f1729]`). Swapping DaisyUI's data-theme alone
   doesn't recolor those. The rules below remap the core palette when
   the user picks Twilight or Light from Settings → Language & Appearances.
   Dark Mode (data-theme="night") keeps the original palette untouched. */

/* ─── Twilight: softer mid-dark surfaces ─────────── */
[data-theme="dim"] body { background-color: #1c2538; }
[data-theme="dim"] .bg-\[\#0b1628\] { background-color: #1a2236 !important; }
[data-theme="dim"] .bg-\[\#0f1729\] { background-color: #1c2538 !important; }
[data-theme="dim"] .bg-\[\#162033\] { background-color: #263048 !important; }
[data-theme="dim"] .bg-\[\#1d283a\] { background-color: #2a3650 !important; }
[data-theme="dim"] .bg-\[\#243044\] { background-color: #334063 !important; }
[data-theme="dim"] .bg-\[\#2a3548\] { background-color: #384564 !important; }
[data-theme="dim"] .bg-\[\#2a3a52\] { background-color: #374668 !important; }
[data-theme="dim"] .border-\[\#2a3548\] { border-color: #3a4869 !important; }
[data-theme="dim"] .border-\[\#354460\] { border-color: #4a5877 !important; }
[data-theme="dim"] .border-\[\#3d4860\] { border-color: #586689 !important; }
[data-theme="dim"] .border-\[\#586a80\] { border-color: #7181a0 !important; }
[data-theme="dim"] .divide-\[\#2a3548\] > :not([hidden]) ~ :not([hidden]) { border-color: #3a4869 !important; }

/* ─── Light: inverted palette ──────────────────── */
[data-theme="light"] body { background-color: #f7f8fa; color: #1f2937; }
[data-theme="light"] .bg-\[\#0b1628\] { background-color: #eef1f6 !important; }
[data-theme="light"] .bg-\[\#0f1729\] { background-color: #f7f8fa !important; }
[data-theme="light"] .bg-\[\#162033\] { background-color: #eef1f6 !important; }
[data-theme="light"] .bg-\[\#1d283a\] { background-color: #ffffff !important; }
[data-theme="light"] .bg-\[\#243044\] { background-color: #f2f4f7 !important; }
[data-theme="light"] .bg-\[\#2a3548\] { background-color: #e1e5eb !important; }
[data-theme="light"] .bg-\[\#2a3a52\] { background-color: #e8ecf2 !important; }
[data-theme="light"] .border-\[\#2a3548\] { border-color: #e1e5eb !important; }
[data-theme="light"] .border-\[\#354460\] { border-color: #cbd2dc !important; }
[data-theme="light"] .border-\[\#3d4860\] { border-color: #9aa3af !important; }
[data-theme="light"] .border-\[\#586a80\] { border-color: #6b7280 !important; }
[data-theme="light"] .divide-\[\#2a3548\] > :not([hidden]) ~ :not([hidden]) { border-color: #e1e5eb !important; }

/* Light-mode text palette — dim greys become dark greys so copy stays legible.
   text-white flips to near-black inside regular surfaces; accent buttons that
   need white on blue keep it because the !important only applies where
   text-white is used for primary copy on neutral panels — CTA buttons that
   want white-on-color should use text-white with an inline color override if
   they break, which they rarely do in this codebase. */
[data-theme="light"] .text-white { color: #0f1729 !important; }
[data-theme="light"] .text-\[\#d4dae3\] { color: #1f2937 !important; }
[data-theme="light"] .text-\[\#a6adbb\] { color: #374151 !important; }
[data-theme="light"] .text-\[\#8a95a5\] { color: #4b5563 !important; }
[data-theme="light"] .text-\[\#586a80\] { color: #6b7280 !important; }
[data-theme="light"] .text-\[\#3d4860\] { color: #9aa3af !important; }
[data-theme="light"] .text-\[\#354460\] { color: #9aa3af !important; }

/* Keep white text on strong-accent solid-color buttons/badges where the
   contrast flip would be unreadable (e.g. white-on-blue CTA). */
[data-theme="light"] .bg-\[\#6d9eff\].text-white,
[data-theme="light"] .bg-\[\#f0b450\].text-white,
[data-theme="light"] .bg-\[\#36d399\].text-white,
[data-theme="light"] .bg-\[\#e24b4a\].text-white,
[data-theme="light"] .bg-\[\#a78bfa\].text-white,
[data-theme="light"] .bg-\[\#f471b5\].text-white { color: #ffffff !important; }

/* ═══════════════════════════════════════════════
   Admin link-filter quick-add context menu
   Shipped as inline-styled (vs. Tailwind-utility) so the
   admin_link_filter.js module is fully self-contained — drop the JS
   + this block to remove the feature.
   ═══════════════════════════════════════════════ */
.hd-admin-link-menu {
  position: fixed;
  left: -9999px;
  top: -9999px;
  z-index: 9999;
  min-width: 220px;
  padding: 6px;
  background: #1d283a;
  border: 1px solid #354460;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #d4dae3;
}
.hd-admin-link-menu.is-open { display: flex; }
.hd-admin-link-menu__header {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #586a80;
  padding: 4px 8px 6px;
  border-bottom: 1px solid #2a3548;
  margin-bottom: 4px;
  word-break: break-all;
}
.hd-admin-link-menu button,
.hd-admin-link-menu a {
  text-align: left;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.hd-admin-link-menu button:hover,
.hd-admin-link-menu a:hover { background: #243044; }
.hd-admin-link-menu [data-action="whitelist"]:hover { color: #36d399; }
.hd-admin-link-menu [data-action="blacklist"]:hover { color: #e24b4a; }

.hd-admin-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
  padding: 10px 14px;
  background: #1d283a;
  border: 1px solid #354460;
  border-left-width: 3px;
  border-radius: 6px;
  font-size: 12px;
  color: #d4dae3;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
}
.hd-admin-toast.is-shown { opacity: 1; transform: translateY(0); }
.hd-admin-toast--success { border-left-color: #36d399; }
.hd-admin-toast--warn    { border-left-color: #f0b450; }
.hd-admin-toast--error   { border-left-color: #e24b4a; }
.hd-admin-toast--info    { border-left-color: #6d9eff; }
