/* ==========================================================================
   APPLE.COM FLAGSHIP SLIDER & KEYNOTE MOTION DESIGN SYSTEM
   Ali Sarah Electronics Trading Co. LLC
   Inspired by Apple Keynote & Apple TV+ Carousel
   ========================================================================== */

:root {
  --apple-bg: #000000;
  --apple-card-bg: #161617;
  --apple-card-border: rgba(255, 255, 255, 0.12);
  --apple-card-border-active: rgba(255, 255, 255, 0.28);
  --apple-text-primary: #f5f5f7;
  --apple-text-secondary: #86868b;
  --apple-accent-blue: #2997ff;
  --apple-accent-gold: #e3a857;
  --apple-ease: cubic-bezier(0.25, 1, 0.5, 1);
  --apple-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --apple-radius: 28px;
}

/* Section Wrapper */
.apple-showcase-section {
  position: relative;
  background-color: var(--apple-bg);
  padding: 60px 0 80px 0;
  overflow: hidden;
  color: var(--apple-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Icons', 'Inter', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Apple Header */
.apple-section-header {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 44px auto;
  padding: 0 24px;
}

.apple-kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--apple-accent-blue);
  margin-bottom: 12px;
  background: rgba(41, 151, 255, 0.12);
  padding: 6px 16px;
  border-radius: 980px;
  border: 1px solid rgba(41, 151, 255, 0.25);
}

.apple-section-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 16px 0;
  background: linear-gradient(180deg, #ffffff 20%, #a1a1a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.apple-section-desc {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--apple-text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

/* Slider Master Viewport */
.apple-slider-container {
  position: relative;
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  overflow: hidden;
  padding: 20px 0 30px 0;
  user-select: none;
  touch-action: pan-y pinch-zoom;
}

.apple-slider-track {
  display: flex;
  align-items: center;
  gap: 24px;
  transition: transform 0.68s var(--apple-ease);
  will-change: transform;
  padding: 10px calc(50% - 470px);
}

@media (max-width: 1100px) {
  .apple-slider-track {
    padding: 10px calc(50% - 390px);
    gap: 18px;
  }
}

@media (max-width: 860px) {
  .apple-slider-track {
    padding: 10px 20px;
    gap: 14px;
  }
}

/* Apple Slider Card */
.apple-card {
  position: relative;
  flex: 0 0 940px;
  height: 540px;
  border-radius: var(--apple-radius);
  background: var(--apple-card-bg);
  border: 1px solid var(--apple-card-border);
  overflow: hidden;
  transition: transform 0.65s var(--apple-ease), opacity 0.65s var(--apple-ease), box-shadow 0.65s var(--apple-ease), filter 0.65s var(--apple-ease);
  cursor: pointer;
  transform: scale(0.92);
  opacity: 0.42;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .apple-card {
    flex: 0 0 780px;
    height: 480px;
  }
}

@media (max-width: 860px) {
  .apple-card {
    flex: 0 0 calc(100vw - 40px);
    height: 460px;
    border-radius: 22px;
  }
}

@media (max-width: 480px) {
  .apple-card {
    height: 420px;
  }
}

.apple-card.active {
  transform: scale(1);
  opacity: 1;
  z-index: 5;
  cursor: default;
  border-color: var(--apple-card-border-active);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.apple-card:not(.active):hover {
  opacity: 0.72;
  transform: scale(0.94);
}

/* Video Layer in Card */
.apple-card-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.apple-card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  transition: transform 1.2s var(--apple-ease-out);
  will-change: transform;
}

.apple-card.active .apple-card-video {
  transform: scale(1.06);
}

/* Cinematic Vignette Overlay */
.apple-card-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    rgba(0, 0, 0, 0.85) 100%
  );
  pointer-events: none;
}

.apple-card.active .apple-card-vignette {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.38) 40%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

/* Card Content Overlay */
.apple-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px 48px;
  box-sizing: border-box;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform 0.6s var(--apple-ease), opacity 0.5s ease;
}

@media (max-width: 768px) {
  .apple-card-content {
    padding: 24px;
  }
}

.apple-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 980px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 12px;
}

.apple-card-title {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 10px 0;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.apple-card-desc {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.84);
  max-width: 600px;
  margin: 0 0 24px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Apple Action Buttons */
.apple-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.apple-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: #000000 !important;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 980px;
  text-decoration: none;
  transition: all 0.3s var(--apple-ease);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid #ffffff;
}

.apple-pill-btn:hover {
  background: #e8e8ed;
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

.apple-pill-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff !important;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 980px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: all 0.3s var(--apple-ease);
}

.apple-pill-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  transform: scale(1.03);
}

/* Chevron Navigation Arrows */
.apple-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(26, 26, 28, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.25s var(--apple-ease);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.apple-nav-arrow:hover {
  background: rgba(45, 45, 48, 0.92);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.08);
}

.apple-nav-arrow.prev {
  left: 32px;
}

.apple-nav-arrow.next {
  right: 32px;
}

@media (max-width: 900px) {
  .apple-nav-arrow {
    display: none;
  }
}

/* Apple Bottom Control Bar (Progress Pills + Play/Pause) */
.apple-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

/* Progress Pill Dots Dock */
.apple-pills-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 30, 32, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 8px 16px;
  border-radius: 980px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.apple-pill-indicator {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.45s var(--apple-ease), background-color 0.3s ease;
}

.apple-pill-indicator:hover {
  background: rgba(255, 255, 255, 0.5);
}

.apple-pill-indicator.active {
  width: 44px;
  background: rgba(255, 255, 255, 0.22);
}

.apple-pill-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: #ffffff;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 980px;
}

/* Play/Pause Toggle Button */
.apple-play-pause-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(30, 30, 32, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s var(--apple-ease);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.apple-play-pause-btn:hover {
  background: rgba(50, 50, 54, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.apple-play-pause-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* RTL Layout Parity for Arabic */
[dir="rtl"] .apple-showcase-section,
html[dir="rtl"] .apple-showcase-section,
body.rtl .apple-showcase-section {
  direction: rtl;
}

[dir="rtl"] .apple-card-content,
html[dir="rtl"] .apple-card-content,
body.rtl .apple-card-content {
  align-items: flex-start;
  text-align: right;
}

[dir="rtl"] .apple-pill-fill,
html[dir="rtl"] .apple-pill-fill,
body.rtl .apple-pill-fill {
  transform-origin: right center;
}

[dir="rtl"] .apple-nav-arrow.prev,
html[dir="rtl"] .apple-nav-arrow.prev {
  left: auto;
  right: 32px;
  transform: translateY(-50%) rotate(180deg);
}

[dir="rtl"] .apple-nav-arrow.next,
html[dir="rtl"] .apple-nav-arrow.next {
  right: auto;
  left: 32px;
  transform: translateY(-50%) rotate(180deg);
}

[dir="rtl"] .apple-nav-arrow.prev:hover,
html[dir="rtl"] .apple-nav-arrow.prev:hover {
  transform: translateY(-50%) rotate(180deg) scale(1.08);
}

[dir="rtl"] .apple-nav-arrow.next:hover,
html[dir="rtl"] .apple-nav-arrow.next:hover {
  transform: translateY(-50%) rotate(180deg) scale(1.08);
}
