/* =====================================================
   Advanced Animations CSS - أبومازن للتسويق العقاري
   Premium Effects: Scroll Reveal, 3D Transforms, Particles, Glassmorphism
   ===================================================== */

/* ─── Scroll Reveal System ─── */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

.reveal-rotate {
  opacity: 0;
  transform: rotate(-5deg) scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-rotate.visible {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Stagger delays for sequential animations */
.delay-1 { transition-delay: 0.1s !important; }
.delay-2 { transition-delay: 0.2s !important; }
.delay-3 { transition-delay: 0.3s !important; }
.delay-4 { transition-delay: 0.4s !important; }
.delay-5 { transition-delay: 0.5s !important; }
.delay-6 { transition-delay: 0.6s !important; }
.delay-7 { transition-delay: 0.7s !important; }
.delay-8 { transition-delay: 0.8s !important; }

/* ─── Hero Particles Canvas (للخلفية) ─── */
#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* ─── Animated Gradient Background ─── */
.hero-animated,
.gradient-animated {
  background: linear-gradient(
    -45deg,
    #082d47,
    #0f4c81,
    #1a6ea8,
    #0e4429,
    #15803d,
    #0f4c81,
    #082d47
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ─── Floating Shapes (خلفية متحركة) ─── */
.floating-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  animation: floatShape linear infinite;
  will-change: transform;
}

.shape-1 {
  width: 350px;
  height: 350px;
  top: -120px;
  right: -100px;
  animation-duration: 22s;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
}

.shape-2 {
  width: 220px;
  height: 220px;
  bottom: -80px;
  left: 8%;
  animation-duration: 18s;
  animation-delay: -6s;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
}

.shape-3 {
  width: 180px;
  height: 180px;
  top: 25%;
  right: 18%;
  animation-duration: 28s;
  animation-delay: -12s;
}

.shape-4 {
  width: 100px;
  height: 100px;
  top: 55%;
  left: 25%;
  animation-duration: 20s;
  animation-delay: -4s;
  background: radial-gradient(circle, rgba(212,153,31,.08) 0%, transparent 70%);
}

.shape-5 {
  width: 280px;
  height: 280px;
  bottom: 5%;
  right: 3%;
  animation-duration: 25s;
  animation-delay: -10s;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 70%);
}

@keyframes floatShape {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 0.4; }
  33%  { transform: translateY(-40px) rotate(120deg) scale(1.1); opacity: 0.6; }
  66%  { transform: translateY(20px) rotate(240deg) scale(0.9); opacity: 0.5; }
  100% { transform: translateY(0) rotate(360deg) scale(1); opacity: 0.4; }
}

/* ─── Hero Glowing Lines (خطوط ضوئية) ─── */
.hero-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.hero-line {
  position: absolute;
  height: 1px;
  left: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.2),
    rgba(212,153,31,.3),
    rgba(255,255,255,.2),
    transparent
  );
  animation: lineScan 8s linear infinite;
  will-change: transform;
}

.hero-line:nth-child(1) {
  top: 18%;
  animation-delay: 0s;
}

.hero-line:nth-child(2) {
  top: 48%;
  animation-delay: 2.5s;
}

.hero-line:nth-child(3) {
  top: 78%;
  animation-delay: 5s;
}

