@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap');

:root {
  --card-height: 380px;
  --card-width: 270px;
}

* {
  font-family: 'Vazirmatn', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: white;
  touch-action: manipulation;
}

/* پس‌زمینه شب پر ستاره با پارالاکس */
.night-sky {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: linear-gradient(125deg, #050510 0%, #0a0829 40%, #150f35 70%, #040215 100%);
  overflow: hidden;
}

/* لایه ستاره‌ها با سایزهای مختلف */
.stars, .stars2, .stars3 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stars {
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iNSIgY3k9IjUiIHI9IjAuNSIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==');
  background-repeat: repeat;
  background-size: 150px 150px;
  animation: twinkle 2s ease-in-out infinite alternate, parallax 150s linear infinite;
}

.stars2 {
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iNSIgY3k9IjUiIHI9IjAuMjUiIGZpbGw9IiNmZmYiLz48L3N2Zz4=');
  background-repeat: repeat;
  background-size: 100px 100px;
  animation: twinkle 4s ease-in-out infinite alternate, parallax 180s linear infinite reverse;
}

.stars3 {
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iNSIgY3k9IjUiIHI9IjAuNCIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==');
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: twinkle 3s ease-in-out infinite alternate, parallax 210s linear infinite;
}

/* آسمان پشت‌زمینه جایگزین برای ستاره‌های بیشتر */
.stars::before,
.stars2::before,
.stars3::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  background-repeat: repeat;
  opacity: 0.5;
}

/* انیمیشن چشمک زدن ستاره‌ها */
@keyframes twinkle {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 0.9;
  }
}

/* انیمیشن پارالاکس ستاره‌ها - حرکت بیشتر و نرم‌تر */
@keyframes parallax {
  0% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(50px) translateY(25px);
  }
  50% {
    transform: translateX(100px) translateY(0px);
  }
  75% {
    transform: translateX(50px) translateY(-25px);
  }
  100% {
    transform: translateX(0px) translateY(0px);
  }
}

