/* ==============================================================================
   WATZAP — design system
   Premium, crisp, professional. Layered on top of daisyUI (loaded first) so
   this file wins for component polish. Tailwind utilities handle layout.

   NOTE: daisyUI 4 theme variables (--p, --b1, --bc, ...) are OKLCH channel
   triplets, NOT colors. Always wrap them: oklch(var(--b1)). Using them raw
   invalidates the declaration and the background falls back to transparent.
   ============================================================================== */

/* --- Custom brand theme (daisyUI 4 OKLCH channel triplets) ------------------ */
[data-theme="watzap"] {
  color-scheme: light;

  /* Brand + accents */
  --p: 53% 0.225 272;        /* indigo/violet primary */
  --pc: 98% 0.012 275;
  --pf: 46% 0.22 275;        /* primary focus/hover */
  --s: 66% 0.12 190;         /* teal */
  --sc: 20% 0.03 220;
  --a: 80% 0.15 78;          /* amber */
  --ac: 30% 0.06 78;

  /* Neutrals / surfaces */
  --n: 22% 0.03 265;
  --nc: 96% 0.01 265;
  --b1: 100% 0 0;
  --b2: 98.6% 0.0035 265;
  --b3: 95.5% 0.006 265;
  --bc: 25% 0.028 265;

  /* Status */
  --in: 72% 0.15 232;
  --su: 63% 0.17 155;
  --wa: 82% 0.16 80;
  --er: 62% 0.22 25;

  /* Shape */
  --rounded-box: 1.1rem;
  --rounded-btn: 0.7rem;
  --rounded-badge: 9999px;
  --border-btn: 1px;
  --animation-btn: 0.18s;
  --animation-input: 0.18s;
  --btn-focus-scale: 0.98;
  --tab-radius: 0.6rem;

  color-scheme: light;
}

/* ---------------------------------------------------------------------------
   Base / typography
--------------------------------------------------------------------------- */
:root {
  --wz-ring: 0 0 0 3px color-mix(in oklch, oklch(var(--p)) 30%, transparent);
  --wz-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --wz-shadow-md: 0 4px 12px -2px rgba(16, 24, 40, 0.1), 0 2px 6px -2px rgba(16, 24, 40, 0.06);
  --wz-shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.18);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  letter-spacing: -0.011em;
  -webkit-user-select: text;
  user-select: text;
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in oklch, oklch(var(--p)) 8%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, color-mix(in oklch, oklch(var(--s)) 7%, transparent), transparent 55%),
    var(--fallback-b2, oklch(var(--b2)));
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
}

::selection {
  background: oklch(var(--p));
  color: oklch(var(--pc));
}
::-moz-selection {
  background: oklch(var(--p));
  color: oklch(var(--pc));
}

/* Reply-delay groups: hidden until the mode select picks them (see app.js). */
[data-delay-group] {
  display: none;
}

/* Refined focus ring everywhere */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid color-mix(in oklch, oklch(var(--p)) 70%, transparent);
  outline-offset: 2px;
  border-radius: 0.4rem;
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, oklch(var(--bc)) 25%, transparent) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in oklch, oklch(var(--bc)) 22%, transparent);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* ---------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
.btn {
  font-weight: 600;
  letter-spacing: -0.006em;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background-color 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background-image: linear-gradient(
    180deg,
    color-mix(in oklch, oklch(var(--p)) 92%, white) 0%,
    oklch(var(--p)) 100%
  );
  border-color: color-mix(in oklch, oklch(var(--p)) 82%, black);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.14), 0 10px 20px -8px color-mix(in oklch, oklch(var(--p)) 55%, transparent);
}
.btn-primary:hover {
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.16), 0 16px 30px -10px color-mix(in oklch, oklch(var(--p)) 62%, transparent);
}
.btn-outline { border-width: 1.5px; }
.btn-ghost { font-weight: 550; }
.btn-neutral {
  background-image: linear-gradient(180deg, color-mix(in oklch, oklch(var(--n)) 90%, white), oklch(var(--n)));
}

/* ---------------------------------------------------------------------------
   Cards & surfaces
--------------------------------------------------------------------------- */
.card {
  box-shadow: var(--wz-shadow-md);
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 10%, transparent);
}
.card.bg-base-100 { background: oklch(var(--b1)); }

.wz-surface {
  background: color-mix(in oklch, oklch(var(--b1)) 92%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 10%, transparent);
  border-radius: var(--rounded-box);
}

.wz-panel {
  background: oklch(var(--b1));
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 10%, transparent);
  border-radius: var(--rounded-box);
  box-shadow: var(--wz-shadow-sm);
}

