/**
 * Properties Infinite Carousel
 *
 * This component creates a horizontal infinite scrolling carousel
 * with smooth animations and responsive behavior.
 */

.properties-carousel-section {
  position: relative;
  padding: 4rem 0;
  background-color: var(--bg-dark, #1a1a1a);
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* Ultra-black dark mode */
[data-theme="dark"] .properties-carousel-section {
  background-color: #000000 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .section-title,
[data-theme="dark"] .section-subtitle {
  color: #ffffff !important;
}

[data-theme="dark"] .carousel-property-card {
  background-color: #0a0a0a !important;
  border-color: #2a2a2a !important;
  color: #ffffff !important;
}

/* Light mode support */
[data-theme="light"] .properties-carousel-section {
  background-color: var(--bg-light, #f9f9f9);
}

.section-header {
  margin-bottom: 3rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--text-light, #f5f5f5);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
  letter-spacing: -0.02em;
}

[data-theme="light"] .section-title {
  color: var(--text-primary, #1a2332);
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-light-secondary, #b0b0b0);
  font-weight: 400;
  max-width: 700px;
  margin: 0 auto;
  transition: color 0.3s ease;
  line-height: 1.6;
}

[data-theme="light"] .section-subtitle {
  color: var(--text-secondary, #5a6776);
}

.infinite-carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0 auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.infinite-carousel-container::-webkit-scrollbar {
  display: none;
}

.infinite-carousel-track {
  display: flex;
  gap: 1rem;
  padding: 0 1rem;
  min-height: 420px;
  will-change: transform;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.carousel-property-card {
  /* Fluid responsive sizing */
  flex: 0 0 min(85vw, 300px);
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

[data-theme="light"] .carousel-property-card {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (min-width: 576px) {
  .carousel-property-card {
    flex: 0 0 min(75vw, 320px);
    height: 460px;
  }

  .infinite-carousel-track {
    min-height: 460px;
    gap: 1.25rem;
    padding: 0 1.25rem;
  }
}

@media (min-width: 768px) {
  .carousel-property-card {
    flex: 0 0 min(45vw, 350px);
    height: 520px;
  }

  .infinite-carousel-track {
    min-height: 520px;
    gap: 1.5rem;
    padding: 0 1.5rem;
  }

  /* Re-enable JavaScript control for desktop */
  .infinite-carousel-track {
    transition: none;
  }
}

@media (min-width: 992px) {
  .carousel-property-card {
    flex: 0 0 min(35vw, 380px);
    height: 560px;
  }

  .infinite-carousel-track {
    min-height: 560px;
    gap: 1.75rem;
    padding: 0 2rem;
  }
}

@media (min-width: 1200px) {
  .carousel-property-card {
    flex: 0 0 min(30vw, 420px);
    height: 600px;
  }

  .infinite-carousel-track {
    min-height: 600px;
    gap: 2rem;
    padding: 0 2rem;
  }
}

.carousel-property-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .carousel-property-card:hover {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.05);
}

.carousel-property-image {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.carousel-property-card:hover .carousel-property-image img {
  transform: scale(1.05);
}

.carousel-property-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
  z-index: 1;
}

.carousel-property-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem;
  color: #fff;
  z-index: 2;
  transform: translateY(0);
  transition: transform 0.4s ease;
}

.carousel-property-card:hover .carousel-property-content {
  transform: translateY(-5px);
}

.carousel-property-title {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: color 0.3s ease;
}

.carousel-property-location {
  margin: 0;
  font-size: 1.1rem;
  opacity: 0.95;
  display: flex;
  align-items: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  flex-wrap: wrap;
  /* Allow wrapping on small screens */
}

.carousel-property-location::before {
  content: '\f3c5';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-right: 0.5rem;
  font-size: 0.9rem;
}

.property-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  /* Remove tap highlight on mobile */
  outline: none;
  /* Remove focus outline */
}

.property-link:focus {
  outline: none;
  /* Remove focus outline */
}

/* Navigation controls */
.carousel-navigation {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 10;
  transform: translateY(-50%);
  pointer-events: none;
}

.carousel-prev,
.carousel-next {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--button-bg-dark, rgba(40, 40, 40, 0.9));
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  pointer-events: auto;
  color: var(--button-text-dark, #f0f0f0);
  -webkit-tap-highlight-color: transparent;
  /* Remove tap highlight on mobile */
  outline: none;
  /* Remove focus outline */
}

.carousel-prev {
  left: 2rem;
  position: absolute;
}

.carousel-next {
  right: 2rem;
  position: absolute;
}

/* Make navigation buttons larger on mobile for easier tapping */
@media (max-width: 767px) {

  .carousel-prev,
  .carousel-next {
    width: 40px;
    height: 40px;
  }

  .carousel-prev {
    left: 1rem;
  }

  .carousel-next {
    right: 1rem;
  }
}

[data-theme="light"] .carousel-prev,
[data-theme="light"] .carousel-next {
  background-color: var(--button-bg, rgba(255, 255, 255, 0.9));
  color: var(--button-text, #333);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: var(--button-bg-hover-dark, #333);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transform: scale(1.1);
}

.carousel-prev:focus,
.carousel-next:focus {
  outline: none;
}

[data-theme="light"] .carousel-prev:hover,
[data-theme="light"] .carousel-next:hover {
  background-color: var(--button-bg-hover, #fff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-prev i,
.carousel-next i {
  font-size: 1.2rem;
}

/* Property features */
.property-features {
  display: flex;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
  /* Allow wrapping on small screens */
}

.property-feature {
  display: flex;
  align-items: center;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
  /* Add space below for wrapping */
}

.property-feature i {
  margin-right: 0.3rem;
}

/* Location badge */
.property-location-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 2;
  transition: all 0.3s ease;
}

.carousel-property-card:hover .property-location-badge {
  background-color: var(--primary-color, #007bff);
}

/* Mobile-specific optimizations */
@media (max-width: 767px) {

  /* Adjust content padding for smaller cards */
  .carousel-property-content {
    padding: 1.25rem;
  }

  .carousel-property-title {
    font-size: 1.3rem;
    line-height: 1.4;
  }

  .carousel-property-location {
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Hide navigation on mobile - use native scrolling */
  .carousel-navigation {
    display: none !important;
  }

  /* Add subtle scroll indicators */
  .properties-carousel-section {
    position: relative;
  }

  .properties-carousel-section::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 20px;
    height: 60px;
    background: linear-gradient(90deg, transparent 0%, var(--bg-dark, #1a1a1a) 90%);
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
  }

  [data-theme="light"] .properties-carousel-section::after {
    background: linear-gradient(90deg, transparent 0%, var(--bg-light, #f9f9f9) 90%);
  }

  .properties-carousel-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 20px;
    height: 60px;
    background: linear-gradient(-90deg, transparent 0%, var(--bg-dark, #1a1a1a) 90%);
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
  }

  [data-theme="light"] .properties-carousel-section::before {
    background: linear-gradient(-90deg, transparent 0%, var(--bg-light, #f9f9f9) 90%);
  }
}

/* Animation for a smooth entry */
@keyframes carouselFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.properties-carousel-section {
  animation: carouselFadeIn 0.8s ease-out forwards;
}

/* Clone indicator for development (hidden in production) */
.carousel-property-card.clone {
  /* Uncomment for debugging
  outline: 2px dashed red;
  */
}

/* No transition class - used when resetting position */
.no-transition {
  transition: none !important;
}

/* Active card indicator */
.carousel-property-card.active {
  transform: translateY(-10px);
  z-index: 1;
}

/* ==========================================================================
   CAROUSEL INDICATORS FIXES (INTEGRATED FROM FIX FILE)
   ========================================================================== */

/* Property list carousel indicators - FORCE center alignment */
.property-list-section .carousel-indicators,
.property-card .carousel-indicators,
.modern-card .carousel-indicators {
  position: absolute !important;
  bottom: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  z-index: 3 !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  max-width: none !important;
}

/* Show indicators on hover */
.property-card:hover .carousel-indicators,
.modern-card:hover .carousel-indicators,
.carousel-property-card:hover .carousel-indicators {
  opacity: 0.9 !important;
}

/* Individual indicator dots - consistent sizing and appearance */
.property-list-section .carousel-indicator,
.property-card .carousel-indicator,
.modern-card .carousel-indicator,
.carousel-property-card .carousel-indicator {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.6) !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Active indicator styling */
.property-list-section .carousel-indicator.active,
.property-card .carousel-indicator.active,
.modern-card .carousel-indicator.active,
.carousel-property-card .carousel-indicator.active {
  background: rgba(255, 255, 255, 1) !important;
  transform: scale(1.25) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

/* Hover effect for individual indicators */
.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.8) !important;
  transform: scale(1.1) !important;
}

.carousel-indicator.active:hover {
  transform: scale(1.3) !important;
}

/* ==========================================================================
   RESPONSIVE CAROUSEL INDICATORS
   ========================================================================== */

/* Mobile adjustments */
@media (max-width: 768px) {

  .property-list-section .carousel-indicators,
  .property-card .carousel-indicators,
  .modern-card .carousel-indicators,
  .carousel-property-card .carousel-indicators {
    bottom: 8px !important;
    gap: 4px !important;
  }

  .property-list-section .carousel-indicator,
  .property-card .carousel-indicator,
  .modern-card .carousel-indicator,
  .carousel-property-card .carousel-indicator {
    width: 6px !important;
    height: 6px !important;
  }
}

/* Large screen adjustments */
@media (min-width: 1200px) {

  .property-list-section .carousel-indicators,
  .property-card .carousel-indicators,
  .modern-card .carousel-indicators,
  .carousel-property-card .carousel-indicators {
    bottom: 16px !important;
    gap: 8px !important;
  }

  .property-list-section .carousel-indicator,
  .property-card .carousel-indicator,
  .modern-card .carousel-indicator,
  .carousel-property-card .carousel-indicator {
    width: 10px !important;
    height: 10px !important;
  }
}

/* ==========================================================================
   THEME-CONSISTENT INDICATORS
   ========================================================================== */

/* Ensure indicators work well in both light and dark themes */
[data-theme="light"] .carousel-indicator,
[data-theme="dark"] .carousel-indicator {
  background: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .carousel-indicator.active,
[data-theme="dark"] .carousel-indicator.active {
  background: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5) !important;
}