/* ستاره دنباله‌دار */
.shooting-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shooting-stars::before, .shooting-stars::after,
.shooting-stars span:nth-child(1), 
.shooting-stars span:nth-child(2),
.shooting-stars span:nth-child(3) {
  content: "";
  position: absolute;
  width: 100px;
  height: 1px;
  background: linear-gradient(to right, transparent, white, transparent);
  border-radius: 50%;
  animation-duration: 6s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

.shooting-stars::before {
  top: 20%;
  left: -100px;
  animation-name: shooting-star-1;
}

.shooting-stars::after {
  top: 60%;
  left: -100px;
  animation-name: shooting-star-2;
  animation-delay: 3s;
}

.shooting-stars span:nth-child(1) {
  top: 30%;
  left: -100px;
  animation-name: shooting-star-3;
  animation-delay: 1.5s;
}

.shooting-stars span:nth-child(2) {
  top: 75%;
  left: -100px;
  animation-name: shooting-star-4;
  animation-delay: 4.5s;
}

.shooting-stars span:nth-child(3) {
  top: 45%;
  left: -100px;
  animation-name: shooting-star-5;
  animation-delay: 7s;
}

@keyframes shooting-star-1 {
  0% {
    transform: translateX(0) translateY(0) rotate(30deg);
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  10% {
    transform: translateX(calc(100vw + 200px)) translateY(100px) rotate(30deg);
    opacity: 0;
  }
  100% {
    transform: translateX(calc(100vw + 200px)) translateY(100px) rotate(30deg);
    opacity: 0;
  }
}

@keyframes shooting-star-2 {
  0% {
    transform: translateX(0) translateY(0) rotate(-15deg);
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  10% {
    transform: translateX(calc(100vw + 200px)) translateY(-50px) rotate(-15deg);
    opacity: 0;
  }
  100% {
    transform: translateX(calc(100vw + 200px)) translateY(-50px) rotate(-15deg);
    opacity: 0;
  }
}

@keyframes shooting-star-3 {
  0% {
    transform: translateX(0) translateY(0) rotate(10deg);
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  10% {
    transform: translateX(calc(100vw + 200px)) translateY(20px) rotate(10deg);
    opacity: 0;
  }
  100% {
    transform: translateX(calc(100vw + 200px)) translateY(20px) rotate(10deg);
    opacity: 0;
  }
}

@keyframes shooting-star-4 {
  0% {
    transform: translateX(0) translateY(0) rotate(-25deg);
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  10% {
    transform: translateX(calc(100vw + 200px)) translateY(-70px) rotate(-25deg);
    opacity: 0;
  }
  100% {
    transform: translateX(calc(100vw + 200px)) translateY(-70px) rotate(-25deg);
    opacity: 0;
  }
}

@keyframes shooting-star-5 {
  0% {
    transform: translateX(0) translateY(0) rotate(5deg);
    opacity: 0;
  }
  1% {
    opacity: 1;
  }
  10% {
    transform: translateX(calc(100vw + 200px)) translateY(10px) rotate(5deg);
    opacity: 0;
  }
  100% {
    transform: translateX(calc(100vw + 200px)) translateY(10px) rotate(5deg);
    opacity: 0;
  }
}

/* سیارات در پس‌زمینه */
.planets {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.planet {
  position: absolute;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.planet-1 {
  top: 20%;
  right: 10%;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle at 30% 30%, #db6c17, #341d0b);
  animation: planet-glow 8s ease-in-out infinite alternate;
}

.planet-2 {
  top: 70%;
  left: 5%;
  width: 25px;
  height: 25px;
  background: radial-gradient(circle at 30% 30%, #1c94d8, #173754);
  animation: planet-glow 5s ease-in-out infinite alternate;
}

.planet-3 {
  top: 30%;
  left: 20%;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at 40% 40%, #e1c264, #734e0b);
  animation: planet-spin 60s linear infinite, planet-glow 10s ease-in-out infinite alternate;
}

.planet-3::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 8px;
  background: rgba(228, 199, 121, 0.4);
  transform: translate(-50%, -50%) rotate(30deg);
  border-radius: 50%;
}

@keyframes planet-glow {
  0% {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 30px rgba(255, 255, 255, 0.2);
  }
}

@keyframes planet-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ابرهای کم‌نور در آسمان شب */
.clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNTAgODBjMC0xMS4wNDYgOC45NTQtMjAgMjAtMjBzMjAgOC45NTQgMjAgMjBINTB6bTQwIDBjMC0xMS4wNDYgOC45NTQtMjAgMjAtMjBzMjAgOC45NTQgMjAgMjBoLTQwem00MCAwYzAtMTEuMDQ2IDguOTU0LTIwIDIwLTIwczIwIDguOTU0IDIwIDIwaC00MHptNDAgMGMwLTExLjA0NiA4Ljk1NC0yMCAyMC0yMHMyMCA4Ljk1NCAyMCAyMGgtNDB6IiBmaWxsPSJyZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMDUpIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=');
  background-repeat: repeat-x;
  background-size: 500px 200px;
  opacity: 0.3;
  animation: clouds-move 250s linear infinite;
}

/* اضافه کردن ستارگان بیشتر در پس‌زمینه */
.night-sky::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 300px 300px, 200px 200px, 250px 250px, 180px 180px, 220px 220px;
  animation: stars-twinkle 6s ease-in-out infinite alternate;
  opacity: 0.5;
  pointer-events: none;
}

@keyframes stars-twinkle {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 0.5;
  }
}

@keyframes clouds-move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -2000px 0;
  }
}

/* افکت درخشش عنوان صفحه */
.starlight {
  position: relative;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5),
               0 0 10px rgba(255, 255, 255, 0.3),
               0 0 15px rgba(65, 120, 255, 0.5),
               0 0 20px rgba(65, 120, 255, 0.3);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  0% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5),
                 0 0 10px rgba(255, 255, 255, 0.3),
                 0 0 15px rgba(65, 120, 255, 0.5),
                 0 0 20px rgba(65, 120, 255, 0.3);
  }
  100% {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7),
                 0 0 15px rgba(255, 255, 255, 0.5),
                 0 0 20px rgba(65, 120, 255, 0.7),
                 0 0 25px rgba(65, 120, 255, 0.5);
  }
}

/* تنظیم z-index برای تمام محتوای اصلی */
.container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5px;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-width), 1fr));
  gap: 20px;
  padding: 10px;
  justify-items: center;
}

.card {
  width: var(--card-width);
  height: var(--card-height);
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  cursor: pointer;
  margin-bottom: 2rem;
  will-change: transform;
  transition: all 0.3s ease;
  max-width: 100%;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(120, 0, 255, 0.3);
  border-radius: 1rem;
  will-change: transform;
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  will-change: transform;
}

.card-front {
  background-color: #111;
  transform: rotateY(0deg);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.card-front::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
  z-index: 1;
}

.card-front img {
  transition: transform 0.5s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card:hover .card-front img {
  transform: scale(1.05);
}

/* راهنمای روی کارت در موبایل */
.card-hint {
  position: absolute;
  bottom: 1rem;
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  font-size: 0.9rem;
  padding: 0.5rem;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 2rem;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.card:hover .card-hint,
.card.active-mobile .card-hint {
  opacity: 0;
  transform: translateY(0);
}

.card-back {
  background-color: transparent;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-size: cover;
  background-position: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.card-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
              var(--card-back-color, rgba(76, 29, 149, 0.6)) 0%, 
              var(--card-back-color, rgba(76, 29, 149, 0.8)) 40%, 
              var(--card-back-color, rgba(76, 29, 149, 0.7)) 100%);
  z-index: -1;
}

.card-back::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  z-index: -1;
  opacity: 0.7;
  animation: glow-move 10s infinite alternate ease-in-out;
}

