/* ==========================================
   عيادات بسمة شفا التخصصية - Custom Styles
   ========================================== */

/* CSS Variables / Color Tokens */
:root {
  --primary: #0BA74F;
  --primary-dark: #08943e;
  --primary-light: #e8f5ee;
  --secondary: #2B3480;
  --secondary-dark: #1f2660;
  --secondary-light: #e8e9f2;
  --text-dark: #1a1a2e;
  --text-muted: #6b7280;
  --bg-light: #f8fafc;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
  --primary: #0BA74F;
/* Base */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

::selection {
  background: var(--primary);
  color: white;
}

/* ========== ANIMATIONS ========== */

/* Float Animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Ping Slow */
@keyframes ping-slow {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}
.animate-ping-slow {
  animation: ping-slow 4s ease-in-out infinite;
  transform-origin: center;
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}
.animate-float-delayed {
  animation: float 4s ease-in-out 2s infinite;
}

/* Stethoscope SVG Animations */
.stethoscope-svg .heartbeat-line {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: heartbeat-draw 2s ease-in-out infinite;
}

@keyframes heartbeat-draw {
  0% { stroke-dashoffset: 50; opacity: 0.6; }
  30% { stroke-dashoffset: 0; opacity: 1; }
  60% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 50; opacity: 0.6; }
}

.stethoscope-svg .animate-chestpiece {
  animation: chestpiece-pulse 3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes chestpiece-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.stethoscope-svg .wave-1 { animation: wave-pulse 2.5s ease-in-out infinite; transform-origin: left; }
.stethoscope-svg .wave-2 { animation: wave-pulse 2.5s ease-in-out infinite 0.4s; transform-origin: left; }
.stethoscope-svg .wave-3 { animation: wave-pulse 2.5s ease-in-out infinite 0.8s; transform-origin: left; }

@keyframes wave-pulse {
  0%, 100% { opacity: 0.2; transform: scaleX(1); }
  50% { opacity: 0.5; transform: scaleX(1.1); }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ========== COMPONENT STYLES ========== */

/* Header blur on scroll */
.header-scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08) !important;
}

/* Service Cards */
.payment-card.selected {
  border-color: #0BA74F;
  background: #f0fdf4;
}
.service-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(11, 167, 79, 0.15);
}

/* Doctor Cards */
.doctor-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.doctor-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(43, 52, 128, 0.2);
}

/* Payment Methods */
.payment-method {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.payment-method:hover {
  transform: translateX(-4px);
}

/* Nav Links */
.nav-link {
  position: relative;
}
.nav-link.active {
  color: var(--secondary);
  font-weight: 700;
}
.nav-link.active::after {
  transform: scaleX(1) !important;
}

/* Mobile Nav Links */
.mobile-nav-link {
  transition: all 0.2s ease;
}

/* WhatsApp Float Pulse */
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Background Noise Texture */
.bg-noise {
  position: relative;
}
.bg-noise::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Hover Glow Effect */
.hover-glow {
  transition: all 0.3s ease;
}
.hover-glow:hover {
  box-shadow: 0 0 30px rgba(11, 167, 79, 0.3);
}

/* Section Subtle Grid Pattern */
.grid-pattern {
  background-image:
    linear-gradient(rgba(11, 167, 79, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 167, 79, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ========== RTL OVERRIDES ========== */
[dir="rtl"] .fa-arrow-left {
  transform: scaleX(-1);
}
[dir="ltr"] .fa-arrow-left {
  transform: scaleX(1);
}
[dir="rtl"] .ml-auto { margin-left: 0; margin-right: auto; }
[dir="ltr"] .mr-auto { margin-right: 0; margin-left: auto; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 2.25rem !important;
  }
  h2 {
    font-size: 1.875rem !important;
  }
  .text-5xl {
    font-size: 2.25rem !important;
  }
  .text-6xl, .text-7xl {
    font-size: 2.5rem !important;
  }
}

/* Accessibility: Focus States */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Button Focus */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
  }
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Language transition */
[data-ar], [data-en] {
  transition: opacity 0.2s ease;
}
.lang-switching [data-ar],
.lang-switching [data-en] {
  opacity: 0;
}
