/* 
   🎪 تصميم Testimonials 3D - منصة مُلقّن 
   نسخة محسنة مع accessibility وأداء أفضل
*/

/* ═══════════════════════════════════════════ */
/*           TESTIMONIALS CONTAINER            */
/* ═══════════════════════════════════════════ */

.testimonials-3d-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: relative;
  min-height: 370px;
  padding: 2rem 1rem;
}

.testimonials-3d-stack {
  position: relative;
  width: 420px;
  height: 320px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════ */
/*              3D CARDS STYLES                */
/* ═══════════════════════════════════════════ */

.testimonial-3d-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0.7;
  z-index: 1;
  
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  border-radius: 1.7rem;
  box-shadow: 
    0 8px 32px rgba(191, 167, 106, 0.2),
    0 0 0 2.5px rgba(191, 167, 106, 0.2);
  border: 2px solid rgba(191, 167, 106, 0.27);
  
  min-width: 320px;
  max-width: 420px;
  width: 100%;
  padding: 2.7rem 2rem 2.2rem 2rem;
  
  text-align: center;
  color: var(--text-light);
  
  transition: all 0.7s cubic-bezier(0.39, 0.575, 0.56, 1);
  will-change: transform, opacity, z-index;
  
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  
  filter: blur(1.5px) grayscale(0.2) brightness(0.95);
  pointer-events: none;
  
  /* Accessibility */
  outline: none;
  border-radius: 1.7rem;
}

/* Card Focus State */
.testimonial-3d-card:focus-visible {
  outline: 3px solid var(--primary-gold);
  outline-offset: 4px;
}

/* Active Card */
.testimonial-3d-card.active {
  transform: translate(-50%, -50%) scale(1.08) rotateY(-2deg) translateY(-10px);
  opacity: 1;
  z-index: 3;
  
  box-shadow: 
    0 16px 48px rgba(255, 215, 0, 0.33),
    0 0 0 3.5px rgba(255, 215, 0, 0.6);
  
  filter: none;
  pointer-events: auto;
  
  border-color: rgba(255, 215, 0, 0.5);
}

/* Left Card */
.testimonial-3d-card.left {
  transform: translate(-90%, -50%) scale(0.85) rotateY(18deg) translateY(18px);
  opacity: 0.5;
  z-index: 2;
}

/* Right Card */
.testimonial-3d-card.right {
  transform: translate(-10%, -50%) scale(0.85) rotateY(-18deg) translateY(18px);
  opacity: 0.5;
  z-index: 2;
}

/* ═══════════════════════════════════════════ */
/*              CARD CONTENT                   */
/* ═══════════════════════════════════════════ */

.testimonial-quote-bg {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  opacity: 0.13;
  z-index: 0;
  pointer-events: none;
}

