@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  .app-page,
  .public-shell {
    @apply bg-base-100 text-base-content;
  }

  .app-page {
    @apply mx-auto w-full max-w-7xl px-4 sm:px-5;
  }

  .public-page {
    @apply mx-auto w-full max-w-4xl px-4 sm:px-5;
  }

  .app-panel,
  .public-panel {
    @apply rounded-box border border-base-300 bg-base-100 shadow-sm;
  }

  .app-card,
  .public-card {
    @apply rounded-box border border-base-300 bg-base-100 p-5 shadow-sm;
  }

  .app-subpanel {
    @apply rounded-box bg-base-200/40 p-4;
  }

  .app-empty-state {
    @apply rounded-box border border-base-300 bg-base-100 px-6 py-8 text-center text-base-content/60 shadow-sm;
  }

  .app-fieldset {
    @apply rounded-box border border-base-300 p-4 space-y-3;
  }

  .public-shell {
    background:
      radial-gradient(circle at top left, hsl(var(--p) / 0.12), transparent 30%),
      radial-gradient(circle at top right, hsl(var(--s) / 0.08), transparent 22%),
      linear-gradient(180deg, hsl(var(--b2)) 0%, hsl(var(--b1)) 10rem, hsl(var(--b1)) 100%);
  }

  .public-eyebrow {
    @apply text-[0.65rem] font-semibold uppercase tracking-[0.22em] text-primary;
  }

  .public-title {
    @apply text-2xl font-semibold tracking-tight text-base-content sm:text-3xl;
  }

  .public-subtitle {
    @apply max-w-3xl text-sm leading-6 text-base-content/70;
  }

  .public-meta-chip {
    @apply inline-flex items-center gap-2 text-[0.72rem] font-medium uppercase tracking-[0.18em] text-base-content/50;
  }

  .public-meta-chip::before {
    content: "";
    @apply inline-block h-1.5 w-1.5 rounded-full bg-primary/70;
  }

  .public-nav-link {
    @apply inline-flex h-9 items-center border-b-2 border-transparent text-xs uppercase tracking-[0.18em] text-base-content/60 transition hover:text-base-content;
  }

  .public-nav-link-active {
    @apply border-primary font-semibold text-primary;
  }

  .public-list {
    @apply divide-y divide-base-300;
  }

  .public-list-row {
    @apply grid gap-2 px-4 py-3 transition hover:bg-base-200/30 sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start;
  }

  .public-prose {
    @apply prose prose-base max-w-none;
  }

  .public-prose :where(h1, h2, h3, h4, strong, code) {
    color: hsl(var(--bc));
  }

  .public-prose :where(p, li, blockquote) {
    color: hsl(var(--bc) / 0.82);
  }

  .public-prose :where(a) {
    color: hsl(var(--p));
    text-decoration: none;
  }

  .public-prose :where(a:hover) {
    text-decoration: underline;
  }

  .public-prose :where(blockquote) {
    @apply rounded-box bg-base-200;
    border-color: hsl(var(--p) / 0.3);
    border-left-width: 4px;
  }

  .public-prose :where(pre) {
    @apply rounded-box bg-neutral text-neutral-content;
  }

  .public-prose :where(img) {
    @apply rounded-box;
  }
}
/* Ideabug widget styles — vars apply to both the bell (which lives inside
   the host's target element) and the floating panel (under .ideabug-root). */
/* Default theme tokens. Wrapped in :where() so they have ZERO specificity
   and the host page can override them with any normal selector regardless
   of stylesheet load order. */
:where(.ideabug-root, .ideabug-bell, .ideabug-pulse-dot) {
  --ib-accent: #4f46e5;
  --ib-bg: #ffffff;
  --ib-fg: #1f2937;
  --ib-muted: #6b7280;
  --ib-border: #e5e7eb;
  --ib-hover: #f3f4f6;
  --ib-unread: #eef2ff;       /* light tint — backgrounds for unread rows */
  --ib-notification: var(--ib-accent); /* vivid dot color on the bell */
  --ib-danger: #dc2626;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.ideabug-root {
  font-size: 14px;
  line-height: 1.4;
  color: var(--ib-fg);
}

.ideabug-root *,
.ideabug-root *::before,
.ideabug-root *::after,
.ideabug-bell *,
.ideabug-bell *::before,
.ideabug-bell *::after {
  box-sizing: border-box;
}

.ideabug-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 999px;
  color: var(--ib-fg);
  background: transparent;
  border: 0;
}
.ideabug-bell:hover {
  background: var(--ib-hover);
}
.ideabug-bell svg {
  width: 22px;
  height: 22px;
}
.ideabug-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ib-notification);
  border: 2px solid var(--ib-bg);
}
/* Pulsing ring around the dot when there are unread updates. The ring is a
   pseudo-element so the dot itself stays solid and crisp. */
