﻿﻿/* Default system fonts */

/* ✅ Local WOFF2 fonts */
@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/Cairo-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/Cairo-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Cairo';
  src: url('/assets/fonts/Cairo-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

/* ============================================================================
   ANIMATION & TRANSITIONS
   ============================================================================ */

/* تطبيق Cairo على جميع العناصر */
html, body, * {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Animation delay using CSS custom properties (safe for CSP) */
.property-card {
  animation-delay: var(--animation-delay, 0s);
}

.category-card {
  animation-delay: var(--animation-delay, 0s);
}

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

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.seo-hidden-h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.poster-image {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 5.33;
  background-size: cover;
  background-position: center;
}

.category-img {
  aspect-ratio: 600 / 350;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.property-card-img {
  aspect-ratio: 686 / 386;
  object-fit: cover;
  width: 100%;
  display: block;
}

.properties-heading {
  text-align: center;
  color: #3949ab;
  margin: 20px 0;
}

.pagination-area {
  text-align: center;
  padding: 30px;
  display: none;
}

.pagination-area.show {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Error and Message Styles */
.error-message {
  color: #c00;
  font-size: 1.1rem;
}

.info-message {
  color: #888;
  font-size: 1.1rem;
}

.empty-message {
  color: #888;
  font-size: 1.1rem;
}

.paragraph-spacing {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.pagination-link {
  padding: 8px 12px;
  background: #3949ab;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
}

.pagination-link.secondary {
  background: #f0f0f0;
  color: black;
}

.pagination-link.secondary.active {
  background: #3949ab;
  color: white;
}

.pagination-divider {
  padding: 8px 12px;
}

/* Property Page Styles */
.property-debug-info {
  padding: 20px;
  background: #fee;
  color: #c00;
  border-radius: 4px;
  margin: 20px 0;
}

.seo-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.property-main-img {
  max-width: 100%;
  height: auto;
  width: 100%;
  display: block;
}

.property-title-heading {
  position: static;
  left: auto;
  width: auto;
  height: auto;
  overflow: visible;
}

.section-heading {
  color: #333;
  font-size: 1.4rem;
  margin: 20px 0 15px 0;
  border-bottom: 2px solid #3949ab;
  padding-bottom: 10px;
}

.related-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 2px solid #eee;
}

.related-section h2 {
  color: #333;
  font-size: 1.4rem;
  margin: 0 0 20px 0;
  font-family: 'Cairo', sans-serif;
}

/* Related Properties Grid - Moved to property.css for better styling control */

/* Category Page Styles */
.filter-panel-bg {
  background-size: cover;
  background-position: center;
}

.filter-group-full {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .filter-group-full {
    grid-column: auto;
  }
}

.category-btns-margin {
  margin-bottom: 15px;
}

.property-skeleton-loading {
  aspect-ratio: 465/262;
  object-fit: cover;
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* ============================================================================
   SECTIONS & SPACING
   ============================================================================ */

#poster-area {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  margin: 0 auto;
  padding: 0;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  animation: fadeInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#poster-area img {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 5.33;
  object-fit: cover;
  display: block;
  height: auto;
  background: #f7f7f7;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

#poster-area img:hover {
  transform: none;
}

.categories-block {
  margin: 0;
  padding: 0;
  position: relative;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#categories-area {
  padding: 0;
  margin: 0;
  max-width: 1200px;
  margin: 0 auto;
}

.categories-heading {
  color: #3949ab;
  text-align: center;
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 20px 15px 15px 15px;
}

.properties-block {
  margin: 0;
  padding: 50px 15px;
  background: #f9f9f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#properties-area {
  max-width: 1200px;
  margin: 0 auto;
}

#properties-area h2 {
  color: #3949ab !important;
  text-align: center;
  margin: 0 0 30px 0;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  body {
    overflow-x: hidden !important;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  }
  
  #poster-area {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  }
  
  #poster-area img,
  .poster-image {
    aspect-ratio: 3 / 1;
    max-height: 200px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  
  .categories-block {
    padding: 0;
    margin: 0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 100%;
    width: 100%;
  }
  
  .categories-heading {
    font-size: 1.4rem;
    margin: 0;
    padding: 20px 15px 0 15px;
  }

  .categories-grid {
    padding: 20px 15px 0 15px;
    gap: 12px;
    max-width: 100%;
  }
  
  #properties-area h2 {
    font-size: 1.4rem;
    margin: 0;
    padding: 20px 15px 0 15px;
  }

  .properties-block {
    padding: 0;
    margin: 0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-width: 100%;
    width: 100%;
  }

  .properties-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 100%;
    padding: 20px 15px 0 15px;
  }

  .property-card {
    border-radius: 8px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.1);
  }

  .property-card img {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 465 / 262;
  }

  .property-card .card-content {
    padding: 10px;
  }

  .property-card .card-title {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  .property-card .card-location {
    font-size: 0.75rem;
  }

  .property-card .card-price {
    font-size: 0.9rem;
    padding: 3px 6px;
  }

  .property-card .card-attributes {
    gap: 4px;
    margin-top: 6px;
  }

  .property-card .attr-chip {
    gap: 1px;
  }

  .property-card .attr-chip img {
    width: 16px;
    height: 16px;
  }

  .property-card .attr-label {
    font-size: 0.65rem;
  }
}

@media (min-width: 600px) and (max-width: 1024px) {
  #poster-area {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  }
  
  .categories-block {
    padding: 0;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  
  .properties-block {
    padding: 45px 15px;
    background: #f9f9f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
}

@media (min-width: 1024px) {
  .categories-block {
    padding: 0;
  }

  .properties-block {
    padding: 50px 0;
  }

  #properties-area {
    max-width: 100%;
    padding: 0 40px;
  }
}

/* ============================================================================
   POSTER AREA
   ============================================================================ */

/* Fade-in من الأعلى */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade-in من الأسفل */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer/Pulse للـ skeleton loaders */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ============================================================================
   GLOBAL TRANSITIONS
   ============================================================================ */

/* إضافة smooth transitions للـ hover effects */
.category-card,
.property-card,
.floating-btn {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease-out;
}

.property-card img,
.category-card img {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  height: auto;
  display: block;
  background-color: #f0f0f0;
}

.property-card img {
  aspect-ratio: 465 / 262;
  object-fit: cover;
}

.category-card img {
  aspect-ratio: 600 / 350;
  object-fit: cover;
  display: block;
}

/* ============================================================================
   FADE-IN ANIMATION CLASS
   ============================================================================ */

/* FADE-IN ANIMATION CLASS - تم إلغاؤه */
/* .property-card.fade-in,
.category-card.fade-in {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
} */

/* أزرار التواصل العائمة */
#floating-contact-buttons {
  position: fixed;
  bottom: 50px;
  right: 50px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
  pointer-events: none;
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
  opacity: 0;
}

.floating-btn {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  padding: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease-out;
}

.floating-btn:hover {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.floating-btn img {
  width: 56px;
  height: 56px;
  display: block;
  transition: transform 0.3s ease-out;
}

.floating-btn:active img {
  transform: scale(0.95);
}
.floating-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #222;
  color: #fff;
  font-size: 1rem;
  padding: 7px 16px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.floating-btn.show-tooltip .floating-tooltip {
  opacity: 1;
}

@media (max-width: 600px) {
  .property-card {
    padding-left: 5px;
    padding-right: 5px;
    animation: none !important;
  }
  
  #floating-contact-buttons {
    bottom: 20px;
    right: 10px;
    gap: 12px;
  }
  
  .floating-btn img {
    width: 44px;
    height: 44px;
  }
  
  .floating-tooltip {
    display: none !important;
  }
  
  .poster-image {
    animation: none !important;
  }
}

/* Note: Poster area styling is defined in SECTIONS & SPACING section above */

/* ============================================================================
   CAROUSEL WITH SCROLL - Categories
   ============================================================================ */



.category-card {
  position: relative;
  background: none;
  border-radius: 16px;
  height: 120px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25), 0 6px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  scroll-snap-align: center;
  margin: 0;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease-out;
}

.category-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover img {
  transform: scale(1.1);
}

.category-card .category-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.05rem;
  font-weight: bold;
  padding: 7px 0 5px 0;
  text-align: center;
  border-radius: 0 0 16px 16px;
  margin: 0;
  width: 100%;
  z-index: 2;
  transition: background 0.3s ease-out;
}