@keyframes glow-move {
  0% {
    transform: translate(-10%, -10%);
  }
  100% {
    transform: translate(10%, 10%);
  }
}

.card-back h3 {
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  font-size: 1.4rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  font-weight: 600;
  letter-spacing: 1px;
}

.card-back h3::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.7);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: right;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.card-back p {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 150px;
  overflow-y: auto;
}

.card:hover .card-back h3::after,
.card.active-mobile .card-back h3::after {
  transform: scaleX(1);
  transform-origin: left;
  transition-delay: 0.3s;
}

/* تنظیم رنگ‌های پس زمینه پشت کارت‌ها */
.card[data-color="purple"] .card-back {
  --card-back-color: rgba(88, 28, 135, 0.75);
}

.card[data-color="blue"] .card-back {
  --card-back-color: rgba(30, 58, 138, 0.75);
}

.card[data-color="green"] .card-back {
  --card-back-color: rgba(6, 78, 59, 0.75);
}

.card[data-color="red"] .card-back {
  --card-back-color: rgba(127, 29, 29, 0.75);
}

.card[data-color="yellow"] .card-back {
  --card-back-color: rgba(120, 53, 15, 0.75);
}

.card[data-color="indigo"] .card-back {
  --card-back-color: rgba(67, 56, 202, 0.75);
}

.card[data-color="pink"] .card-back {
  --card-back-color: rgba(157, 23, 77, 0.75);
}

/* شناور بودن کارت ها */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

.card {
  animation: float 5s ease-in-out infinite;
}

.card:nth-child(2) {
  animation-delay: 0.5s;
}

.card:nth-child(3) {
  animation-delay: 1s;
}

.card:nth-child(4) {
  animation-delay: 1.5s;
}

.card:nth-child(5) {
  animation-delay: 2s;
}

.card:nth-child(6) {
  animation-delay: 2.5s;
}

.card:nth-child(7) {
  animation-delay: 3s;
}

/* افکت درخشش روی کارت ها */
.card-front::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shine 6s infinite;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover .card-front::before {
  opacity: 1;
}

@keyframes shine {
  0% {
    transform: rotate(30deg) translate(-200%, -100%);
  }
  100% {
    transform: rotate(30deg) translate(200%, 100%);
  }
}

/* نوار راهنما برای موبایل */
.mobile-tip {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  text-align: center;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  animation: tipFadeIn 0.5s ease-in-out forwards, tipFloat 3s ease-in-out infinite;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes tipFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes tipFloat {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -5px);
  }
}

/* نمایش افکت swipe در موبایل */
.swipe-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  display: none;
  pointer-events: none;
  z-index: 5;
}

.swipe-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 40%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.8);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* تنظیم رفتار نمایش کارت‌ها */
.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(120, 0, 255, 0.3);
  border-radius: 1rem;
  will-change: transform;
}

/* غیرفعال کردن اثر hover برای چرخش کارت و استفاده فقط از کلیک */
.card:hover .card-inner {
  transform: none;
}

/* کلاس فعال‌سازی برای هر دو حالت موبایل و دسکتاپ */
.card.active-mobile .card-inner {
  transform: rotateY(180deg) !important;
}

/* اطمینان از نمایش درست محتوای پشت کارت */
.card.active-mobile .card-front {
  z-index: 1;
}

.card.active-mobile .card-back {
  z-index: 2;
}

.card.active-mobile {
  z-index: 10;
}

