/* Wolf Slider - Frontend CSS */

/* ============================================================================
   1. CSS CUSTOM PROPERTIES (Variables)
   ============================================================================ */

:root {
  /* Dimensions */
  --wolf-slider-height: 500px;
  --wolf-slider-min-height: 300px;
  --wolf-container-max-width: 1200px;
  --wolf-container-max-height: 100vh;

  /* Timing & Animation */
  --wolf-transition-duration: 0.6s;
  --wolf-ken-burns-duration: 8s;

  /* Layout & Positioning */
  --wolf-object-position: center;
  --wolf-content-vertical: center;
  --wolf-content-horizontal: center;
  --wolf-content-align: center;
  --wolf-content-padding: 2rem;

  /* Typography & Colors */
  --wolf-content-color: #ffffff;
  --wolf-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --wolf-font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Color Palette */
  --wolf-color-primary: #0066cc;
  --wolf-color-secondary: #666666;
  --wolf-color-accent: #ff6600;

  /* Overlay & Transparency */
  --wolf-overlay-opacity: 0.4;

  /* Button Styles */
  --wolf-button-font: var(--wolf-font-body);
  --wolf-button-weight: 600;
  --wolf-button-radius: 4px;
  --wolf-button-bg: rgba(0, 0, 0, 0.5);
  --wolf-button-text: #ffffff;

  /* Navigation */
  --wolf-nav-size: 44px;
}

/* ============================================================================
   2. BASE SLIDER STYLES
   ============================================================================ */

.wolf-slider {
  position: relative;
  width: 100%;
  height: var(--wolf-slider-height);
  min-height: var(--wolf-slider-min-height);
  overflow: hidden;
  background: #000;
}

.wolf-slides {
  position: relative;
  width: 100%;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================================================
   3. LAYOUT MODES
   ============================================================================ */

/* Fullscreen layout */
.wolf-slider--fullscreen {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Contained layout */
.wolf-slider--contained {
  max-width: var(--wolf-container-max-width);
  margin: 0 auto;
  max-height: var(--wolf-container-max-height);
}

/* ============================================================================
   4. SLIDE STYLES - FADE TRANSITION
   ============================================================================ */

.wolf-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--wolf-transition-duration) ease-in-out,
              visibility var(--wolf-transition-duration) ease-in-out;
}

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

/* Horizontal slide transition */
.wolf-slider--slide .wolf-slide {
  transition: transform var(--wolf-transition-duration) ease-in-out;
  transform: translateX(100%);
}

.wolf-slider--slide .wolf-slide.active {
  transform: translateX(0);
}

.wolf-slider--slide .wolf-slide.prev {
  transform: translateX(-100%);
}

/* ============================================================================
   5. IMAGE STYLES
   ============================================================================ */

.wolf-slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--wolf-object-position);
}

/* Contain mode for images */
.wolf-slide-image--contain {
  object-fit: contain;
  background: #000;
}

/* Ken Burns zoom animation on active slides */
.wolf-slide.active .wolf-slide-image {
  animation: wolf-ken-burns var(--wolf-ken-burns-duration) ease-in-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .wolf-slide.active .wolf-slide-image {
    animation: none;
  }
}

/* ============================================================================
   6. CONTENT OVERLAY
   ============================================================================ */

.wolf-slide-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: var(--wolf-content-vertical);
  justify-content: var(--wolf-content-horizontal);
  padding: var(--wolf-content-padding);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, var(--wolf-overlay-opacity)) 100%);
}

.wolf-slide-content--inner {
  text-align: var(--wolf-content-align);
  color: var(--wolf-content-color);
  max-width: 90%;
}

/* ============================================================================
   7. TYPOGRAPHY
   ============================================================================ */

.wolf-slide-title {
  font-family: var(--wolf-font-heading);
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
}

.wolf-slide-description {
  font-family: var(--wolf-font-body);
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
}

/* ============================================================================
   8. NAVIGATION ARROWS
   ============================================================================ */

.wolf-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--wolf-nav-size);
  height: var(--wolf-nav-size);
  border-radius: 50%;
  background: var(--wolf-button-bg);
  border: none;
  color: var(--wolf-button-text);
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-family: var(--wolf-button-font);
  font-weight: var(--wolf-button-weight);
}

.wolf-nav-button:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-50%) scale(1.1);
}

.wolf-nav-button:active {
  transform: translateY(-50%) scale(0.95);
}

.wolf-nav-button--prev {
  left: 1rem;
}

.wolf-nav-button--next {
  right: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .wolf-nav-button {
    transition: background-color 0.3s ease;
  }

  .wolf-nav-button:hover,
  .wolf-nav-button:active {
    transform: translateY(-50%);
  }
}

/* ============================================================================
   9. DOT PAGINATION
   ============================================================================ */

.wolf-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wolf-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  padding: 0;
}

