/**
 * Nike Slider Frontend Styles
 * Compatible with Elementor Flexbox containers
 */

/* ========================================
   Custom Fonts - Canterbury
   ======================================== */
@font-face {
  font-family: 'Canterbury';
  src: url('../fonts/Canterbury.woff2') format('woff2'),
       url('../fonts/Canterbury.woff') format('woff'),
       url('../fonts/Canterbury.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ========================================
   CSS Variables
   ======================================== */
.nike-slider-wrapper {
  --nike-black: #111111;
  --nike-white: #ffffff;
  --nike-red: #ff0000;
  --nike-gray: #757575;
  --nike-light: #f5f5f5;
  --slide-duration: 6s;
  --transition-speed: 0.8s;
}

/* ========================================
   Reset & Base
   ======================================== */
.nike-slider-wrapper,
.nike-slider-wrapper *,
.nike-slider-wrapper *::before,
.nike-slider-wrapper *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========================================
   Main Wrapper
   ======================================== */
.nike-slider-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  max-height: 900px;
  overflow: hidden;
  background: var(--nike-black);
  font-family: 'Oswald', sans-serif;
}

/* Flexbox Container Compatibility */
.elementor-widget-nike-slider {
  width: 100%;
}

.e-con > .elementor-widget-nike-slider,
.e-con-inner > .elementor-widget-nike-slider {
  --flex-grow: 1;
  --flex-shrink: 1;
  flex-basis: 100%;
}

/* ========================================
   Slides Container
   ======================================== */
.nike-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ========================================
   Individual Slide
   ======================================== */
.nike-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8%;
  z-index: 1;
}

.nike-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* Slide Animation */
.nike-slide.slide-in-right {
  animation: slideInRight var(--transition-speed) ease forwards;
}

.nike-slide.slide-out-left {
  animation: slideOutLeft var(--transition-speed) ease forwards;
}

.nike-slide.zoom-in {
  animation: zoomIn var(--transition-speed) ease forwards;
}

.nike-slide.flip-in {
  animation: flipIn var(--transition-speed) ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-100%);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(1.2);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes flipIn {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateY(90deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) rotateY(0);
  }
}

/* ========================================
   Slide Background
   ======================================== */
.slide-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Ken Burns Effect */
.nike-slider-wrapper[data-ken-burns="true"] .slide-bg {
  transform: scale(1.1);
  transition: transform 6s ease-out;
}

.nike-slider-wrapper[data-ken-burns="true"] .nike-slide.active .slide-bg {
  transform: scale(1);
}

/* Video Background */
.slide-bg.video-bg {
  overflow: hidden;
}

.slide-bg .bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 1;
}

.slide-bg .bg-video-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78vh; /* 16:9 aspect ratio */
  min-width: 100%;
  height: 100vh;
  min-height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}

/* ========================================
   Dark Overlay
   ======================================== */
.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(17, 17, 17, 0.95) 0%,
    rgba(17, 17, 17, 0.7) 40%,
    rgba(17, 17, 17, 0.3) 70%,
    rgba(17, 17, 17, 0.1) 100%
  );
  z-index: 1;
}

/* ========================================
   Content Container
   ======================================== */
.slide-content {
  position: relative;
  z-index: 3;
  max-width: 700px;
  color: var(--nike-white);
}

/* ========================================
   Category Tag
   ======================================== */
.slide-category {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--nike-red);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease 0.2s;
}

.slide-category::before {
  content: '';
  width: 40px;
  height: 2px;
  background: var(--nike-red);
}