/* ---------------------------------------------------------------------------
   Forms
--------------------------------------------------------------------------- */
.input, .select, .textarea {
  background-color: oklch(var(--b1));
  border-color: color-mix(in oklch, oklch(var(--bc)) 18%, transparent);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
.input:focus, .select:focus, .textarea:focus,
.input:focus-within, .select:focus-within, .textarea:focus-within {
  outline: none;
  border-color: color-mix(in oklch, oklch(var(--p)) 65%, transparent);
  box-shadow: var(--wz-ring);
}
.label-text { font-weight: 550; }

/* ---------------------------------------------------------------------------
   Badges, stats, tables
--------------------------------------------------------------------------- */
.badge { font-weight: 600; letter-spacing: 0.01em; }
.badge.badge-sm { height: 1.35rem; }

.stat {
  background: oklch(var(--b1));
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 10%, transparent);
  border-radius: var(--rounded-box);
  box-shadow: var(--wz-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--wz-shadow-md);
  border-color: color-mix(in oklch, oklch(var(--p)) 30%, transparent);
}

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: color-mix(in oklch, oklch(var(--bc)) 60%, transparent);
}

/* ---------------------------------------------------------------------------
   Header / nav
--------------------------------------------------------------------------- */
.wz-header {
  background: color-mix(in oklch, oklch(var(--b1)) 78%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid color-mix(in oklch, oklch(var(--bc)) 10%, transparent);
}
.wz-navlink {
  position: relative;
  font-weight: 550;
  color: color-mix(in oklch, oklch(var(--bc)) 78%, transparent);
  padding: 0.45rem 0.75rem;
  border-radius: 0.6rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.wz-navlink:hover {
  color: oklch(var(--bc));
  background: color-mix(in oklch, oklch(var(--bc)) 7%, transparent);
}
.wz-navlink[aria-current="page"] {
  color: color-mix(in oklch, oklch(var(--p)) 90%, black);
  background: color-mix(in oklch, oklch(var(--p)) 11%, transparent);
}
.wz-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.7rem;
  background-image: linear-gradient(140deg, #22c55e 0%, #4f46e5 90%);
  color: white;
  box-shadow: 0 6px 16px -6px color-mix(in oklch, oklch(var(--p)) 70%, transparent);
}

/* ---------------------------------------------------------------------------
   Marketing hero
--------------------------------------------------------------------------- */
.wz-hero-grid {
  background-image:
    linear-gradient(to right, color-mix(in oklch, oklch(var(--bc)) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklch, oklch(var(--bc)) 6%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(720px 420px at 50% 0%, black 30%, transparent 78%);
}
/* Soft drifting aurora glows behind the hero. */
.wz-hero-glow {
  background:
    radial-gradient(560px 300px at 16% 6%, color-mix(in oklch, oklch(var(--p)) 18%, transparent), transparent 70%),
    radial-gradient(640px 340px at 84% 10%, color-mix(in oklch, oklch(var(--s)) 16%, transparent), transparent 70%),
    radial-gradient(420px 260px at 50% -4%, color-mix(in oklch, oklch(var(--su)) 8%, transparent), transparent 70%);
  animation: wzGlowDrift 14s ease-in-out infinite alternate;
}
@keyframes wzGlowDrift {
  from { opacity: 0.7; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 1; transform: translate3d(0, 14px, 0) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .wz-hero-glow { animation: none; }
}
.wz-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: color-mix(in oklch, oklch(var(--p)) 80%, black);
  background: color-mix(in oklch, oklch(var(--p)) 10%, transparent);
  border: 1px solid color-mix(in oklch, oklch(var(--p)) 22%, transparent);
}
.text-gradient {
  /* Fixed brand colors: theme variables can resolve to near-invisible hues
     depending on the active theme, so the headline stays readable. */
  background-image: linear-gradient(100deg, #4f46e5 0%, #6366f1 45%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not (-webkit-background-clip: text) {
  .text-gradient { color: #4f46e5; background-image: none; }
}

/* --- Floating WhatsApp balloon (Test live / Tech support) ------------------ */
.wz-wa-wrap {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}
.wz-wa-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 9999px;
  background: #25d366;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45);
  animation: wz-wa-float 3.2s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wz-wa-fab svg { width: 2rem; height: 2rem; }
.wz-wa-fab:hover { transform: scale(1.08); box-shadow: 0 12px 28px rgba(37, 211, 102, 0.6); }
.wz-wa-fab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid #25d366;
  animation: wz-wa-pulse 2.2s ease-out infinite;
}
.wz-wa-fab span[title],
.wz-wa-fab .wz-wa-fab-tip {
  position: absolute;
  right: 4rem;
  white-space: nowrap;
  background: oklch(var(--b1));
  color: oklch(var(--bc));
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 12%, transparent);
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  box-shadow: var(--wz-shadow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.wz-wa-fab:hover .wz-wa-fab-tip { opacity: 1; }
.wz-wa-menu {
  background: oklch(var(--b1));
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 12%, transparent);
  border-radius: 1rem;
  box-shadow: var(--wz-shadow-sm);
  padding: 0.4rem;
  width: 17rem;
  animation: wzWaPop 0.18s ease both;
}
.wz-wa-menu a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  color: oklch(var(--bc));
}
.wz-wa-menu a:hover { background: color-mix(in oklch, oklch(var(--bc)) 7%, transparent); }
.wz-wa-menu strong { font-size: 0.875rem; }
.wz-wa-menu small { font-size: 0.72rem; opacity: 0.7; }
@keyframes wzWaPop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wz-wa-menu { animation: none; }
}
@keyframes wz-wa-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes wz-wa-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wz-wa-fab, .wz-wa-fab::before { animation: none; }
}

/* --- "Test WATZAP Live on WhatsApp" banner CTA ---------------------------- */
.wz-wa-live {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 1.4rem 0.6rem 0.6rem;
  border-radius: 9999px;
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
  text-align: left;
  animation: wz-wa-float 3.2s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wz-wa-live:hover { transform: scale(1.04); color: #fff; box-shadow: 0 14px 30px rgba(37, 211, 102, 0.6); }
.wz-wa-live-icon {
  position: relative;
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}
.wz-wa-live-icon svg { width: 1.5rem; height: 1.5rem; }
.wz-wa-live-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid #fff;
  animation: wz-wa-pulse 2.2s ease-out infinite;
}
.wz-wa-live-text { display: flex; flex-direction: column; line-height: 1.25; }
.wz-wa-live-text strong { font-size: 0.95rem; font-weight: 700; }
.wz-wa-live-text small { font-size: 0.75rem; opacity: 0.92; }
@media (prefers-reduced-motion: reduce) {
  .wz-wa-live, .wz-wa-live-icon::after { animation: none; }
}

.wz-feature {
  background: oklch(var(--b1));
  border: 1px solid color-mix(in oklch, oklch(var(--bc)) 10%, transparent);
  border-radius: var(--rounded-box);
  box-shadow: var(--wz-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.wz-feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--wz-shadow-lg);
  border-color: color-mix(in oklch, oklch(var(--p)) 35%, transparent);
}
.wz-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.8rem;
  background: color-mix(in oklch, oklch(var(--p)) 12%, transparent);
  color: color-mix(in oklch, oklch(var(--p)) 88%, black);
}
.wz-feature-icon svg { width: 1.35rem; height: 1.35rem; }

.wz-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
  padding: 0.12rem 0.4rem;
  border-radius: 0.4rem;
  background: color-mix(in oklch, oklch(var(--p)) 9%, transparent);
  color: color-mix(in oklch, oklch(var(--p)) 82%, black);
}

pre code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }

