/* REPO v2 - Edefy-inspired light & airy design + Dark mode */

@layer base {
  html {
    scroll-behavior: smooth;
  }

  *:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
  }

  /* Dark mode base transitions */
  body, header, footer, section, div, a, p, span, h1, h2, h3, h4, input {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  }
}

@layer components {
  /* Hero blob shape */
  .hero-blob {
    position: absolute;
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    filter: blur(40px);
    opacity: 0.4;
    animation: blobFloat 15s ease-in-out infinite;
  }

  .dark .hero-blob {
    opacity: 0.15;
  }

  .hero-blob-2 {
    border-radius: 58% 42% 30% 70% / 55% 30% 70% 45%;
    animation: blobFloat2 18s ease-in-out infinite;
  }

  /* Gradient text */
  .gradient-text {
    background: linear-gradient(135deg, #3B82F6 0%, #A855F7 50%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .dark .gradient-text {
    background: linear-gradient(135deg, #60A5FA 0%, #C084FC 50%, #22D3EE 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }

  /* Gradient border card */
  .gradient-border-card {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
  }

  .gradient-border-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3B82F6, #A855F7, #06B6D4);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .gradient-border-card:hover::before {
    opacity: 1;
  }

  /* Icon circles with gradient backgrounds */
  .icon-circle {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
  }

  .icon-circle:hover {
    transform: scale(1.05);
  }

  .icon-gradient-blue {
    background: linear-gradient(135deg, #DBEAFE 0%, #C7D2FE 100%);
  }

  .icon-gradient-teal {
    background: linear-gradient(135deg, #CCFBF1 0%, #A5F3FC 100%);
  }

  .icon-gradient-purple {
    background: linear-gradient(135deg, #F3E8FF 0%, #FCE7F3 100%);
  }

  .icon-gradient-amber {
    background: linear-gradient(135deg, #FEF3C7 0%, #FED7AA 100%);
  }

  .icon-gradient-rose {
    background: linear-gradient(135deg, #FFE4E6 0%, #FECDD3 100%);
  }

  .icon-gradient-cyan {
    background: linear-gradient(135deg, #CFFAFE 0%, #BAE6FD 100%);
  }

  /* Dark mode icon circles - slightly muted */
  .dark .icon-gradient-blue { background: linear-gradient(135deg, #1E3A5F 0%, #312E81 100%); }
  .dark .icon-gradient-teal { background: linear-gradient(135deg, #134E4A 0%, #164E63 100%); }
  .dark .icon-gradient-purple { background: linear-gradient(135deg, #3B0764 0%, #500724 100%); }
  .dark .icon-gradient-amber { background: linear-gradient(135deg, #451A03 0%, #431407 100%); }
  .dark .icon-gradient-rose { background: linear-gradient(135deg, #4C0519 0%, #500724 100%); }
  .dark .icon-gradient-cyan { background: linear-gradient(135deg, #164E63 0%, #0C4A6E 100%); }

  /* Product card */
  .product-card {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  }

  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
  }

  .dark .product-card:hover {
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4);
  }

  /* Stats counter */
  .stats-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
  }

  .stats-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
  }

  .dark .stats-card {
    background: #1E293B;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .dark .stats-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  }

  /* Newsletter input */
  .newsletter-input {
    background: white;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  }

  .dark .newsletter-input {
    background: #1E293B;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }

  /* Theme toggle button — icons hidden by default, JS shows the active one */
  .theme-toggle {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .theme-toggle svg {
    display: none;
    transition: transform 0.3s ease;
  }

  .theme-toggle:active svg {
    transform: rotate(30deg) scale(0.9);
  }
}

@layer utilities {
  .scroll-hidden::-webkit-scrollbar {
    display: none;
  }

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

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes blobFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
  }
  25% {
    transform: translate(30px, -50px) scale(1.05);
    border-radius: 60% 40% 50% 50% / 40% 60% 40% 60%;
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
    border-radius: 50% 50% 35% 65% / 55% 35% 65% 45%;
  }
  75% {
    transform: translate(15px, 30px) scale(1.02);
    border-radius: 35% 65% 55% 45% / 50% 50% 50% 50%;
  }
}

@keyframes blobFloat2 {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 58% 42% 30% 70% / 55% 30% 70% 45%;
  }
  33% {
    transform: translate(-40px, 30px) scale(1.08) rotate(5deg);
    border-radius: 40% 60% 60% 40% / 45% 55% 45% 55%;
  }
  66% {
    transform: translate(25px, -20px) scale(0.92) rotate(-3deg);
    border-radius: 55% 45% 40% 60% / 60% 40% 60% 40%;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-float-delay {
  animation: float 4s ease-in-out infinite;
  animation-delay: 1s;
}

.animate-float-delay-2 {
  animation: float 4s ease-in-out infinite;
  animation-delay: 2s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .animate-fade-in-up,
  .animate-fade-in,
  .animate-float,
  .animate-float-delay,
  .animate-float-delay-2,
  .product-card,
  .hero-blob,
  .hero-blob-2 {
    animation: none;
    transition: none;
    transform: none;
  }
}
