/**
 * FlexExt Visual Slideshow Studio Pro
 * High-Performance Layer-Animated Slider Engine
 * Responsive, Zero-CLS & GPU-Accelerated
 */

:root {
  --flx-slide-primary: #0284c7;
  --flx-slide-accent: #38bdf8;
  --flx-slide-dark: #071936;
}

/* --------------------------------------------------------------------------
   Slider Root Container (Zero CLS with Predefined Heights)
   -------------------------------------------------------------------------- */
.flx-slideshow-studio {
  position: relative;
  width: 100%;
  height: var(--flx-h-desktop, 540px);
  min-height: var(--flx-h-desktop, 540px);
  overflow: hidden;
  background-color: var(--flx-slide-dark);
  color: #ffffff;
  user-select: none;
  border-radius: 0;
}

@media (max-width: 991.98px) {
  .flx-slideshow-studio {
    height: var(--flx-h-tablet, 440px);
    min-height: var(--flx-h-tablet, 440px);
  }
}

@media (max-width: 575.98px) {
  .flx-slideshow-studio {
    height: var(--flx-h-mobile, 400px);
    min-height: var(--flx-h-mobile, 400px);
  }
}

/* --------------------------------------------------------------------------
   Progress Bar Timer
   -------------------------------------------------------------------------- */
.flx-slider-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 50;
}

.flx-slider-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #2563eb, #60a5fa);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
  transition: width linear;
}

/* --------------------------------------------------------------------------
   Slides Track & Individual Slide State
   -------------------------------------------------------------------------- */
.flx-slides-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.flx-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
  z-index: 1;
}

.flx-slide.flx-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   Background Layers & Ken Burns Zoom Effect
   -------------------------------------------------------------------------- */
.flx-slide-bg-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.flx-slide-image {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  will-change: transform;
}

.flx-slide.flx-active .flx-slide-image.flx-ken-burns {
  animation: flxKenBurns 18s ease-out infinite alternate;
}

@keyframes flxKenBurns {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.08) translate(-1.5%, -1%); }
  100% { transform: scale(1.04) translate(1%, 0.5%); }
}

.flx-slide-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;
}

.flx-slide-video-yt-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  background: #071936;
}

.flx-slide-video-yt {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: calc(100% + 140px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: none;
  opacity: 0.85;
}

.flx-slide-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 75% 30%, #1e3a8a 0%, #071936 60%, #030712 100%);
}

.flx-slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 25, 54, 0.80);
  z-index: 2;
  backdrop-filter: blur(1px);
}

.flx-slide-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 3;
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Slide Content Container & Typography
   -------------------------------------------------------------------------- */
.flx-slide-container {
  position: relative;
  z-index: 10;
}

.flx-slide-content-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 20px 20px clamp(45px, 6.5vw, 90px);
}

/* Base state for all animated layers inside slide */
.flx-slide-layer {
  opacity: 0;
  will-change: transform, opacity;
}

/* 1. Super-Badge / Ribbon */
.flx-slide.flx-active .flx-layer-badge {
  animation: flxSlideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.flx-slide-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 20px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

/* 2. Headline Tag (h1 / h2) */
.flx-slide.flx-active .flx-layer-heading.flx-anim-slide_left {
  animation: flxSlideLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.flx-slide.flx-active .flx-layer-heading.flx-anim-fade_in {
  animation: flxFadeIn 0.7s ease 0.25s forwards;
}

.flx-slide.flx-active .flx-layer-heading.flx-anim-zoom_in {
  animation: flxZoomIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.flx-slide-heading {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.22;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* 3. Subtitle / Lead text */
.flx-slide.flx-active .flx-layer-subtitle {
  animation: flxFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.flx-slide-subtitle {
  font-size: clamp(0.84rem, 1.02vw, 0.94rem);
  line-height: 1.45;
  color: #cbd5e1;
  margin-bottom: 10px;
  max-width: 620px;
}

/* 4. Incoming Feature Bullet Highlights (Wjeżdżające Funkcjonalności) */
.flx-slide.flx-active .flx-layer-features {
  opacity: 1;
}

.flx-slide-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.flx-slide-feature-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateX(-24px) scale(0.96);
  will-change: transform, opacity;
}

.flx-slide.flx-active .flx-slide-feature-item {
  animation: flxFeatureSlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) var(--flx-delay, 0.6s) forwards;
}

.flx-feature-icon-box {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.flx-feature-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
}

.flx-feature-badge {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* 5. Action Buttons (CTA) */
.flx-slide.flx-active .flx-layer-actions {
  animation: flxFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
}

.flx-slide-actions-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.flx-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 20px;
  border-radius: 7px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.flx-cta-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.flx-cta-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  color: #ffffff;
  transform: translateY(-2px);
}

.flx-cta-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: skewX(-20deg);
  animation: flxShimmer 3.5s infinite;
}

@keyframes flxShimmer {
  0% { left: -100%; }
  40%, 100% { left: 200%; }
}

.flx-cta-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
}

.flx-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* 6. Floating 3D Device / Mockup Layer */
.flx-slide-mockup-col {
  perspective: 1000px;
}

.flx-slide.flx-active .flx-layer-mockup.flx-anim-slide_right {
  animation: flxMockupSlideIn 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

.flx-mockup-floating-wrap {
  position: relative;
  display: inline-block;
  animation: flxFloatIdle 5s ease-in-out infinite;
}

@keyframes flxFloatIdle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

.flx-slide-mockup-img {
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.55));
  border-radius: 0;
}

.flx-mockup-glow {
  position: absolute;
  top: 20%;
  left: 20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Entrance Keyframe Definitions
   -------------------------------------------------------------------------- */
@keyframes flxSlideDown {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes flxSlideLeft {
  0% { opacity: 0; transform: translateX(-40px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes flxFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes flxZoomIn {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes flxFadeUp {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes flxFeatureSlideIn {
  0% { opacity: 0; transform: translateX(-24px) scale(0.96); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes flxMockupSlideIn {
  0% { opacity: 0; transform: translateX(50px) rotateY(-8deg) scale(0.92); }
  100% { opacity: 1; transform: translateX(0) rotateY(0deg) scale(1); }
}

/* --------------------------------------------------------------------------
   Navigation Arrows & Dots
   -------------------------------------------------------------------------- */
.flx-slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.flx-slideshow-studio:hover .flx-slider-arrow {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .flx-slider-arrow {
    opacity: 0.85;
    pointer-events: auto;
  }
}

.flx-slider-arrow:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
}

.flx-slider-prev {
  left: 20px;
}

.flx-slider-next {
  right: 20px;
}

.flx-slider-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 30;
}

.flx-slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.flx-slider-dot.flx-active {
  width: 26px;
  border-radius: 10px;
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}
