:root {
  --cubic-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --cubic-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light & Dark Scheme Standard Setup */
html:not(.dark) {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #ffffff;
  color: #1e293b;
}

/* RTL Typography & Direction Enhancements for Urdu */
[dir="rtl"] {
  font-family: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif;
  text-align: right;
}

[dir="rtl"] .ltr-num {
  direction: ltr;
  display: inline-block;
}

/* Sticky Header Scroll Margin */
section[id] {
  scroll-margin-top: 90px;
}

/* --- 1. No-JS Safe Fallback --- */
/* Agar JS disable ya block ho to page gayab nahi hoga */
.no-js .reveal {
  opacity: 1 !important;
  transform: none !important;
}

.no-js .bubble-container {
  display: none !important;
}

/* --- 2. Minimal Floating Bubbles --- */
.bubble-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.16), rgba(147, 197, 253, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.12);
  animation: bubbleRise linear infinite;
}

.dark .bubble {
  background: radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.15), rgba(30, 58, 138, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes bubbleRise {
  0% {
    transform: translateY(105vh) translateX(0) scale(0.85);
    opacity: 0;
  }
  15% { opacity: 0.45; }
  85% { opacity: 0.45; }
  100% {
    transform: translateY(-12vh) translateX(25px) scale(1.15);
    opacity: 0;
  }
}

/* --- 3. Scroll Progress Top Bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  height: 3px;
  width: 100%;
  z-index: 100;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #2563eb, #38bdf8, #f97316);
}

/* --- 4. Glass Navbar & Nav Links --- */
.glass-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dark .glass-nav {
  background: rgba(11, 16, 27, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nav-link {
  position: relative;
  display: inline-block;
  transition: transform 0.25s var(--cubic-spring), color 0.2s ease;
}

.nav-link:hover {
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  inset-inline-start: 50%;
  width: 0;
  height: 2px;
  background: #2563eb;
  border-radius: 99px;
  transform: translateX(-50%);
  transition: width 0.3s var(--cubic-smooth);
}

[dir="rtl"] .nav-link::after {
  transform: translateX(50%);
}

.nav-link:hover::after, 
.nav-link.active::after {
  width: 100%;
}

/* Mobile Drawer Slide Animation */
#mobileDrawer {
  animation: slideDrawerDown 0.3s var(--cubic-smooth) forwards;
}

@keyframes slideDrawerDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- 5. Scroll Reveal --- */

/* --- 5. Two-Way Smooth Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.7s var(--cubic-smooth), transform 0.7s var(--cubic-smooth);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.reveal-above:not(.is-visible) {
  transform: translateY(-35px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.reveal-above:not(.is-visible) {
  transform: translateY(-28px);
}

/* --- 6. Buttons & Cards Micro-Interactions --- */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s var(--cubic-smooth), box-shadow 0.25s var(--cubic-smooth), background-color 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -6px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* Service Card Lift */
.service-card-lift {
  transition: transform 0.3s var(--cubic-smooth), box-shadow 0.3s var(--cubic-smooth), border-color 0.25s ease;
}

.service-card-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 28px -10px rgba(37, 99, 235, 0.16);
}

.dark .service-card-lift:hover {
  box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.6);
  border-color: rgba(96, 165, 250, 0.45);
}

/* Appliance Selection Card Lift */
.appliance-category-btn {
  transition: transform 0.25s var(--cubic-spring), box-shadow 0.2s ease, border-color 0.2s ease;
}

.appliance-category-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 18px -6px rgba(37, 99, 235, 0.18);
}

.appliance-category-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Form Inputs Stability (No shifting translateY on focus) */
input, textarea, select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* Dropdown Open Animation */
#typeDropdown, #serviceDropdown, #langDropdown {
  animation: dropdownPop 0.2s var(--cubic-smooth) forwards;
}

@keyframes dropdownPop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --- 7. FAQ Accordion Transitions --- */
.faq-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--cubic-smooth), opacity 0.25s ease;
  opacity: 0;
}

.faq-wrapper.expanded {
  opacity: 1;
}

/* --- 8. Back To Top Button --- */
.back-to-top {
  position: fixed;
  inset-inline-end: 20px;
  bottom: 24px;
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--cubic-spring), background-color 0.2s ease;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- 9. Star Rating Interactions --- */
.star-btn {
  display: inline-block;
  color: #cbd5e1;
  transform-origin: center bottom;
  transition: transform 0.2s var(--cubic-spring), color 0.15s ease;
  user-select: none;
}

.star-btn:hover {
  transform: translateY(-3px) scale(1.25) rotate(-6deg);
  color: #fbbf24 !important;
  filter: drop-shadow(0 4px 6px rgba(245, 158, 11, 0.35));
}

.star-btn:active {
  transform: scale(0.9);
}

@keyframes starPop {
  0% { transform: scale(0.7); }
  50% { transform: scale(1.35) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.star-pop {
  animation: starPop 0.35s var(--cubic-spring) forwards;
}

@keyframes scorePulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.score-bump {
  display: inline-block;
  animation: scorePulse 0.3s var(--cubic-spring);
}

/* Reviews Feed */
.review-card-item {
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
}

.review-card-item:hover {
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.08);
}

.review-card-fade-out {
  opacity: 0 !important;
  transform: scale(0.94) translateX(20px) !important;
}

@keyframes cardEnterSmooth {
  0% {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.review-card-animate-in {
  animation: cardEnterSmooth 0.5s var(--cubic-smooth) forwards;
}

/* --- 10. Floating Call & WhatsApp Action Dock --- */
.floating-actions-dock {
  position: fixed;
  inset-inline-start: 20px;
  bottom: 24px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floating-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s var(--cubic-spring), box-shadow 0.2s ease;
}

.floating-action-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.floating-action-btn:active {
  transform: scale(0.95);
}

/* --- 11. Accessibility: Reduced Motion Support --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .bubble-container {
    display: none !important;
  }
}