.category-card:hover .category-name {
  background: rgba(0, 0, 0, 0.75);
}

/* Mobile: 1 + peek */
@media (max-width: 600px) {
  .categories-grid {
    display: flex;
    padding: 0 15px 20px 15px;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .categories-grid::-webkit-scrollbar {
    display: none;
  }

  .category-card {
    width: clamp(260px, 85vw, 300px);
    min-width: clamp(260px, 85vw, 300px);
    height: clamp(110px, 30vw, 130px);
    animation: none !important;
    scroll-snap-align: center;
  }
}

/* Tablet & Desktop: Responsive Grid */
@media (min-width: 600px) {
  .categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(300px, 28vw, 360px), 1fr));
    padding: 0 15px 20px 15px;
    gap: clamp(12px, 2vw, 20px);
    justify-items: center;
  }

  .category-card {
    width: clamp(300px, 28vw, 360px);
    height: clamp(140px, 14vw, 180px);
  }
}

.properties-block {
  padding-top: 20px;
}

body {
  margin: 0;
  padding: 0;
}

.header-block {
  margin: 0 !important;
  padding: 0 !important;
}

/* Property Card - Base Styles */
.property-card {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.property-card img {
  width: 100%;
  aspect-ratio: 465 / 262;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.property-card .card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.property-card .card-title {
  text-align: right;
  color: #1a237e;
  font-weight: bold;
  font-size: 1rem;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-card .card-location {
  text-align: right;
  color: #607d8b;
  font-weight: normal;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.2;
}

.property-card .card-price {
  text-align: left;
  color: #0d3912;
  font-size: 1rem;
  font-weight: bold;
  margin: 0;
  background: rgba(13, 57, 18, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.property-card .card-attributes {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: #555;
  font-size: 0.85rem;
  margin-top: 10px;
  flex-wrap: wrap;
}

.property-card .attr-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  background: none;
  border-radius: 8px;
  padding: 2px 4px;
  margin: 0;
  width: auto;
}

.property-card .attr-chip img {
  width: 22px;
  height: 22px;
  display: block;
}

.property-card .attr-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #333;
  text-align: center;
  line-height: 1.2;
}

/* Property Card - Hover Effects (Desktop) */
.property-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.property-card:hover img {
  transform: scale(1.08);
}

.properties-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 600px) {
  .properties-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
}

@media (min-width: 1024px) {
  .properties-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 0;
  }
}

/* ============================================================================
   SKELETON LOADERS ANIMATION
   ============================================================================ */

.property-card.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e8e8e8 20%,
    #f0f0f0 40%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.property-card.skeleton .image-placeholder,
.property-card.skeleton .card-title-placeholder,
.property-card.skeleton .card-location-placeholder,
.property-card.skeleton .card-price-placeholder,
.property-card.skeleton .card-attributes-placeholder {
  background: #e0e0e0;
  border-radius: 8px;
}

.poster-skeleton,
.categories-skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e8e8e8 20%,
    #f0f0f0 40%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 8px;
  height: 200px;
}

