/*
 * villaGo — Home Page Styles
 * Hero, categories, features, testimonials, stats bar.
 */

/* ── Hero ────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.4), rgba(0,0,0,0.7));
}

/* Decorative grid pattern (matches React Hero.tsx) */
.hero-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 var(--y-space-m);
  max-width: 1024px;
  margin-inline: auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--y-space-s);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--y-radius-full);
  padding: 8px var(--y-space-m);
  margin-block-end: var(--y-space-l);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--y-color-accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-badge span {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--y-font-s);
}

.hero h1 {
  color: white;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: var(--y-weight-bold);
  line-height: 1.3;
  margin-block-end: var(--y-space-m);
}

.hero h1 .accent {
  color: var(--y-color-accent);
}

.hero-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--y-font-l);
  line-height: 1.8;
  max-width: 640px;
  margin-inline: auto;
  margin-block-end: 40px;
}

/* ── Search Box ──────────────────────────────────── */
.hero-search {
  background: white;
  border-radius: var(--y-radius-l);
  padding: var(--y-space-m) var(--y-space-l);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  max-width: 1024px;
  margin-inline: auto;
}

.hero-search-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--y-space-m);
}

.hero-search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--y-color-secondary);
  border-radius: var(--y-radius-m);
  padding: 12px var(--y-space-m);
  border: 2px solid transparent;
  transition: border-color var(--y-transition-fast);
}

.hero-search-field.error {
  background: var(--y-color-danger-subtle);
  border-color: #f87171;
}

.hero-search-field label {
  display: block;
  font-size: 0.7rem;
  color: var(--y-color-text-muted);
  margin: 0;
  font-weight: var(--y-weight-regular);
}

.hero-search-field select,
.hero-search-field input {
  background: transparent;
  width: 100%;
  color: var(--y-color-text);
  font-size: var(--y-font-s);
  border: none;
  outline: none;
  font-family: inherit;
}

.hero-search-icon {
  color: var(--y-color-primary);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hero-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--y-space-s);
  background: var(--y-color-primary);
  color: white;
  border-radius: var(--y-radius-m);
  padding: 12px var(--y-space-l);
  transition: background var(--y-transition-fast);
  font-size: var(--y-font-l);
  min-height: 48px;
}

.hero-search-btn:hover {
  background: #14503A;
}

.hero-search-error {
  color: var(--y-color-danger);
  text-align: right;
  margin-block-start: 12px;
  font-size: var(--y-font-s);
}

/* ── Hero Stats ──────────────────────────────────── */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  column-gap: clamp(2rem, 6vw, 4rem);
  row-gap: var(--y-space-l);
  margin-block-start: 40px;
  width: 100%;
  max-width: 56rem;
  margin-inline: auto;
}

.hero-stats > div {
  text-align: center;
  padding-inline: clamp(0.5rem, 2vw, 1rem);
  flex: 0 1 auto;
  min-width: 4.75rem;
}

.hero-stat-number {
  color: var(--y-color-accent);
  font-size: 1.5rem;
  font-weight: var(--y-weight-bold);
}

.hero-stat-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--y-font-s);
}

/* ── Categories Grid ─────────────────────────────── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--y-space-l);
}

.category-card {
  position: relative;
  border-radius: var(--y-radius-l);
  overflow: hidden;
  height: 288px;
  cursor: pointer;
  display: block;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--y-transition-slow);
}

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

.category-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.2), transparent);
}

.category-info {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: 20px;
}

.category-info h3 {
  color: white;
  font-size: 1.2rem;
  font-weight: var(--y-weight-bold);
  margin-block-end: 4px;
}

.category-info p {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--y-font-s);
  margin-block-end: var(--y-space-s);
}

.category-count {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: white;
  border-radius: var(--y-radius-full);
  padding: 4px 12px;
  font-size: 0.75rem;
}

/* ── Features section (background like React Features.tsx) ───────── */
.features-section {
  position: relative;
  overflow: hidden;
}

.features-section-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.features-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
}

.features-blob--tl {
  width: 288px;
  height: 288px;
  top: 0;
  left: 0;
  background: color-mix(in srgb, var(--y-color-primary) 3%, transparent);
  transform: translate(-50%, -50%);
}

.features-blob--br {
  width: 384px;
  height: 384px;
  bottom: 0;
  right: 0;
  background: color-mix(in srgb, var(--y-color-accent) 4%, transparent);
  transform: translate(33%, 33%);
}

.features-geo-pattern {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 700px;
  height: 700px;
  margin: -350px 0 0 -350px;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='700' height='700' fill='none' viewBox='0 0 700 700'%3E%3Ccircle cx='350' cy='350' r='340' stroke='%231B6B4A' stroke-width='0.5'/%3E%3Ccircle cx='350' cy='350' r='300' stroke='%23C8A96E' stroke-width='0.5'/%3E%3Ccircle cx='350' cy='350' r='220' stroke='%23C8A96E' stroke-width='0.5'/%3E%3C/svg%3E");
  animation: features-geo-spin 80s linear infinite;
}

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