/* تنظیمات گرادیان برای دکمه‌ها */
.bg-purple-600 {
  background-image: linear-gradient(to right, #7928CA, #FF0080);
  background-size: 200% auto;
  transition: 0.5s;
}

.bg-blue-600 {
  background-image: linear-gradient(to right, #1E3B70, #29ABE2);
  background-size: 200% auto;
  transition: 0.5s;
}

.bg-green-600 {
  background-image: linear-gradient(to right, #0BA360, #3CBA92);
  background-size: 200% auto;
  transition: 0.5s;
}

.bg-red-600 {
  background-image: linear-gradient(to right, #FF512F, #DD2476);
  background-size: 200% auto;
  transition: 0.5s;
}

.bg-yellow-600 {
  background-image: linear-gradient(to right, #F09819, #EDDE5D);
  background-size: 200% auto;
  transition: 0.5s;
}

.bg-indigo-600 {
  background-image: linear-gradient(to right, #3A1C71, #D76D77);
  background-size: 200% auto;
  transition: 0.5s;
}

.bg-pink-600 {
  background-image: linear-gradient(to right, #FF0084, #33001B);
  background-size: 200% auto;
  transition: 0.5s;
}

/* افکت هاور برای دکمه‌ها */
.card-back button:hover {
  background-position: right center;
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* تنظیمات پاسخگویی و بهینه‌سازی برای موبایل */
@media (max-width: 768px) {
  :root {
    --card-width: 100%;
  }

  .container {
    padding: 0 5px;
  }

  h1 {
    font-size: 1.75rem !important;
    margin-bottom: 1.5rem !important;
  }

  .card-back h3 {
    font-size: 1.25rem !important;
  }

  .card-back p {
    font-size: 0.9rem;
  }
  
  .card-back {
    padding: 0.75rem;
  }
  
  /* فعال کردن اسکرول نرم در موبایل */
  .container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  /* افزایش اندازه دکمه‌ها برای تاچ */
  .card-back button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem !important;
  }
  
  /* تنظیم اندازه فاصله‌ها برای کارت‌ها در موبایل */
  .gap-8 {
    gap: 1rem !important;
  }
  
  /* کم کردن سرعت انیمیشن float برای بهبود کارایی */
  .card {
    animation-duration: 8s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* نمایش راهنمای موبایل */
  .card-hint {
    opacity: 1;
    transform: translateY(0);
    font-size: 0.8rem;
    padding: 0.4rem;
  }
  
  /* نمایش نوار راهنما در موبایل */
  .mobile-tip {
    display: block;
  }
  
  /* اصلاح سایز فونت‌ها در موبایل */
  .mobile-tip {
    font-size: 0.8rem;
    max-width: 90vw;
    white-space: normal;
    padding: 0.6rem 1rem;
  }
  
  /* اصلاح رفتار نمایش کارت‌ها در موبایل */
  .card-inner {
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
  }
  
  /* اطمینان از عدم اسکرول صفحه هنگام چرخش کارت‌ها */
  .card-container {
    perspective: 1500px;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 5px;
  }
  
  .card-title {
    font-size: 16px;
  }
  
  .card-description {
    font-size: 13px;
  }
  
  .card-back-content {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  :root {
    --card-height: 350px;
  }
  
  h1 {
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
  }
  
  .card-back h3 {
    font-size: 1.1rem !important;
  }
  
  /* بهبود نمایش تک ستونی برای موبایل‌های کوچک */
  .card {
    margin-bottom: 1.5rem;
  }
  
  /* اضافه کردن اسکرول نرم برای موبایل‌های کوچک */
  .container {
    overflow-y: auto;
    padding-bottom: 2rem;
  }
  
  /* تنظیم دکمه‌ها برای موبایل‌های کوچک */
  .card-back button {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem !important;
  }
  
  /* کوچک‌تر کردن راهنمای موبایل */
  .mobile-tip {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    bottom: 10px;
  }
  
  /* تنظیم اندازه راهنمای روی کارت */
  .card-hint {
    font-size: 0.7rem;
    padding: 0.3rem;
    bottom: 0.5rem;
  }
}

/* افکت بازخورد لمسی برای موبایل */
@media (hover: none) {
  .card:active {
    transform: scale(0.98);
  }
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

@media (min-width: 1200px) {
  .card-container {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  :root {
    --card-height: 350px;
    --card-width: 240px;
  }
  
  .card-container {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
  }
  
  .card-back h3 {
    font-size: 1.3rem;
  }
  
  .card-back p {
    font-size: 0.95rem;
  }
}

.card:active {
  transform: scale(0.98);
}

@media (min-width: 300px) and (max-width: 768px) {
  .card-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .card {
    height: auto;
    aspect-ratio: 2/3;
    width: 100%;
    max-height: unset;
  }
  
  .card-inner, .card-front, .card-back {
    height: 100%;
  }
}

@media (max-width: 300px) {
  .card-container {
    grid-template-columns: 1fr;
  }
  
  .card {
    aspect-ratio: 3/4;
    margin-bottom: 15px;
  }
}

.card-back button {
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.5s ease;
  transition-delay: 0s;
  background-size: 200% auto;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  letter-spacing: 0.5px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
  z-index: 5;
}

.card-back button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
  transform: translateX(-100%);
  animation: button-shine 8s infinite;
  z-index: -1;
}

@keyframes button-shine {
  0% {
    transform: translateX(-100%);
  }
  20%, 100% {
    transform: translateX(100%);
  }
}

.card:hover .card-back button,
.card.active-mobile .card-back button {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.7s;
}

@media (max-width: 768px) {
  .card-back {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
  }
  
  .card-back p {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    max-height: 120px;
  }
  
  .card-back h3 {
    font-size: 1.2rem !important;
    margin-bottom: 0.8rem;
  }
} 