.ideabug-bell-badge:not(.is-hidden):not(.is-count)::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ib-notification);
  animation: ideabug-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes ideabug-pulse {
  0%   { transform: scale(1);   opacity: 0; }
  15%  { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(3);   opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ideabug-bell-badge:not(.is-hidden):not(.is-count)::after { animation: none; }
}

/* Reusable pulsing-dot indicator for custom triggers. Drop a
   <span class="ideabug-pulse-dot"></span> inside your trigger element; it
   will appear and pulse when the trigger has the ideabug-has-unread class
   that the widget toggles on every poll. */
.ideabug-pulse-dot {
  display: none;
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ib-notification);
  vertical-align: middle;
}
.ideabug-has-unread .ideabug-pulse-dot { display: inline-block; }
.ideabug-has-unread .ideabug-pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--ib-notification);
  animation: ideabug-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
.ideabug-opted-out .ideabug-pulse-dot { display: none; }
[data-ideabug-unread-count][hidden],
[data-ideabug-unread-count][aria-hidden="true"] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .ideabug-has-unread .ideabug-pulse-dot::after { animation: none; }
}
.ideabug-bell-badge.is-count {
  width: auto;
  height: auto;
  min-width: 18px;
  padding: 1px 5px;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  color: #fff;
  background: var(--ib-notification);
  text-align: center;
  border-radius: 999px;
  border: 0;
}
.ideabug-bell-badge.is-hidden { display: none; }

.ideabug-panel {
  position: fixed;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 24px);
  background: var(--ib-bg);
  color: var(--ib-fg);
  border: 1px solid var(--ib-border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
}
.ideabug-panel.is-open { display: flex; }

.ideabug-tabs {
  display: flex;
  border-bottom: 1px solid var(--ib-border);
  background: var(--ib-bg);
}
.ideabug-tab {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--ib-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.ideabug-tab:hover { color: var(--ib-fg); }
.ideabug-tab.is-active {
  color: var(--ib-accent);
  border-bottom-color: var(--ib-accent);
  font-weight: 600;
}

.ideabug-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.ideabug-footer {
  border-top: 1px solid var(--ib-border);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ib-bg);
}

.ideabug-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--ib-accent);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}
.ideabug-link:hover { text-decoration: underline; }

.ideabug-btn {
  background: var(--ib-accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
}
.ideabug-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.ideabug-btn-ghost {
  background: transparent;
  color: var(--ib-fg);
  border: 1px solid var(--ib-border);
}

.ideabug-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ib-muted);
  padding: 12px 16px 4px;
}

.ideabug-item {
  padding: 10px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.ideabug-item:hover { background: var(--ib-hover); }
.ideabug-item.is-unread {
  background: var(--ib-unread);
  border-left-color: var(--ib-accent);
}
.ideabug-item-title {
  font-weight: 600;
  margin-bottom: 2px;
}
.ideabug-item-meta {
  font-size: 12px;
  color: var(--ib-muted);
  margin-bottom: 4px;
}
.ideabug-item-preview {
  font-size: 13px;
  color: var(--ib-muted);
}
.ideabug-item-content {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.ideabug-item-content :first-child { margin-top: 0; }

/* === Announcement modal (lightbox-style) ============================== */
.ideabug-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000000;
  animation: ideabug-fade-in 0.15s ease-out;
}
.ideabug-modal-overlay.is-open { display: flex; }
@keyframes ideabug-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ideabug-modal {
  position: relative;
  background: var(--ib-bg);
  color: var(--ib-fg);
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ideabug-pop-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ideabug-pop-in {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.ideabug-modal-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--ib-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.ideabug-modal-title-block { min-width: 0; }
.ideabug-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}
.ideabug-modal-meta {
  font-size: 12px;
  color: var(--ib-muted);
}
.ideabug-modal-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ib-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.ideabug-modal-close:hover { background: var(--ib-hover); color: var(--ib-fg); }

.ideabug-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.6;
}
/* Prose styling for ActionText / arbitrary HTML content. Scoped tightly so
   we don't leak generic h1/p rules into the host page. */
.ideabug-modal-body :first-child { margin-top: 0; }
.ideabug-modal-body :last-child { margin-bottom: 0; }
.ideabug-modal-body h1,
.ideabug-modal-body h2,
.ideabug-modal-body h3 { font-weight: 600; line-height: 1.3; margin: 1.2em 0 0.5em; }
.ideabug-modal-body h1 { font-size: 22px; }
.ideabug-modal-body h2 { font-size: 18px; }
.ideabug-modal-body h3 { font-size: 16px; }
.ideabug-modal-body p,
.ideabug-modal-body ul,
.ideabug-modal-body ol,
.ideabug-modal-body blockquote { margin: 0 0 1em; }
.ideabug-modal-body ul,
.ideabug-modal-body ol { padding-left: 1.5em; }
.ideabug-modal-body li { margin: 0.25em 0; }
.ideabug-modal-body a { color: var(--ib-accent); text-decoration: underline; }
.ideabug-modal-body img,
.ideabug-modal-body video,
.ideabug-modal-body figure { max-width: 100%; height: auto; border-radius: 6px; margin: 0.75em 0; }
.ideabug-modal-body figure { margin: 1em 0; }
.ideabug-modal-body figcaption { font-size: 12px; color: var(--ib-muted); margin-top: 0.25em; }
.ideabug-modal-body blockquote {
  border-left: 3px solid var(--ib-border);
  padding-left: 1em;
  color: var(--ib-muted);
}
.ideabug-modal-body pre {
  background: var(--ib-hover);
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
}
.ideabug-modal-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--ib-hover);
  padding: 1px 4px;
  border-radius: 3px;
}
.ideabug-modal-body pre code { background: transparent; padding: 0; }
/* ActionText attachments */
.ideabug-modal-body action-text-attachment { display: block; margin: 0.75em 0; }
.ideabug-modal-body action-text-attachment img { display: block; }
.ideabug-modal-body .attachment { display: block; }
.ideabug-modal-body .attachment--preview img { max-width: 100%; height: auto; border-radius: 6px; }
.ideabug-modal-body .attachment__caption {
  font-size: 12px;
  color: var(--ib-muted);
  margin-top: 0.25em;
}