/* ── Features Grid ───────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--y-space-l);
}

.feature-card {
  position: relative;
  border-radius: 24px;
  padding: 28px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--y-color-border);
  transition: box-shadow var(--y-transition-normal), transform var(--y-transition-normal);
  opacity: 0;
  transform: translateY(28px);
  animation: feature-card-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.feature-card:nth-child(1) { animation-delay: 0s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.2s; }
.feature-card:nth-child(4) { animation-delay: 0.28s; }
.feature-card:nth-child(5) { animation-delay: 0.36s; }
.feature-card:nth-child(6) { animation-delay: 0.44s; }

@keyframes feature-card-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature-card:hover {
  box-shadow: var(--y-shadow-l);
}

.feature-card.highlighted {
  background: linear-gradient(135deg, var(--y-color-primary), #1a5f42, #14503A);
  border: none;
  color: white;
}

/* Physical left: keeps number opposite the RTL content start (avoids overlap with icon) */
.feature-number {
  position: absolute;
  top: 20px;
  left: 20px;
  right: auto;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(27, 107, 74, 0.12);
  pointer-events: none;
  z-index: 0;
}

.feature-card.highlighted .feature-number {
  color: rgba(255, 255, 255, 0.22);
}

.feature-icon {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  border-radius: var(--y-radius-l);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block-end: 20px;
  background: linear-gradient(135deg, var(--y-color-primary-subtle), var(--y-color-accent-subtle));
  transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.feature-card:hover .feature-icon {
  transform: translateY(-6px);
}

.feature-card.highlighted .feature-icon {
  background: rgba(255, 255, 255, 0.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.feature-icon svg {
  width: 32px;
  height: 32px;
  color: var(--y-color-primary);
}

.feature-card.highlighted .feature-icon svg {
  color: var(--y-color-accent);
}

.feature-card h3 {
  position: relative;
  z-index: 1;
  font-size: 1.15rem;
  font-weight: var(--y-weight-bold);
  margin-block-end: 12px;
}

.feature-card p {
  position: relative;
  z-index: 1;
  font-size: var(--y-font-m);
  line-height: 1.9;
  color: var(--y-color-text-muted);
}

.feature-card.highlighted p,
.feature-card.highlighted h3 {
  color: rgba(255, 255, 255, 0.85);
}

.feature-card.highlighted h3 {
  color: white;
}

.feature-card-accent-line {
  position: absolute;
  bottom: 0;
  right: 0;
  left: auto;
  height: 3px;
  width: 0;
  background: linear-gradient(to left, var(--y-color-primary), transparent);
  transition: width 0.5s ease-out;
  border-radius: 0 0 24px 0;
}

.feature-card.highlighted .feature-card-accent-line {
  background: linear-gradient(to left, var(--y-color-accent), transparent);
}

.feature-card:hover .feature-card-accent-line {
  width: 100%;
}

/* ── About home (من نحن — bridge) ───────────────── */
.about-home {
  padding-block: var(--y-space-xxl);
  background: var(--y-color-bg, #fdfbf7);
}

.about-home__grid {
  display: grid;
  gap: var(--y-space-xl);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .about-home__grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

/* RTL: نص يمين، صورة يسار — المحتوى أولاً في DOM */
.about-home__content {
  order: 1;
}

.about-home__media {
  order: 2;
}

.about-home__title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: var(--y-weight-bold, 700);
  margin-block-end: 16px;
  color: var(--y-color-text);
}

.about-home__text {
  font-size: var(--y-font-m, 1rem);
  line-height: 1.9;
  color: var(--y-color-text-muted);
}

.about-home__text p {
  margin-block: 0 0.85em;
}

.about-home__text p:last-child {
  margin-block-end: 0;
}

.about-home__img {
  width: 100%;
  height: auto;
  max-height: min(420px, 55vh);
  object-fit: cover;
  border-radius: var(--y-radius-l, 16px);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

/* ── Stats Bar ───────────────────────────────────── */
.stats-bar {
  margin-block-start: var(--y-space-xxl);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, var(--y-color-primary), #1a5f42, #14503A);
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  animation: stats-bar-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

@keyframes stats-bar-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stats-bar-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 1) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 1) 1px, transparent 1px, transparent 20px);
  background-size: 40px 40px, 40px 40px;
  animation: stats-pattern-drift 12s linear infinite;
}

@keyframes stats-pattern-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 40px 40px, 40px 40px; }
}

.stats-bar-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(32px);
}

.stats-bar-orb--tr {
  width: 160px;
  height: 160px;
  top: 0;
  right: 40px;
  background: color-mix(in srgb, var(--y-color-accent) 12%, transparent);
  animation: stats-orb-float-a 6s ease-in-out infinite;
}

.stats-bar-orb--bl {
  width: 128px;
  height: 128px;
  bottom: 0;
  left: 80px;
  background: rgba(255, 255, 255, 0.08);
  animation: stats-orb-float-b 5s ease-in-out infinite;
}

@keyframes stats-orb-float-a {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(24px, -12px); }
}

@keyframes stats-orb-float-b {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-16px, 10px); }
}