@keyframes lineScan {
  0%   { transform: translateX(-100%); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

/* ─── Hero Text Entrance Animations ─── */
.hero-badge-anim {
  animation: badgePop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badgePop {
  0%   { opacity: 0; transform: scale(0.5) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-title-anim {
  animation: titleSlide 1s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes titleSlide {
  0%   { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-sub-anim {
  animation: titleSlide 1s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-btns-anim {
  animation: titleSlide 1s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-img-anim {
  animation: imgReveal 1.2s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes imgReveal {
  0%   { opacity: 0; transform: translateX(-50px) scale(0.95) rotateY(-8deg); }
  100% { opacity: 1; transform: translateX(0) scale(1) rotateY(0deg); }
}

/* ─── Gradient Text Effects ─── */
.gradient-text {
  background: linear-gradient(135deg, #f5c94d 0%, #d4991f 50%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  animation: gradientTextShift 3s ease infinite;
  background-size: 200% 200%;
}

.gradient-text-blue {
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #1d4ed8, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientTextShift 3s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradientTextShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ─── Glassmorphism Effects ─── */
.glass-card {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,.1);
}

.glass-card-dark {
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(0,0,0,.3);
}

.glass-card-light {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 8px 32px 0 rgba(0,0,0,.08);
}

/* ─── 3D Card Hover Effects ─── */
.card-3d {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

.card-3d:hover {
  transform: perspective(1200px) rotateY(-4deg) rotateX(3deg) translateY(-10px) scale(1.02);
  box-shadow: 25px 25px 70px rgba(0,0,0,.25),
              -8px -8px 30px rgba(255,255,255,.05);
}

.card-3d-tilt-left:hover {
  transform: perspective(1200px) rotateY(4deg) rotateX(-2deg) translateY(-8px) scale(1.02);
}

.card-3d-lift:hover {
  transform: perspective(1000px) translateY(-12px) scale(1.03);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

/* ─── Shimmer Loading Effect ─── */
.shimmer {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e8e8e8 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-dark {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.05) 25%,
    rgba(255,255,255,.1) 50%,
    rgba(255,255,255,.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

/* ─── Pulse Glow Effects ─── */
.pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(15,76,129,.3); }
  50%      { box-shadow: 0 0 45px rgba(15,76,129,.6), 0 0 90px rgba(15,76,129,.2); }
}

.pulse-glow-accent {
  animation: pulseGlowAccent 2.5s ease-in-out infinite;
}

@keyframes pulseGlowAccent {
  0%, 100% { box-shadow: 0 0 20px rgba(212,153,31,.3); }
  50%      { box-shadow: 0 0 45px rgba(212,153,31,.6), 0 0 90px rgba(212,153,31,.2); }
}

.pulse-glow-green {
  animation: pulseGlowGreen 2.5s ease-in-out infinite;
}

@keyframes pulseGlowGreen {
  0%, 100% { box-shadow: 0 0 20px rgba(22,163,74,.3); }
  50%      { box-shadow: 0 0 45px rgba(22,163,74,.6); }
}

/* ─── Pulse Scale Effect ─── */
.pulse-scale {
  animation: pulseScale 2s ease-in-out infinite;
}

@keyframes pulseScale {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

/* ─── Counter Number Animation ─── */
.count-up {
  display: inline-block;
  animation: countBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes countBounce {
  0%   { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── Floating Badge Animation ─── */
.float-badge {
  animation: floatBadge 3.5s ease-in-out infinite;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-10px) scale(1.02); }
}

/* ─── Spinning Icon ─── */
.spin-slow {
  animation: spinSlow 10s linear infinite;
}

.spin-medium {
  animation: spinSlow 6s linear infinite;
}

.spin-fast {
  animation: spinSlow 3s linear infinite;
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

/* ─── Bounce Animation ─── */
.bounce {
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-15px); }
}

/* ─── Shake Animation ─── */
.shake {
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}

/* ─── Fade Effects ─── */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fade-out {
  animation: fadeOut 0.6s ease-out;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ─── Slide In From Directions ─── */
.slide-in-up {
  animation: slideInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.slide-in-down {
  animation: slideInDown 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDown {
  from { transform: translateY(-60px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ─── Zoom Effects ─── */
.zoom-in {
  animation: zoomIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.zoom-out {
  animation: zoomOut 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomOut {
  from { transform: scale(1.2); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ─── Property Type Tabs Animation ─── */
.section-tabs {
  display: flex;
  gap: 0;
  background: var(--gray-100);
  border-radius: 50px;
  padding: 6px;
  width: fit-content;
  margin: 0 auto 40px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.section-tab {
  padding: 12px 32px;
  border-radius: 50px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.section-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background: transparent;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
}

.section-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(15,76,129,.4);
  transform: scale(1.02);
}

.section-tab.rental-tab.active {
  background: var(--success);
  box-shadow: 0 8px 24px rgba(22,163,74,.4);
}

.section-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(0,0,0,.06);
  transform: translateY(-2px);
}

.tab-pane {
  display: none;
  animation: tabFadeIn 0.5s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Stats Counter Section with Gradient Bar ─── */
.stats-modern {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--white);
  box-shadow: 0 -4px 32px rgba(0,0,0,.1);
  position: relative;
  border-radius: 0;
}

.stats-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--accent) 25%,
    var(--success) 50%,
    var(--accent) 75%,
    var(--primary) 100%
  );
  background-size: 200% 100%;
  animation: gradientBar 4s linear infinite;
}

@keyframes gradientBar {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.stat-modern-item {
  padding: 32px 18px;
  text-align: center;
  border-left: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.stat-modern-item:last-child {
  border-left: none;
}

.stat-modern-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary-50);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-modern-item:hover {
  background: var(--gray-50);
  transform: scale(1.05);
  z-index: 2;
}

.stat-modern-item:hover::before {
  opacity: 1;
}

.stat-modern-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin: 0 auto 12px;
  transition: transform 0.3s;
  position: relative;
  z-index: 1;
}

.stat-modern-item:hover .stat-modern-icon {
  transform: scale(1.15) rotate(5deg);
}

.stat-modern-num {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.stat-modern-lbl {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* ─── Hero Search Box Enhanced ─── */
.hero-search {
  background: rgba(255,255,255,.98);
  border-radius: 22px;
  padding: 32px 36px;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: 40px;
  position: relative;
  z-index: 5;
  border: 1px solid rgba(255,255,255,.4);
  animation: searchSlide 1.2s 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes searchSlide {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ─── Feature Icons Section ─── */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.feature-item {
  background: var(--white); border-radius: 16px;
  padding: 28px 22px; border: 1px solid var(--border);
  text-align: center; transition: all .3s cubic-bezier(.4,0,.2,1);
  position: relative; overflow: hidden;
}
.feature-item::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  opacity: 0; transition: opacity .3s;
}
.feature-item:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(26,75,122,.15); border-color: var(--primary); }
.feature-item:hover::before { opacity: .05; }
.feature-icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff; margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(26,75,122,.25);
  transition: transform .3s;
}
.feature-item:hover .feature-icon { transform: scale(1.1) rotate(5deg); }
.feature-title { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.feature-desc  { font-size: .84rem; color: var(--text-muted); line-height: 1.6; }

/* ─── Alexandria Badge ─── */
.alex-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(26,75,122,.1), rgba(37,99,168,.1));
  border: 1px solid rgba(26,75,122,.2);
  border-radius: 50px; padding: 8px 20px;
  font-size: .85rem; font-weight: 700; color: var(--primary);
  margin-bottom: 20px;
}
.alex-badge i { color: var(--accent); }

/* ─── Section Divider ─── */
.section-divider {
  height: 2px; margin: 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ─── Hover Image Zoom ─── */
.img-zoom-wrap { overflow: hidden; border-radius: inherit; }
.img-zoom-wrap img { transition: transform .6s cubic-bezier(.4,0,.2,1); }
.img-zoom-wrap:hover img { transform: scale(1.08); }

/* ─── Mobile Responsive ─── */
@media (max-width: 768px) {
  .stats-modern { grid-template-columns: repeat(3,1fr); }
  .stats-modern .stat-modern-item:nth-child(4),
  .stats-modern .stat-modern-item:nth-child(5) { border-top: 1px solid var(--border); }
  .section-tabs { flex-wrap: wrap; border-radius: 16px; }
  .section-tab  { padding: 9px 20px; font-size: .86rem; }
  .feature-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
  .stats-modern { grid-template-columns: repeat(2,1fr); }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .hero-search  { padding: 20px 16px; margin-top: 20px; border-radius: 14px; }
}

/* ─── Feature Icons Section ─── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.feature-item {
  background: var(--white);
  border-radius: 18px;
  padding: 32px 24px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.feature-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  opacity: 0;
  transition: opacity 0.4s;
}

.feature-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(15,76,129,.18);
  border-color: var(--primary);
}

.feature-item:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  margin: 0 auto 20px;
  box-shadow: 0 10px 25px rgba(15,76,129,.3);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.feature-item:hover .feature-icon {
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 15px 35px rgba(15,76,129,.4);
}

.feature-title {
  font-size: 1.0625rem;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* ─── Image Hover Zoom Effect ─── */
.img-zoom-wrap {
  overflow: hidden;
  border-radius: inherit;
  position: relative;
}

.img-zoom-wrap img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.img-zoom-wrap:hover img {
  transform: scale(1.12);
}

.img-zoom-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.4) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.img-zoom-wrap:hover::after {
  opacity: 1;
}

/* ─── Card Stagger Animation ─── */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  animation: staggerFadeIn 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes staggerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Skeleton Loader ─── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* ─── Loading Spinner ─── */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-sm {
  width: 24px;
  height: 24px;
  border-width: 3px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 6px;
}

/* ─── Progress Bar ─── */
.progress-bar {
  height: 4px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-600));
  border-radius: 4px;
  transition: width 0.5s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,.3),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

/* ─── Tooltip Animation ─── */
.tooltip {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.tooltip.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ─── Modal Animations ─── */
.modal-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-content {
  transform: scale(0.9) translateY(-20px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s;
}

.modal-content.show {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* ─── Ripple Click Effect ─── */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ─── Text Reveal Animation ─── */
.text-reveal {
  overflow: hidden;
  display: inline-block;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  animation: textSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes textSlideUp {
  to {
    transform: translateY(0);
  }
}

/* ─── Underline Hover Effect ─── */
.underline-animate {
  position: relative;
  display: inline-block;
}

.underline-animate::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.underline-animate:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ─── Mobile Responsive Animations ─── */
@media (max-width: 768px) {
  .stats-modern {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-modern .stat-modern-item:nth-child(4),
  .stats-modern .stat-modern-item:nth-child(5) {
    border-top: 1px solid var(--border);
  }
  
  .section-tabs {
    flex-wrap: wrap;
    border-radius: 18px;
    padding: 4px;
  }
  
  .section-tab {
    padding: 10px 20px;
    font-size: 0.875rem;
  }
  
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .card-3d:hover {
    transform: perspective(1000px) translateY(-5px) scale(1.01);
  }
}

@media (max-width: 480px) {
  .stats-modern {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-search {
    padding: 20px 16px;
    margin-top: 20px;
    border-radius: 16px;
  }
  
  /* Reduce animation complexity on slow devices */
  .shape {
    animation-duration: 30s !important;
  }
  
  .card-3d:hover {
    transform: translateY(-4px);
  }
}

/* ─── Reduced Motion Support ─── */
@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,
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ========================================
   LISTING PAGES ANIMATIONS
   ======================================== */

/* Header Content Animation */
.listing-page-header .header-content[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUpIn 0.8s ease-out forwards;
}

@keyframes fadeUpIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Type Tabs Animation */
.listing-type-tabs {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpIn 0.6s ease-out 0.2s forwards;
}

/* Filters Card Animation */
.filters-card[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpIn 0.6s ease-out forwards;
}

.filters-card[data-animate="fade-up"][data-delay="100"] {
    animation-delay: 0.1s;
}

/* Results Header Animation */
.results-header[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeUpIn 0.5s ease-out forwards;
}

.results-header[data-animate="fade-up"][data-delay="200"] {
    animation-delay: 0.2s;
}

/* Listing Card Wrapper Staggered Animation */
.listing-card-wrapper[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUpIn 0.6s ease-out forwards;
}

.listing-card-wrapper[data-animate="fade-up"].animated {
    animation: fadeUpIn 0.6s ease-out forwards;
}

/* Staggered delay for cards (data-delay attribute) */
.listing-card-wrapper[data-delay="50"] { animation-delay: 0.05s; }
.listing-card-wrapper[data-delay="100"] { animation-delay: 0.1s; }
.listing-card-wrapper[data-delay="150"] { animation-delay: 0.15s; }
.listing-card-wrapper[data-delay="200"] { animation-delay: 0.2s; }
.listing-card-wrapper[data-delay="250"] { animation-delay: 0.25s; }
.listing-card-wrapper[data-delay="300"] { animation-delay: 0.3s; }

/* Empty State Animation */
.empty-state-modern[data-animate="fade-up"] {
    animation: fadeUpIn 0.7s ease-out forwards;
}

.empty-state-modern[data-animate="fade-up"][data-delay="200"] {
    animation-delay: 0.2s;
}

/* Empty State Icon Pulse */
.empty-state-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(15, 76, 129, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(15, 76, 129, 0.4);
    }
}

.empty-state-icon.rental-empty {
    animation: iconPulseGreen 2s ease-in-out infinite;
}

@keyframes iconPulseGreen {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
    }
}

/* Pagination Animation */
.pagination-wrapper[data-animate="fade-up"] {
    animation: fadeUpIn 0.5s ease-out forwards;
}

/* CTA Content Animation */
.cta-section-listing .cta-content[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpIn 0.7s ease-out forwards;
}

/* CTA Icon Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Filter Submit Button Ripple Effect */
.filter-submit-btn {
    position: relative;
    overflow: hidden;
}

.filter-submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.filter-submit-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Type Tab Icon Rotation on Active */
.type-tab.active .tab-icon {
    animation: iconBounce 0.6s ease-out;
}

@keyframes iconBounce {
    0% {
        transform: scale(0.8) rotate(-10deg);
    }
    50% {
        transform: scale(1.15) rotate(5deg);
    }
    100% {
        transform: scale(1.1) rotate(0deg);
    }
}

/* Rental Features Banner Items Animation */
.rental-features-banner .feature-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUpIn 0.5s ease-out forwards;
}

.rental-features-banner .feature-item:nth-child(1) { animation-delay: 0.1s; }
.rental-features-banner .feature-item:nth-child(2) { animation-delay: 0.2s; }
.rental-features-banner .feature-item:nth-child(3) { animation-delay: 0.3s; }
.rental-features-banner .feature-item:nth-child(4) { animation-delay: 0.4s; }

/* Feature Icon Rotation */
.rental-features-banner .feature-item:hover .feature-icon {
    animation: iconRotate 0.6s ease-out;
}

@keyframes iconRotate {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(10deg) scale(1.1);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

/* View Mode Toggle Animation */
.view-mode-btn.active {
    animation: viewModeActivate 0.3s ease-out;
}

@keyframes viewModeActivate {
    0% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Pattern Background Animation */
@keyframes patternMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Breadcrumb Item Hover Animation */
.breadcrumb-modern .breadcrumb-item {
    position: relative;
}

.breadcrumb-modern .breadcrumb-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: white;
    transform: translateX(-50%);
    transition: width 0.3s ease-out;
}

.breadcrumb-modern .breadcrumb-item:hover::after {
    width: 80%;
}

/* Filter Input Focus Animation */
.filter-input:focus,
.filter-select:focus {
    animation: inputFocusPulse 0.3s ease-out;
}

@keyframes inputFocusPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Reset Button Hover Animation */
.reset-filters-btn {
    position: relative;
    overflow: hidden;
}

.reset-filters-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease-out;
}

.reset-filters-btn:hover::before {
    left: 100%;
}

/* Loading State Animation for Submit Button */
.filter-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.filter-submit-btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Smooth appearance for dynamically loaded content */
.listing-card-wrapper {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.listing-card-wrapper:not(.animated) {
    opacity: 0;
    transform: translateY(30px);
}

/* Pagination Link Hover Animation */
.pagination a {
    position: relative;
    overflow: hidden;
}

.pagination a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(15, 76, 129, 0.1), transparent);
    transition: left 0.4s ease-out;
}

.pagination a:hover::before {
    left: 100%;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