.wz-logo-strip {
  opacity: 0.55;
  filter: grayscale(1);
}

/* ---------------------------------------------------------------------------
   App install (download) banner
--------------------------------------------------------------------------- */
.wz-install-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%) translateY(150%);
  width: min(94vw, 34rem);
  z-index: 60;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease,
    visibility 0s linear 0.35s;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.wz-install-banner[data-visible="true"] {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, visibility 0s;
}
/* The close target stays comfortably tappable even on small screens. */
.wz-install-banner [data-install-dismiss] {
  min-width: 2.25rem;
  min-height: 2.25rem;
}

/* ---------------------------------------------------------------------------
   Motion
--------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .wz-fade-up { animation: wzFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .wz-fade-up[data-delay="1"] { animation-delay: 0.08s; }
  .wz-fade-up[data-delay="2"] { animation-delay: 0.16s; }
  .wz-fade-up[data-delay="3"] { animation-delay: 0.24s; }
  @keyframes wzFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Landing "Leads this week" chart — bars grow in with a springy ease. */
  .wz-bar { transform-origin: bottom; animation: wzBarGrow 0.9s cubic-bezier(0.34, 1.4, 0.64, 1) both; }
  @keyframes wzBarGrow {
    from { transform: scaleY(0.05); opacity: 0.2; }
    to { transform: scaleY(1); opacity: 1; }
  }
  .wz-bar:hover { filter: brightness(1.2); }
}

/* ---------------------------------------------------------------------------
   PWA / standalone tweaks
--------------------------------------------------------------------------- */
@media (display-mode: standalone) {
  .wz-install-cta { display: none !important; }
  .wz-header { padding-top: env(safe-area-inset-top); }
}