.stats-bar-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: clamp(1.5rem, 4vw, 3rem);
  row-gap: var(--y-space-xl);
  padding: 40px clamp(24px, 5vw, 48px);
  text-align: center;
}

.stats-bar-value {
  color: var(--y-color-accent);
  font-size: 2rem;
  font-weight: var(--y-weight-bold);
  animation: stats-value-pop 0.6s ease-out 0.9s both;
}

.stats-bar-grid > div:nth-child(1) .stats-bar-value { animation-delay: 0.95s; }
.stats-bar-grid > div:nth-child(2) .stats-bar-value { animation-delay: 1.05s; }
.stats-bar-grid > div:nth-child(3) .stats-bar-value { animation-delay: 1.15s; }
.stats-bar-grid > div:nth-child(4) .stats-bar-value { animation-delay: 1.25s; }

@keyframes stats-value-pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.stats-bar-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--y-font-s);
  margin-block-start: 4px;
}

/* ── Testimonials ────────────────────────────────── */
.testimonials {
  padding: 80px var(--y-space-m);
  background: var(--y-color-primary);
  position: relative;
  overflow: hidden;
}

.testimonials-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 1) 1px, transparent 1px, transparent 18px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, 1) 1px, transparent 1px, transparent 18px);
  background-size: 36px 36px, 36px 36px;
  animation: testimonials-pattern-drift 14s linear infinite;
}

@keyframes testimonials-pattern-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 36px 36px, 36px 36px; }
}

.testimonials-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
}

.testimonials-orb--one {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -40px;
  background: color-mix(in srgb, var(--y-color-accent) 15%, transparent);
  animation: stats-orb-float-a 8s ease-in-out infinite;
}

.testimonials-orb--two {
  width: 200px;
  height: 200px;
  bottom: -60px;
  left: 10%;
  background: rgba(255, 255, 255, 0.06);
  animation: stats-orb-float-b 7s ease-in-out infinite;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--y-space-l);
}

.testimonial-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--y-radius-l);
  padding: var(--y-space-l);
}

.testimonial-quote {
  width: 32px;
  height: 32px;
  color: var(--y-color-accent);
  margin-block-end: var(--y-space-m);
}

.testimonial-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--y-font-m);
  line-height: 1.9;
  margin-block-end: var(--y-space-l);
}

.testimonial-stars {
  display: flex;
  gap: 4px;
  margin-block-end: var(--y-space-m);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.1);
  padding-block-start: var(--y-space-m);
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--y-color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--y-weight-bold);
}

.testimonial-name {
  color: white;
  font-size: var(--y-font-m);
  font-weight: var(--y-weight-semibold);
}

.testimonial-location {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

/* ── Keyframes ───────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .feature-card,
  .stats-bar,
  .stats-bar-value,
  .stats-bar-pattern,
  .testimonials-pattern,
  .features-geo-pattern,
  .stats-bar-orb,
  .testimonials-orb {
    animation: none !important;
  }

  .feature-card {
    opacity: 1;
    transform: none;
  }

  .stats-bar {
    opacity: 1;
    transform: none;
  }

  .stats-bar-value {
    opacity: 1;
    transform: none;
  }

  .feature-card:hover .feature-icon {
    transform: none;
  }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE STYLES
   ══════════════════════════════════════════════════ */

/* ── Large Desktop (lg) ──────────────────────────── */
@media (max-width: 1200px) {
  .hero-search-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-search-btn  { grid-column: span 1; }
  .categories-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet (md) ─────────────────────────────────── */
@media (max-width: 992px) {
  .hero { min-height: 80vh; }
  .hero-search-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-search-btn  { grid-column: span 2; }
  .features-grid    { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
}

/* ── Mobile Landscape / Large Phone (sm) ───────────
   يطابق villaGo/html-export: إحصائيات البطل والشريط عمودان (٢×٢) لا ثلاثة + واحد */
@media (max-width: 768px) {
  .hero { min-height: 70vh; }
  .hero-search { padding: var(--y-space-m); }
  .hero-search-grid { grid-template-columns: 1fr; }
  .hero-search-btn  { grid-column: span 1; }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--y-space-l) var(--y-space-xl);
    justify-items: center;
  }
  .hero-stats > div {
    min-width: 0;
    width: 100%;
    max-width: 12rem;
  }
  .categories-grid  { grid-template-columns: 1fr 1fr; gap: var(--y-space-m); }
  .features-grid    { grid-template-columns: 1fr; }
  .stats-bar-grid   { grid-template-columns: repeat(2, 1fr); }
}

/* ── Small Phone (xs) ────────────────────────────── */
@media (max-width: 480px) {
  .hero-stats {
    gap: var(--y-space-m) var(--y-space-l);
  }
  .hero h1     { font-size: 1.5rem; }
  .hero-desc   { font-size: var(--y-font-m); }
  .categories-grid { grid-template-columns: 1fr; }
  .stats-bar-grid  { column-gap: var(--y-space-l); row-gap: var(--y-space-xl); padding: var(--y-space-l); }
}