.nike-slide.active .slide-category {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Main Headline
   ======================================== */
.slide-headline {
  font-family: 'Canterbury', 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -2px;
  text-transform: uppercase;
  margin-bottom: 25px;
  overflow: hidden;
}

.headline-line {
  display: block;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.headline-line:nth-child(1) {
  transition-delay: 0.3s;
}

.headline-line:nth-child(2) {
  transition-delay: 0.4s;
}

.headline-line:nth-child(3) {
  transition-delay: 0.5s;
}

.nike-slide.active .headline-line {
  opacity: 1;
  transform: translateY(0);
}

/* Accent word styling */
.headline-accent {
  color: var(--nike-red);
  position: relative;
}

/* ========================================
   Subheadline/Description
   ======================================== */
.slide-subheadline {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--nike-gray);
  max-width: 450px;
  margin-bottom: 35px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease 0.6s;
}

.nike-slide.active .slide-subheadline {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   CTA Buttons
   ======================================== */
.slide-cta-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease 0.7s;
}

.nike-slide.active .slide-cta-group {
  opacity: 1;
  transform: translateY(0);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 36px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.cta-btn-primary {
  background: var(--nike-white);
  color: var(--nike-black);
  z-index: 1;
}

.cta-btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--nike-red);
  transition: left 0.4s ease;
  z-index: -1;
}

.cta-btn-primary:hover {
  color: var(--nike-white);
}

.cta-btn-primary:hover::before {
  left: 0;
}

