@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  /* Remove scrollbars globally */
  * {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  *::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
}

@layer utilities {
  /* Auto-play progress animation */
  @keyframes progress {
    from {
      width: 0%;
    }
    to {
      width: 100%;
    }
  }

  .animate-progress {
    animation: progress 4s linear infinite;
  }

  /* Enhanced touch interactions */
  .touch-pan-y {
    touch-action: pan-y;
  }

  /* Smooth slider transitions */
  .slider-transition {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }

  /* Custom scrollbar for better mobile experience */
  .custom-scrollbar::-webkit-scrollbar {
    display: none;
  }

  .custom-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  /* Hero slider specific styles */
  .hero-slide {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100%;
    position: relative;
  }

  .hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
  }

  .hero-slide-content {
    position: relative;
    z-index: 2;
  }

  /* Touch feedback */
  .touch-feedback:active {
    transform: scale(0.95);
    transition: transform 0.1s ease-in-out;
  }

  /* Auto-play indicator pulse */
  .auto-play-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  /* Enhanced slider button styles */
  .hero-slider-btn {
    backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
  }

  .hero-slider-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
  }

  /* Hero slider navigation shadow */
  .hero-nav-shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }

  /* Hero slider fade effect */
  .hero-slide-fade {
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
  }

  .hero-slide-fade.active {
    opacity: 1;
  }

  /* Background overlay for better text readability */
  .hero-overlay {
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
  }

  /* Swipe hint animation */
  .swipe-hint {
    animation: fade-in-out 3s ease-in-out infinite;
  }

  @keyframes fade-in-out {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
  }
}

@layer components {
  /* Consolidated slider button styles using @apply */
  .slider-btn {
    @apply rounded-full transition-all duration-200 cursor-pointer focus-visible:outline-2 focus-visible:outline-gray-800 focus-visible:outline-offset-2 flex items-center justify-center;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .slider-btn:hover {
    @apply scale-105;
  }

  .slider-btn:active {
    @apply scale-95;
  }

  /* Auto-play button styles */
  .autoplay-btn {
    @apply rounded-full transition-all duration-200 cursor-pointer focus-visible:outline-2 focus-visible:outline-gray-800 focus-visible:outline-offset-2 flex items-center justify-center;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .autoplay-btn:hover {
    @apply scale-105 shadow-md;
  }

  /* Slide indicator styles */
  .slide-indicator {
    @apply rounded-full transition-all duration-200 cursor-pointer focus-visible:outline-2 focus-visible:outline-gray-800 focus-visible:outline-offset-2;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
  }

  .slide-indicator:hover {
    @apply scale-125;
  }

  /* Tab styles */
  .tab-button {
    @apply cursor-pointer transition-all duration-200 hover:opacity-80 focus-visible:outline-2 focus-visible:outline-gray-800 focus-visible:outline-offset-2 touch-feedback;
  }

  /* Mobile-specific improvements */
  @media (max-width: 768px) {
    .slider-btn, .autoplay-btn, .slide-indicator {
      min-width: 48px;
      min-height: 48px;
    }
  }

  /* Reduced motion for accessibility */
  @media (prefers-reduced-motion: reduce) {
    .slider-btn, .autoplay-btn, .slide-indicator {
      transition: none;
    }
    
    .auto-play-pulse {
      animation: none;
    }
    
    .slider-transition {
      transition: none;
    }
  }
}