.ideabug-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--ib-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.ideabug-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ib-bg);
  border: 1px solid var(--ib-border);
  color: var(--ib-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
  z-index: 1;
  font-size: 18px;
  line-height: 1;
}
.ideabug-modal-nav:hover { background: var(--ib-hover); }
.ideabug-modal-nav[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.ideabug-modal-nav-prev { left: -52px; }
.ideabug-modal-nav-next { right: -52px; }
/* When the viewport is too narrow to fit the floating nav buttons outside
   the modal, dock them inside at the bottom corners. */
@media (max-width: 820px) {
  .ideabug-modal-nav-prev,
  .ideabug-modal-nav-next {
    top: auto;
    bottom: 12px;
    transform: none;
  }
  .ideabug-modal-nav-prev { left: 12px; }
  .ideabug-modal-nav-next { right: 12px; }
}

.ideabug-banner {
  margin: 8px 12px;
  padding: 10px 12px;
  background: var(--ib-unread);
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ideabug-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--ib-muted);
  font-size: 13px;
}

/* Loading spinner used while a tab fetches data on first activation. */
.ideabug-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}
.ideabug-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--ib-border);
  border-top-color: var(--ib-accent);
  animation: ideabug-spin 0.8s linear infinite;
}
@keyframes ideabug-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ideabug-spinner { animation-duration: 1.6s; }
}

/* Suggest tab */
.ideabug-suggest-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
}
.ideabug-suggest-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  font: inherit;
  color: var(--ib-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.ideabug-suggest-tab:hover { color: var(--ib-fg); }
.ideabug-suggest-tab.is-active {
  color: var(--ib-accent);
  border-bottom-color: var(--ib-accent);
  font-weight: 600;
}
.ideabug-status-new        { background: var(--ib-hover); color: var(--ib-fg); }
.ideabug-status-in_progress{ background: var(--ib-unread); color: var(--ib-accent); }
.ideabug-status-completed  { background: rgba(34, 197, 94, 0.15); color: rgb(21, 128, 61); }
.ideabug-form {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ideabug-segmented {
  display: inline-flex;
  border: 1px solid var(--ib-border);
  border-radius: 8px;
  overflow: hidden;
}
.ideabug-segmented button {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--ib-muted);
}
.ideabug-segmented button.is-active {
  background: var(--ib-accent);
  color: #fff;
}
.ideabug-input,
.ideabug-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ib-border);
  border-radius: 8px;
  font: inherit;
  color: inherit;
  background: var(--ib-bg);
}
.ideabug-textarea { min-height: 96px; resize: vertical; }
.ideabug-success {
  text-align: center;
  padding: 24px;
}

/* Roadmap */
.ideabug-vote {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--ib-border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--ib-muted);
}
.ideabug-vote:hover { background: var(--ib-hover); }
.ideabug-vote.is-voted {
  background: var(--ib-unread);
  border-color: var(--ib-accent);
  color: var(--ib-accent);
}
.ideabug-vote svg { width: 14px; height: 14px; }
.ideabug-roadmap-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
}
.ideabug-roadmap-card-meta { font-size: 12px; color: var(--ib-muted); margin-top: 2px; }
.ideabug-chip {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ib-hover);
  color: var(--ib-muted);
  margin-right: 4px;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
