/* ═══════════════════════════════════════════════════════════
   IT BOY — v3 Fixes CSS
   1. Services preview section
   2. Theme toggle smooth transitions  
   3. Bubble position override (main in updates.css)
   4. Phone/WhatsApp real values (visual only)
   5. WhatsApp button: icon-only + hover expand
   6. Performance hints
   ═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   FIX 2 — Smooth Theme Transition
   body.theme-transitioning adds smooth cross-fade
   to ALL color-dependent properties
══════════════════════════════════════════════════ */
body.theme-transitioning,
body.theme-transitioning *,
body.theme-transitioning *::before,
body.theme-transitioning *::after {
  transition:
    background-color 0.55s ease,
    background     0.55s ease,
    border-color   0.55s ease,
    color          0.55s ease,
    box-shadow     0.55s ease,
    opacity        0.55s ease !important;
}

/* Ensure entire page uses CSS vars correctly — belt-and-suspenders */
html[data-theme="light"] body    { background: var(--bg-primary); color: var(--text-primary); }
html[data-theme="dark"]  body    { background: var(--bg-primary); color: var(--text-primary); }

/* Header */
html[data-theme="light"] .site-header { background: rgba(245,247,250,0.92); }
html[data-theme="dark"]  .site-header { background: rgba(12,14,16,0.88); }

/* Cards, sections */
html[data-theme="light"] .card,
html[data-theme="light"] .svc-card,
html[data-theme="light"] .why-card,
html[data-theme="light"] .testimonial-card,
html[data-theme="light"] .cpt-item,
html[data-theme="light"] .tools-card,
html[data-theme="light"] .pcs-card {
  background: var(--bg-card);
  border-color: var(--border);
}

/* Why section */
html[data-theme="light"] .why-section { background: var(--bg-secondary); }

/* Stats grid */
html[data-theme="light"] .stat-item { background: var(--bg-card); }

/* Logo visibility */
.logo-img { display: none; }
.logo-img-dark  { display: block; }
html[data-theme="light"] .logo-img-dark  { display: none;  }
html[data-theme="light"] .logo-img-light { display: block; }


/* ══════════════════════════════════════════════════
   FIX 1 — Services Preview Section styling
══════════════════════════════════════════════════ */
#preview-services .services-preview-grid { margin-top: 0; }
#preview-services .service-prev-card     { cursor: pointer; }


/* ══════════════════════════════════════════════════
   FIX 2b — Nav Active Highlight (scroll-based)
   Merged clean version — no conflicts
══════════════════════════════════════════════════ */
.nav-menu a { position: relative; }
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%; right: 50%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  border-radius: 2px;
  transition: left 0.35s ease, right 0.35s ease, box-shadow 0.35s ease;
}
.nav-menu a.nav-active {
  color: var(--brand-light) !important;
  background: rgba(26,86,219,0.1);
}
.nav-menu a.nav-active::after {
  left: 16px !important; right: 16px !important;
  box-shadow: 0 0 10px rgba(59,130,246,0.55) !important;
}
.mobile-nav a.nav-active {
  color: var(--brand-light);
  background: rgba(26,86,219,0.1);
}
/* Remove old active class interference */
.nav-menu a.active { color: var(--text-secondary); }
.nav-menu a.active::after { left: 50%; right: 50%; box-shadow: none; }


/* ══════════════════════════════════════════════════
   FIX 5 + 6 — WhatsApp Float Button
   Icon-only by default, expands to show "Quick Chat" on hover
══════════════════════════════════════════════════ */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 0;                   /* collapsed: no gap */
  padding: 13px;            /* square pill = circle */
  background: #25d366;
  border-radius: 50px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  box-shadow: 0 4px 20px rgba(37,211,102,0.45), 0 2px 8px rgba(0,0,0,0.2);
  animation: waFloat 3.5s ease-in-out infinite;
  /* Transition for expand on hover */
  transition:
    padding      0.35s cubic-bezier(0.34,1.56,0.64,1),
    gap          0.35s cubic-bezier(0.34,1.56,0.64,1),
    border-radius 0.35s ease,
    box-shadow   0.3s ease,
    transform    0.25s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
  max-width: 52px;          /* collapsed width */
}
@keyframes waFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* Glow ring */
.wa-float-glow {
  position: absolute;
  inset: -4px;
  background: radial-gradient(ellipse at 50% 80%, rgba(37,211,102,0.35) 0%, transparent 70%);
  border-radius: 50px;
  z-index: -1;
  animation: waGlow 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes waGlow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%       { opacity: 1;    transform: scale(1.1); }
}

/* WhatsApp icon */
.wa-icon {
  width: 26px; height: 26px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

/* Label — hidden by default, revealed on hover */
.wa-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  max-width: 0;             /* collapsed */
  overflow: hidden;
  opacity: 0;
  transition:
    max-width 0.35s cubic-bezier(0.34,1.56,0.64,1),
    opacity   0.25s ease,
    margin    0.35s ease;
  margin-left: 0;
}

/* ── Hover: expand to show label ── */
.wa-float:hover {
  padding: 13px 18px 13px 14px;
  gap: 8px;
  border-radius: 50px;
  max-width: 180px;
  box-shadow: 0 8px 32px rgba(37,211,102,0.6), 0 3px 12px rgba(0,0,0,0.2);
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.03);
}
.wa-float:hover .wa-label {
  max-width: 120px;
  opacity: 1;
  margin-left: 0;
}
.wa-float:hover .wa-icon {
  transform: rotate(-8deg) scale(1.1);
}
.wa-float:active { transform: scale(0.96) !important; }

/* ── Mobile: icon only, no hover expand ── */
@media (max-width: 600px) {
  .wa-float {
    bottom: 20px;
    right: 16px;
    padding: 13px;
    border-radius: 50%;
    max-width: 52px;
  }
  .wa-float:hover {
    padding: 13px;
    gap: 0;
    border-radius: 50%;
    max-width: 52px;
    transform: scale(1.05);
  }
  .wa-float:hover .wa-label { max-width: 0; opacity: 0; }
  .wa-label { display: none; }
  .wa-icon  { width: 26px; height: 26px; }
}


/* ══════════════════════════════════════════════════
   FIX 4 — Performance
══════════════════════════════════════════════════ */
.robot-message-box, .wa-float, .hero-particles, .theme-knob, .client-track {
  will-change: transform;
}
.reveal.visible { will-change: auto; }

.preview-section, .why-section, .cta-band, .site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 0 600px;
}

#heroSection {
  transform: translateZ(0);
  backface-visibility: hidden;
}
.client-track {
  transform: translateZ(0);
  backface-visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .robot-message-box { animation: none !important; opacity: 1 !important; }
  .wa-float          { animation: none !important; }
  .wa-float-glow     { animation: none !important; }
  .rmb-glow          { animation: none !important; }
  .rmb-dot           { animation: none !important; }
  .client-track      { animation-duration: 60s !important; }
  .reveal            { transition-duration: 0.1s !important; }
}

/* Clients CTA row */
.clients-cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
}
