/*
 * ═══════════════════════════════════════════════════════════
 * Lions.dev - Progress Component Styles
 * ═══════════════════════════════════════════════════════════
 * Styles pour ProgressBar (barre de progression)
 *
 * Version: 1.0.0
 * Date: 2 Janvier 2026
 * Author: Lions Development Team
 * Priority: MOYENNE #39
 * ═══════════════════════════════════════════════════════════
 */

@import '../variables';
@import '../mixins';

// ============================================
// 📊 PROGRESSBAR STYLES
// ============================================

.ui-progressbar {
  position: relative;
  overflow: hidden;
  height: 1rem;
  @include lions-rounded('md');
  background: $lions-gray-200;
  @include lions-shadow('sm');

  .ui-progressbar-value {
    height: 100%;
    @include lions-gradient-blue;
    @include lions-rounded('md');
    @include lions-transition();
    position: relative;
    overflow: hidden;

    // Animated stripes
    &::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      background-image: linear-gradient(
        45deg,
        rgba($lions-white, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba($lions-white, 0.15) 50%,
        rgba($lions-white, 0.15) 75%,
        transparent 75%,
        transparent
      );
      background-size: 1rem 1rem;
    }
  }

  .ui-progressbar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    @include lions-font-size('xs');
    @include lions-font-weight('semibold');
    color: $lions-white;
    text-shadow: 0 1px 2px rgba($lions-black, 0.3);
    z-index: 2;
    white-space: nowrap;
  }

  // Severity variants
  &.ui-progressbar-success {
    .ui-progressbar-value {
      @include lions-gradient-success;
    }
  }

  &.ui-progressbar-info {
    .ui-progressbar-value {
      @include lions-gradient-info;
    }
  }

  &.ui-progressbar-warning {
    .ui-progressbar-value {
      @include lions-gradient-warning;
    }
  }

  &.ui-progressbar-danger {
    .ui-progressbar-value {
      @include lions-gradient-danger;
    }
  }

  // Size variants
  &.ui-progressbar-sm {
    height: 0.5rem;

    .ui-progressbar-label {
      @include lions-font-size('2xs');
    }

    .ui-progressbar-value::after {
      background-size: 0.75rem 0.75rem;
    }
  }

  &.ui-progressbar-lg {
    height: 1.5rem;

    .ui-progressbar-label {
      @include lions-font-size('sm');
    }

    .ui-progressbar-value::after {
      background-size: 1.5rem 1.5rem;
    }
  }

  // Animated stripes
  &.ui-progressbar-striped {
    .ui-progressbar-value::after {
      animation: lions-progress-stripes 1s linear infinite;
    }
  }

  // Indeterminate mode
  &.ui-progressbar-indeterminate {
    .ui-progressbar-value {
      width: 100% !important;
      background: $lions-gray-200;

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 30%;
        @include lions-gradient-blue;
        animation: lions-progress-indeterminate 1.5s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
      }

      &::after {
        display: none;
      }
    }

    &.ui-progressbar-success .ui-progressbar-value::before {
      @include lions-gradient-success;
    }

    &.ui-progressbar-info .ui-progressbar-value::before {
      @include lions-gradient-info;
    }

    &.ui-progressbar-warning .ui-progressbar-value::before {
      @include lions-gradient-warning;
    }

    &.ui-progressbar-danger .ui-progressbar-value::before {
      @include lions-gradient-danger;
    }
  }
}

// ============================================
// 🎬 ANIMATIONS
// ============================================

@keyframes lions-progress-stripes {
  0% {
    background-position: 1rem 0;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes lions-progress-indeterminate {
  0% {
    left: -30%;
  }
  100% {
    left: 100%;
  }
}

// ============================================
// 📱 RESPONSIVE ADJUSTMENTS
// ============================================

@media (max-width: $lions-breakpoint-md) {
  .ui-progressbar {
    &.ui-progressbar-lg {
      height: 1.25rem;
    }
  }
}

// ============================================
// ♿ ACCESSIBILITY ENHANCEMENTS
// ============================================

.ui-progressbar {
  // High contrast mode
  @media (prefers-contrast: high) {
    border: 2px solid currentColor;

    .ui-progressbar-value {
      border: 1px solid currentColor;
    }
  }

  // Reduced motion
  @media (prefers-reduced-motion: reduce) {
    .ui-progressbar-value::after {
      animation: none !important;
    }

    &.ui-progressbar-indeterminate .ui-progressbar-value::before {
      animation: none !important;
      left: 0;
      width: 100%;
    }
  }
}
