/*
 * multi.css — DaisyUI plugin config + project utilities for the WHMCS multi template.
 *
 * Tailwind v4 + DaisyUI v5 (browser CDN, no build step).
 * - Theme set is intentionally restricted to two themes (light + dark) to keep generated CSS small.
 * - corporate is the default light theme; business is auto-applied when prefers-color-scheme: dark.
 * - All other DaisyUI themes are disabled.
 */

@plugin "daisyui" {
  themes: corporate --default, business --prefersdark;
}

/* Base layer overrides — keep tight on a billing portal. */
@layer base {
  html { scroll-behavior: smooth; }

  /* Smooth font rendering on Mac/iOS */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  }

  /* Improve focus visibility for keyboard nav */
  :focus-visible {
    outline: 2px solid hsl(var(--p));
    outline-offset: 2px;
    border-radius: 4px;
  }

  /* Prevent legacy WHMCS bootstrap.css from leaking in (we don't load it, but be defensive) */
  .navbar-fixed-top { position: static; }
}

/* Component layer — small project-specific patterns */
@layer components {
  /* Status badge color helpers for WHMCS rawstatus values */
  .badge-status-active { @apply badge-success; }
  .badge-status-pending { @apply badge-warning; }
  .badge-status-suspended { @apply badge-error; }
  .badge-status-terminated { @apply badge-neutral; }
  .badge-status-cancelled { @apply badge-neutral; }
  .badge-status-fraud { @apply badge-error; }
  .badge-status-completed { @apply badge-info; }

  /* Invoice status */
  .badge-invoice-paid { @apply badge-success; }
  .badge-invoice-unpaid { @apply badge-warning; }
  .badge-invoice-overdue { @apply badge-error; }
  .badge-invoice-cancelled { @apply badge-neutral; }
  .badge-invoice-refunded { @apply badge-info; }
  .badge-invoice-collections { @apply badge-error; }

  /* Ticket status */
  .badge-ticket-open { @apply badge-info; }
  .badge-ticket-answered { @apply badge-warning; }
  .badge-ticket-customer-reply { @apply badge-warning; }
  .badge-ticket-closed { @apply badge-neutral; }
  .badge-ticket-in-progress { @apply badge-info; }

  /* Make card headers consistent across pages */
  .multi-card-header {
    @apply px-5 py-3 border-b border-base-300 flex items-center justify-between gap-3;
  }

  /* Empty-state hero (used inside {foreachelse} blocks) */
  .multi-empty {
    @apply rounded-box border border-dashed border-base-300 bg-base-100 px-6 py-12 text-center;
  }

  /* Compact form helper */
  .multi-field-row {
    @apply grid grid-cols-1 sm:grid-cols-3 gap-3 items-start py-3 border-b border-base-200 last:border-0;
  }
  .multi-field-label {
    @apply text-sm font-medium opacity-80 sm:pt-2;
  }
  .multi-field-input {
    @apply sm:col-span-2;
  }
}

/* Print stylesheet — used by viewinvoice.tpl. Hide nav/topbar/footer when printing. */
@media print {
  .drawer-side, header.navbar, footer { display: none !important; }
  .drawer-content { padding: 0 !important; }
  main { padding: 0 !important; max-width: 100% !important; }
  body { background: white !important; color: black !important; }
  .no-print, .multi-no-print { display: none !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .card, .rounded-box, .alert {
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    background: white !important;
  }
}