.poster-skeleton {
  aspect-ratio: 3.2 / 1;
}

.categories-skeleton {
  height: 120px;
  margin: 10px;
}

/* منع تغيّر الألوان في الوضع الداكن */
html, body {
  color-scheme: light !important;
}

@media (prefers-color-scheme: dark) {
  html, body, #app, .property-card, .category-card {
    background-color: #fff !important;  /* خلفية بيضاء ثابتة */
    color: #000 !important;             /* نص أسود ثابت */
  }

  a, a:visited {
    color: #3949ab !important; /* لون ثابت للروابط */
  }

  /* أضف أي عناصر أخرى تريد تثبيت ألوانها هنا */
  
  img, video, svg, canvas {
    filter: none !important;
    background: none !important;
  }
}

/* ============================================================================
   RESPONSIVE HOVER ADJUSTMENTS
   ============================================================================ */

/* على الموبايل: تقليل الـ transform للـ performance */
@media (max-width: 600px) {
  body {
    overflow-x: hidden !important;
  }

  /* Images responsive on mobile */
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* Remove all hover transforms on mobile for smooth scrolling */
  .property-card:hover {
    transform: none;
    box-shadow: 0 2px 12px #0002;
  }
  
  .property-card:hover img {
    transform: none;
  }
  
  .category-card:hover {
    transform: none;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25), 0 6px 12px rgba(0, 0, 0, 0.15);
  }
  
  .category-card:hover img {
    transform: none;
  }
}

/* على الـ Tablet: hover effects متوسطة */
@media (min-width: 600px) and (max-width: 1024px) {
  .property-card:hover {
    transform: translateY(-8px);
  }
  
  .property-card:hover img {
    transform: scale(1.07);
  }
  
  .category-card:hover {
    transform: translateY(-7px) scale(1.03);
  }
  
  .category-card:hover img {
    transform: scale(1.09);
  }
}

/* على الـ Desktop: hover effects كاملة */
@media (min-width: 1024px) {
  .property-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  }
  
  .property-card:hover img {
    transform: scale(1.08);
  }
  
  .category-card:hover {
    transform: translateY(-8px) scale(1.04);
  }
  
  .category-card:hover img {
    transform: scale(1.12);
  }
}