.testimonial-3d-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.testimonial-3d-name,
.testimonial-3d-text {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.testimonial-3d-card.active .testimonial-3d-name,
.testimonial-3d-card.active .testimonial-3d-text {
  display: block;
}

.testimonial-3d-name {
  color: var(--primary-gold);
  font-weight: bold;
  margin-bottom: 0.7rem;
  font-size: 1.13rem;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.testimonial-3d-text {
  font-size: 1.13rem;
  color: var(--text-light);
  font-weight: 500;
  line-height: 1.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Text Animation */
@keyframes fadeInText {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.testimonial-3d-card.active .testimonial-3d-text {
  animation: fadeInText 1.1s cubic-bezier(0.39, 0.575, 0.56, 1);
}

/* ═══════════════════════════════════════════ */
/*             NAVIGATION ARROWS               */
/* ═══════════════════════════════════════════ */

.testimonial-arrow {
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  
  transition: 
    filter 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
  
  box-shadow: 0 4px 24px rgba(255, 215, 0, 0.2);
  filter: drop-shadow(0 2px 12px rgba(255, 215, 0, 0.33));
  
  padding: 0;
  
  /* Accessibility */
  border-radius: 50%;
}

.testimonial-arrow:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 4px;
}

.testimonial-arrow svg {
  display: block;
  border-radius: 50%;
  background: radial-gradient(
    circle at 60% 40%,
    rgba(255, 255, 255, 0.13) 0%,
    rgba(255, 215, 0, 0.067) 100%
  );
  box-shadow: 0 2px 12px rgba(255, 215, 0, 0.2);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.testimonial-arrow.left {
  left: 0;
  right: auto;
}

.testimonial-arrow.right {
  right: 0;
  left: auto;
}

/* Arrow Hover Effects */
.testimonial-arrow:hover svg,
.testimonial-arrow:focus svg {
  background: radial-gradient(
    circle at 60% 40%,
    var(--primary-gold) 0%,
    rgba(191, 167, 106, 1) 100%
  );
  box-shadow: 0 0 32px rgba(255, 215, 0, 0.53);
}

.testimonial-arrow:hover,
.testimonial-arrow:focus {
  transform: scale(1.13) translateY(-50%);
  filter: drop-shadow(0 4px 24px rgba(255, 215, 0, 0.6));
}

/* Active/Press State */
.testimonial-arrow:active {
  transform: scale(1.05) translateY(-50%);
}

/* ═══════════════════════════════════════════ */
/*            RESPONSIVE DESIGN                */
/* ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  .testimonials-3d-container {
    min-height: 350px;
  }
  
  .testimonials-3d-stack {
    width: 380px;
  }
  
  .testimonial-3d-card {
    min-width: 300px;
    padding: 2.2rem 1.8rem;
  }
  
  .testimonial-arrow.left {
    left: 10px;
  }
  
  .testimonial-arrow.right {
    right: 10px;
  }
}

@media (max-width: 600px) {
  .testimonials-3d-container {
    min-height: 320px;
    padding: 1rem 0.5rem;
  }
  
  .testimonials-3d-stack {
    width: 95vw;
    min-width: 0;
    height: 280px;
  }
  
  .testimonial-3d-card {
    min-width: 0;
    max-width: 95vw;
    padding: 1.5rem 1rem;
  }
  
  .testimonial-3d-name {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .testimonial-3d-text {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .testimonial-arrow {
    width: 38px;
    height: 38px;
  }
  
  .testimonial-arrow.left {
    left: 5px;
  }
  
  .testimonial-arrow.right {
    right: 5px;
  }
}

@media (max-width: 480px) {
  .testimonials-3d-container {
    min-height: 300px;
  }
  
  .testimonials-3d-stack {
    height: 260px;
  }
  
  .testimonial-3d-card {
    padding: 1.2rem 0.8rem;
  }
  
  .testimonial-3d-name {
    font-size: 0.95rem;
  }
  
  .testimonial-3d-text {
    font-size: 0.95rem;
  }
  
  .testimonial-arrow {
    width: 34px;
    height: 34px;
  }
}

/* ═══════════════════════════════════════════ */
/*           ACCESSIBILITY IMPROVEMENTS         */
/* ═══════════════════════════════════════════ */

/* Screen Reader Only Class */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .testimonial-3d-card {
    border: 3px solid var(--primary-gold);
    background: rgba(0, 0, 0, 0.8);
  }
  
  .testimonial-3d-card.active {
    background: rgba(0, 0, 0, 0.9);
    border-color: #ffffff;
  }
  
  .testimonial-arrow {
    border: 2px solid var(--primary-gold);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .testimonial-3d-card,
  .testimonial-arrow,
  .testimonial-3d-name,
  .testimonial-3d-text {
    transition: none;
    animation: none;
  }
  
  .testimonial-3d-card.active .testimonial-3d-text {
    animation: none;
  }
  
  .testimonial-3d-card.active {
    transform: translate(-50%, -50%) scale(1);
  }
  
  .testimonial-3d-card.left {
    transform: translate(-70%, -50%) scale(0.9);
  }
  
  .testimonial-3d-card.right {
    transform: translate(-30%, -50%) scale(0.9);
  }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
  .testimonial-3d-card {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(191, 167, 106, 0.3);
  }
  
  .testimonial-3d-card.active {
    background: rgba(255, 255, 255, 0.15);
  }
}

/* Print Styles */
@media print {
  .testimonials-3d-container {
    display: block;
    min-height: auto;
  }
  
  .testimonial-3d-card {
    position: static;
    transform: none;
    opacity: 1;
    display: block;
    margin-bottom: 1rem;
    break-inside: avoid;
  }
  
  .testimonial-3d-name,
  .testimonial-3d-text {
    display: block;
    opacity: 1;
    transform: none;
  }
  
  .testimonial-arrow {
    display: none;
  }
}