.wolf-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.wolf-dot.active {
  background: var(--wolf-color-primary);
  transform: scale(1.25);
}

@media (prefers-reduced-motion: reduce) {
  .wolf-dot {
    transition: background-color 0.3s ease;
  }

  .wolf-dot.active {
    transform: none;
  }
}

/* ============================================================================
   10. AUTOPLAY TOGGLE BUTTON
   ============================================================================ */

.wolf-autoplay-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: var(--wolf-button-radius);
  background: var(--wolf-button-bg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--wolf-button-text);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  font-family: var(--wolf-button-font);
}

.wolf-autoplay-toggle:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.6);
}

.wolf-autoplay-toggle.playing {
  background: var(--wolf-color-primary);
}

/* ============================================================================
   11. KEN BURNS ANIMATION
   ============================================================================ */

@keyframes wolf-ken-burns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* ============================================================================
   12. LIGHTBOX STYLES
   ============================================================================ */

.wolf-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wolf-lightbox.active {
  display: flex;
}

.wolf-lightbox-image {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  animation: wolf-fade-in 0.3s ease-out;
}

.wolf-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.wolf-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes wolf-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================================================
   13. IMAGE COUNTER
   ============================================================================ */

.wolf-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  background: var(--wolf-button-bg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--wolf-button-text);
  padding: 0.5rem 1rem;
  border-radius: var(--wolf-button-radius);
  font-family: var(--wolf-button-font);
  font-size: 0.875rem;
  font-weight: var(--wolf-button-weight);
}

/* ============================================================================
   14. RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Tablet and below */
@media (max-width: 768px) {
  :root {
    --wolf-slider-height: 350px;
    --wolf-content-padding: 1.5rem;
    --wolf-nav-size: 40px;
  }

  .wolf-slide-title {
    font-size: clamp(1.25rem, 4vw, 2rem);
  }

  .wolf-slide-description {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
  }

  .wolf-nav-button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .wolf-nav-button--prev {
    left: 0.75rem;
  }

  .wolf-nav-button--next {
    right: 0.75rem;
  }

  .wolf-autoplay-toggle {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  .wolf-counter {
    bottom: 1rem;
    left: 1rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }

  .wolf-dots {
    bottom: 1rem;
    gap: 0.375rem;
  }

  .wolf-dot {
    width: 10px;
    height: 10px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  :root {
    --wolf-slider-height: 280px;
    --wolf-content-padding: 1rem;
    --wolf-nav-size: 36px;
  }

  .wolf-slide-title {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  .wolf-slide-description {
    font-size: clamp(0.7rem, 1.8vw, 0.75rem);
  }

  .wolf-nav-button {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }

  .wolf-nav-button--prev {
    left: 0.5rem;
  }

  .wolf-nav-button--next {
    right: 0.5rem;
  }

  .wolf-autoplay-toggle {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .wolf-counter {
    bottom: 0.75rem;
    left: 0.75rem;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .wolf-dots {
    bottom: 0.75rem;
    gap: 0.3rem;
  }

  .wolf-dot {
    width: 8px;
    height: 8px;
  }
}

/* Desktop / Large screens */
@media (min-width: 1024px) {
  :root {
    --wolf-slider-height: 600px;
    --wolf-nav-size: 48px;
  }

  .wolf-slide-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
  }

  .wolf-slide-description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
  }

  .wolf-nav-button:hover {
    background: rgba(0, 0, 0, 0.8);
  }
}

/* ============================================================================
   15. iOS SAFE AREA SUPPORT
   ============================================================================ */

@supports (padding: max(0px)) {
  .wolf-nav-button--prev {
    left: max(1rem, env(safe-area-inset-left));
  }

  .wolf-nav-button--next {
    right: max(1rem, env(safe-area-inset-right));
  }

  .wolf-counter {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    left: max(1.5rem, env(safe-area-inset-left));
  }

  .wolf-dots {
    bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .wolf-autoplay-toggle {
    top: max(1.5rem, env(safe-area-inset-top));
    right: max(1.5rem, env(safe-area-inset-right));
  }

  .wolf-slide-content {
    padding: max(var(--wolf-content-padding), env(safe-area-inset-top))
             max(var(--wolf-content-padding), env(safe-area-inset-right))
             max(var(--wolf-content-padding), env(safe-area-inset-bottom))
             max(var(--wolf-content-padding), env(safe-area-inset-left));
  }
}

/* ============================================================================
   16. REDUCED MOTION SUPPORT
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   17. ACCESSIBILITY & UTILITY CLASSES
   ============================================================================ */

.wolf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.wolf-no-scroll {
  overflow: hidden;
}

/* Focus states for keyboard navigation */
.wolf-nav-button:focus-visible,
.wolf-dot:focus-visible,
.wolf-autoplay-toggle:focus-visible,
.wolf-lightbox-close:focus-visible {
  outline: 2px solid var(--wolf-color-primary);
  outline-offset: 2px;
}
