* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #0f172a;
}

.about-title {
  font-size: 3rem;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 40px;
  background-color: #1D1D1F;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.carousel-container {
  width: 100%;
  max-width: 1200px;
  height: 500px;
  margin: 0 auto;
  position: relative;
  perspective: 2000px;
}

.carousel-track {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.card {
  position: absolute;
  width: 280px;
  height: 400px;
  background: #1e293b;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: all 0.8s cubic-bezier(0.68, -0.6, 0.32, 1.6);
  cursor: pointer;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
}

/* متن روی کارت */
.card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 200px;
  padding: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  will-change: transform, opacity;
  -webkit-transform: translateZ(0);
}

.card-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(15, 23, 42, 0.7) 80%,
    transparent 100%
  );
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.4s ease;
  z-index: 0;
}

.card-text {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
  text-align: justify;
  text-justify: inter-word;
}

.card:hover .card-content::before {
  opacity: 1;
  transform: translateY(0);
}

.card:hover .card-text {
  opacity: 1;
  transform: translateY(0);
}


/* Carousel positions */
.card.center {
  z-index: 10;
  transform: scale(1.15) translateZ(0);
}
.card.left-1 {
  transform: translateX(-200px) scale(0.95) rotateY(8deg);
  opacity: 0.8;
}
.card.right-1 {
  transform: translateX(200px) scale(0.95) rotateY(-8deg);
  opacity: 0.8;
}
.card.left-2 {
  transform: translateX(-400px) scale(0.8) rotateY(15deg);
  opacity: 0.6;
}
.card.right-2 {
  transform: translateX(400px) scale(0.8) rotateY(-15deg);
  opacity: 0.6;
}
.card.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Dots */
.dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(203, 213, 225, 0.3);
  cursor: pointer;
}
.dot.active {
  background-color: #0071E3;
  transform: scale(1.3);
}

/* Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: #0071E3;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  border: none;
  z-index: 1000;
}
.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

.nav-arrow:hover {
  background-color: #4998e7;
}

/* تغییرات جدید برای نسخه موبایل */
@media only screen and (max-width: 768px) {
  .carousel-container {
    height: 420px; /* کاهش ارتفاع کانتینر */
    overflow: hidden; /* جلوگیری از سرریز */
    perspective: 1000px; /* کاهش perspective */
  }

  .card {
    width: 85%; /* عرض نسبی */
    max-width: 300px; /* حداکثر عرض */
    height: 380px; /* کاهش ارتفاع کارت */
  }

  /* مخفی کردن تمام کارت‌ها به جز مرکزی */
  .card:not(.center) {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateX(0) scale(0.8) !important;
  }

  .card.center {
    transform: scale(1) !important; /* تنظیم مجدد اندازه کارت مرکزی */
  }

  /* تنظیم مجدد موقعیت‌ها برای موبایل */
  .card.left-1,
  .card.right-1,
  .card.left-2,
  .card.right-2 {
    transform: translateX(0) scale(0.8) !important;
  }

  .about-title {
    font-size: 2.2rem; /* کاهش سایز عنوان */
    margin-bottom: 30px;
  }

  .dots {
    margin-top: 30px; /* کاهش فاصله دات‌ها */
  }
}

/* بهینه‌سازی برای صفحه‌های بسیار کوچک */
@media only screen and (max-width: 480px) {
  .carousel-container {
    height: 380px;
  }
  
  .card {
    height: 340px;
  }
  
  .about-title {
    font-size: 1.8rem;
  }
}