.cta-btn-secondary {
  background: transparent;
  color: var(--nike-white);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-btn-secondary:hover {
  border-color: var(--nike-white);
  background: rgba(255, 255, 255, 0.1);
}

.cta-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.cta-btn:hover svg {
  transform: translateX(5px);
}

/* ========================================
   Navigation Arrows
   ======================================== */
.slider-nav {
  position: absolute;
  bottom: 50px;
  right: 8%;
  display: flex;
  gap: 15px;
  z-index: 10;
}

.nav-btn {
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: var(--nike-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: var(--nike-white);
  border-color: var(--nike-white);
  color: var(--nike-black);
}

.nav-btn:focus {
  outline: 2px solid var(--nike-white);
  outline-offset: 2px;
}

.nav-btn svg {
  width: 24px;
  height: 24px;
}

/* ========================================
   Slide Counter
   ======================================== */
.slide-counter {
  position: absolute;
  bottom: 65px;
  left: 8%;
  display: flex;
  align-items: baseline;
  gap: 5px;
  z-index: 10;
  font-family: 'Bebas Neue', sans-serif;
}

.counter-current {
  font-size: 72px;
  color: var(--nike-white);
  line-height: 1;
}

.counter-separator {
  font-size: 24px;
  color: var(--nike-gray);
  margin: 0 5px;
}

.counter-total {
  font-size: 24px;
  color: var(--nike-gray);
}

/* ========================================
   Progress Bar
   ======================================== */
.slider-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.progress-bar {
  height: 100%;
  background: var(--nike-red);
  width: 0%;
  transition: width 0.1s linear;
}

.progress-bar.animating {
  animation: progressAnim var(--slide-duration) linear forwards;
}

.progress-bar.paused {
  animation-play-state: paused;
}

@keyframes progressAnim {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ========================================
   Dot Indicators
   ======================================== */
.slider-dots {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  padding: 0;
}

.dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 6px;
  height: 6px;
  background: var(--nike-red);
  transition: transform 0.3s ease;
}

.dot.active {
  border-color: var(--nike-white);
}

.dot.active::after {
  transform: translate(-50%, -50%) scale(1);
}

.dot:hover {
  border-color: var(--nike-white);
}

.dot:focus {
  outline: 2px solid var(--nike-white);
  outline-offset: 2px;
}

/* ========================================
   Scroll Indicator
   ======================================== */
.scroll-indicator {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 10;
  color: var(--nike-white);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.5;
}

.scroll-mouse {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  position: relative;
}

.scroll-wheel {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--nike-white);
  border-radius: 2px;
  animation: scrollAnim 2s ease-in-out infinite;
}

@keyframes scrollAnim {
  0%,
  100% {
    opacity: 1;
    top: 8px;
  }
  50% {
    opacity: 0.3;
    top: 18px;
  }
}

/* ========================================
   Decorative Lines
   ======================================== */
.deco-lines {
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  opacity: 0.1;
}

.deco-line {
  position: absolute;
  background: var(--nike-white);
}

.deco-line-1 {
  top: 20%;
  right: 15%;
  width: 1px;
  height: 200px;
}

.deco-line-2 {
  top: 25%;
  right: 15%;
  width: 60px;
  height: 1px;
}

.deco-line-3 {
  bottom: 30%;
  right: 25%;
  width: 1px;
  height: 150px;
}

/* ========================================
   Responsive Visibility Classes
   ======================================== */
/* Hide on Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .nike-slider-wrapper .hide-on-tablet {
    display: none !important;
  }
}

/* Hide on Mobile (max-width: 768px) */
@media (max-width: 768px) {
  .nike-slider-wrapper .hide-on-mobile {
    display: none !important;
  }
}

/* ========================================
   Responsive Design - Tablet
   ======================================== */
@media (max-width: 1024px) {
  .nike-slider-wrapper {
    height: 80vh;
  }

  .slide-headline {
    font-size: clamp(40px, 8vw, 80px);
  }

  .slide-counter {
    bottom: 30px;
  }

  .counter-current {
    font-size: 48px;
  }

  .slider-nav {
    bottom: 30px;
  }

  .nav-btn {
    width: 50px;
    height: 50px;
  }
}

/* ========================================
   Responsive Design - Mobile
   ======================================== */
@media (max-width: 768px) {
  .nike-slider-wrapper {
    height: 100vh;
    min-height: 500px;
  }

  .nike-slide {
    padding: 0 5%;
    align-items: flex-end;
    padding-bottom: 120px;
  }

  .slide-overlay {
    background: linear-gradient(
      0deg,
      rgba(17, 17, 17, 0.95) 0%,
      rgba(17, 17, 17, 0.7) 50%,
      rgba(17, 17, 17, 0.3) 100%
    ) !important;
  }

  .slide-headline {
    font-size: clamp(36px, 12vw, 60px);
  }

  .slide-subheadline {
    font-size: 14px;
  }

  .cta-btn {
    padding: 14px 28px;
    font-size: 12px;
  }

  .slider-nav {
    right: 5%;
    bottom: 20px;
  }

  .slide-counter {
    left: 5%;
    bottom: 25px;
  }

  .counter-current {
    font-size: 36px;
  }

  .deco-lines {
    display: none;
  }
}

/* ========================================
   Responsive Design - Small Mobile
   ======================================== */
@media (max-width: 480px) {
  .slide-cta-group {
    flex-direction: column;
    width: 100%;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
  }

  .slider-nav {
    gap: 10px;
  }

  .nav-btn {
    width: 44px;
    height: 44px;
  }

  .slide-category {
    font-size: 10px;
  }

  .slide-category::before {
    width: 25px;
  }

  .slide-subheadline {
    font-size: 13px;
    margin-bottom: 25px;
  }
}

/* ========================================
   Elementor Editor Preview Fix
   ======================================== */
.elementor-editor-active .nike-slider-wrapper {
  min-height: 400px;
}

.elementor-editor-preview .nike-slide {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========================================
   RTL Support
   ======================================== */
[dir="rtl"] .nike-slider-wrapper {
  direction: rtl;
}

[dir="rtl"] .slide-category::before {
  margin-left: 10px;
  margin-right: 0;
}

[dir="rtl"] .slider-nav {
  right: auto;
  left: 8%;
}

[dir="rtl"] .slider-dots {
  right: auto;
  left: 8%;
}

[dir="rtl"] .slide-counter {
  left: auto;
  right: 8%;
}

[dir="rtl"] .cta-btn:hover svg {
  transform: translateX(-5px);
}

/* ========================================
   Reduced Motion Preference
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .nike-slider-wrapper,
  .nike-slider-wrapper * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .slide-bg {
    transform: none !important;
  }

  .nike-slide.active .slide-bg {
    transform: none !important;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .nike-slider-wrapper {
    height: auto;
    min-height: auto;
    max-height: none;
    page-break-inside: avoid;
  }

  .nike-slide {
    position: relative;
    page-break-inside: avoid;
  }

  .slider-nav,
  .slider-dots,
  .slider-progress,
  .scroll-indicator {
    display: none;
  }
}
