/* ============================================
   123WebMobile — Premium Enhancements
   Dark mode, WhatsApp widget, PWA, animations
   ============================================ */

/* === DARK MODE VARIABLES === */
html[data-theme="dark"] {
  --white: #0a1628;
  --off-white: #0f2140;
  --light-gray: #1e293b;
  --text: #e2e8f0;
  --text-light: #94a3b8;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.5);
}

html[data-theme="dark"] body { background: var(--white); }
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .testimonial-card,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .why-feature,
html[data-theme="dark"] .process-step,
html[data-theme="dark"] .contact-form,
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .form-group select {
  background: var(--off-white) !important;
  color: var(--text) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
html[data-theme="dark"] section:not(.hero):not([class*="dark"]) { background: var(--white); }
html[data-theme="dark"] .section-title,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .service-card h3,
html[data-theme="dark"] .blog-card h3 { color: var(--text) !important; }

/* === THEME TOGGLE BUTTON === */
.theme-toggle {
  position: fixed;
  top: 86px;
  right: 20px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--light-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  font-size: 20px;
}
.theme-toggle:hover { transform: scale(1.1); border-color: var(--teal); }
html[data-theme="dark"] .theme-toggle { background: var(--off-white); border-color: rgba(255,255,255,0.15); }
@media (max-width: 768px) {
  .theme-toggle { width: 40px; height: 40px; top: 82px; right: 12px; font-size: 18px; }
}

/* === WHATSAPP FLOAT BUTTON === */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(37,211,102,0.4);
  animation: wa-pulse 2.5s ease-in-out infinite;
  transition: transform 0.3s;
}
.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float svg { width: 30px; height: 30px; fill: #fff; }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(37,211,102,0.4), 0 0 0 0 rgba(37,211,102,0.5); }
  50% { box-shadow: 0 6px 24px rgba(37,211,102,0.4), 0 0 0 14px rgba(37,211,102,0); }
}
@media (max-width: 768px) {
  .whatsapp-float { bottom: 16px; right: 16px; width: 54px; height: 54px; }
  .whatsapp-float svg { width: 26px; height: 26px; }
}

/* === PWA INSTALL BUTTON === */
.pwa-install-float {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 900;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,201,167,0.35);
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.pwa-install-float:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,201,167,0.45); }
.pwa-install-float.visible { display: inline-flex; }
@media (max-width: 768px) {
  .pwa-install-float { bottom: 86px; left: 16px; padding: 10px 16px; font-size: 13px; }
  .pwa-install-float span { display: none; }
  .pwa-install-float::after { content: 'Install'; }
}

/* === TOAST === */
.site-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--deep);
  color: #fff;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  z-index: 5000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.site-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === SMOOTH FADE ANIMATIONS ON PAGE LOAD === */
body { animation: pageFadeIn 0.4s ease-out both; }
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* === BETTER FOCUS STATES FOR ACCESSIBILITY === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* === SCROLL PROGRESS BAR === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 100%);
  width: 0%;
  z-index: 10000;
  transition: width 0.1s linear;
}

/* === PWA STANDALONE MODE === */
html.pwa-standalone .theme-toggle { top: calc(16px + env(safe-area-inset-top)); }
html.pwa-standalone .pwa-install-float { display: none !important; }

/* === PRINT === */
@media print {
  .whatsapp-float, .theme-toggle, .pwa-install-float, .scroll-progress, .nav, .mobile-menu { display: none !important; }
}
