/* Import Premium Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Color Variables and Theme Variables */
:root {
  --primary: #0298a6;
  /* Clinical Teal/Turquoise */
  --primary-dark: #007c8a;
  /* Dark Turquoise */
  --primary-light: #e0f2f1;
  /* Light Turquoise Background */
  --accent: #f59e0b;
  /* Gold/Warm accent for stars and ratings */
  --slate-900: #0f172a;
  /* Slate for headers */
  --slate-600: #475569;
  /* Slate for body text */
  --slate-100: #f1f5f9;
  /* Off-white background */
  --font-ar: 'Cairo', sans-serif;
  --font-en: 'Outfit', sans-serif;
}

/* Global Font Settings based on language */
html:lang(ar) {
  font-family: var(--font-ar);
}

html:lang(en) {
  font-family: var(--font-en);
}

/* Base Styles & Smooth Scroll */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  /* Offset for sticky navbar */
  overflow-x: hidden;
  /* Prevent horizontal scroll globally */
}

body {
  background-color: #ffffff;
  color: var(--slate-600);
  overflow-x: hidden;
  max-width: 100vw;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--slate-100);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
  border: 2px solid var(--slate-100);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Glassmorphism Styles */
.glass-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(2, 152, 166, 0.1);
}

.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: rgba(2, 152, 166, 0.3);
  box-shadow: 0 20px 25px -5px rgba(2, 152, 166, 0.08), 0 10px 10px -5px rgba(2, 152, 166, 0.04);
  transform: translateY(-5px);
}

/* Floating WhatsApp Button Animation */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #25d366;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: all 0.3s ease;
}

/* RTL adjustment for Floating WhatsApp */
html[dir="ltr"] .whatsapp-float {
  right: auto;
  left: 30px;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.whatsapp-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #25d366;
  border-radius: 50%;
  z-index: -1;
  animation: pulse-ring 2s infinite;
  opacity: 0.75;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.75;
  }

  70% {
    transform: scale(1.3);
    opacity: 0;
  }

  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Interactive Before/After Slider Styles */
.before-after-container {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.before-after-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.before-image {
  z-index: 10;
}

.after-image {
  z-index: 5;
}

.before-after-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  opacity: 0;
  cursor: ew-resize;
  z-index: 30;
}

.before-after-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: #ffffff;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.before-after-handle::after {
  content: '';
  width: 40px;
  height: 40px;
  background-color: var(--primary);
  border: 4px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m18 8 4 4-4 4M6 8l-4 4 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
}

/* Badge for Labeling Before/After */
.slider-label {
  position: absolute;
  bottom: 15px;
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.label-before {
  left: 15px;
  z-index: 25;
}

.label-after {
  right: 15px;
  z-index: 25;
}

/* Note: No RTL override for .label-before and .label-after because the "Before" image is always clipped to show on the left side, and the "After" image on the right, regardless of document direction. */

/* Service Card Micro-Animations */
.service-icon-container {
  transition: all 0.3s ease;
}

.glass-card:hover .service-icon-container {
  transform: scale(1.1) rotate(5deg);
  background-color: var(--primary);
  color: white;
}

/* Hero Section Decorative Shapes */
.hero-shape {
  position: absolute;
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  /* Hidden on mobile to prevent overflow */
  display: none;
}

@media (min-width: 640px) {
  .hero-shape {
    display: block;
  }
}

.hero-shape-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -50px;
}

.hero-shape-2 {
  width: 400px;
  height: 400px;
  bottom: -150px;
  left: -100px;
}

/* Mobile Nav Styles */
.mobile-menu {
  transition: transform 0.3s ease-in-out;
  transform: translateY(-100%);
}

.mobile-menu.active {
  transform: translateY(0);
}

/* LTR Language Overrides */
html[dir="ltr"] .text-right {
  text-align: left;
}

html[dir="ltr"] .justify-end {
  justify-content: flex-start;
}

html[dir="ltr"] .mr-0 {
  margin-right: unset;
  margin-left: 0;
}

html[dir="ltr"] .space-x-reverse > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
}

/* Mobile: prevent hero text from overflowing */
#home h1,
#home p {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Active Nav Links styling */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 50%;
  background-color: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}