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

@layer base {
  html {
    scroll-behavior: smooth;
  }
  body {
    @apply font-body text-fishmo-dark bg-[#f8f9fa] antialiased overflow-x-hidden;
  }
  h1, h2, h3, h4, h5, h6 {
    @apply font-heading tracking-tight;
  }
  /* Visible, on-brand focus ring for keyboard navigation */
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 3px;
    border-radius: 4px;
  }
}

@layer utilities {
  /* ---------- Glassmorphism system (soft blur, no excessive transparency) ---------- */
  .glass {
    @apply bg-white bg-opacity-70 backdrop-blur-lg border border-white border-opacity-50 shadow-glass;
  }
  .glass-card {
    @apply bg-white bg-opacity-80 backdrop-blur-xl border border-white border-opacity-60 shadow-premium rounded-3xl transition-all duration-300 hover:shadow-premium-hover hover:-translate-y-2;
  }
  .glass-nav {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6);
  }
  .glass-nav.nav-scrolled {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  }
  .glass-btn {
    @apply bg-white/60 backdrop-blur-md border border-white/60 shadow-sm transition-all duration-300;
  }
  .glass-btn:hover {
    @apply bg-white/90 shadow-md;
  }
  .glass-circle {
    @apply w-11 h-11 rounded-full flex items-center justify-center bg-white/70 backdrop-blur-md border border-white/60 shadow-sm transition-all duration-300;
  }
  .glass-circle:hover {
    @apply bg-white shadow-md -translate-y-0.5;
  }
  .glass-dark {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .glass-popover {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
  }

  .text-gradient {
    @apply bg-clip-text text-transparent bg-gradient-to-r from-fishmo-blue to-fishmo-green;
  }

  /* Hide scrollbar for horizontal sliders while keeping native scroll/drag */
  .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Cursor Glow Effect */
.cursor-glow {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(14,165,233,0.1) 0%, rgba(255,255,255,0) 70%);
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out;
}

/* Page Loader */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease-out;
}
.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Scroll Progress Bar */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(to right, #0ea5e9, #10b981);
  z-index: 9998;
  transition: width 0.1s linear;
}

/* Button Ripple Micro-interaction */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
@keyframes ripple-anim {
  to {
    transform: scale(3);
    opacity: 0;
  }
}

/* Premium product slider (Swiper) overrides */
.product-swiper {
  padding: 1.5rem 0.25rem 3rem;
  overflow: visible !important;
}
.product-swiper .swiper-slide {
  height: auto;
  display: flex;
}
.product-swiper .swiper-pagination {
  bottom: 0 !important;
}
.product-swiper .swiper-pagination-bullet {
  background: #1e293b;
  opacity: 0.2;
  width: 8px;
  height: 8px;
}
.product-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: #0ea5e9;
  width: 22px;
  border-radius: 6px;
}

/* Hero visual slider (right-side, split layout) */
.hero-swiper,
.hero-swiper .swiper-slide {
  height: 100%;
}
.hero-slide-img {
  animation: hero-ken-burns 10s ease-in-out infinite alternate;
}
@keyframes hero-ken-burns {
  from { transform: scale(1.02); }
  to { transform: scale(1.14); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide-img { animation: none; }
}
.hero-swiper .swiper-pagination {
  bottom: 14px !important;
}
.hero-swiper .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.55;
  width: 7px;
  height: 7px;
}
.hero-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  width: 22px;
  border-radius: 6px;
  background: #fff;
}

/* Organic floating shapes behind the hero visual */
@keyframes hero-blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-2%, 3%) scale(1.05); }
}
.hero-blob {
  animation: hero-blob-float 12s ease-in-out infinite;
}

/* Floating particles */
@keyframes particle-drift {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-120px) translateX(20px); opacity: 0; }
}
.hero-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(14,165,233,0.2) 70%);
  animation: particle-drift 6s ease-in infinite;
  pointer-events: none;
}

/* Magnetic hover targets get a smooth spring-like transition */
.magnetic {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Circular nav icon buttons: hover glow + micro-rotation on the icon */
.icon-btn i {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.icon-btn:hover i {
  transform: rotate(-10deg) scale(1.12);
}
.icon-btn:hover {
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.18), 0 0 0 1px rgba(14, 165, 233, 0.12) inset;
}

/* Cursor proximity glow on the floating navbar */
.nav-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(220px circle at var(--x, 50%) var(--y, 50%), rgba(14, 165, 233, 0.16), transparent 70%);
}
.group:hover .nav-glow,
.nav-glow.is-visible {
  opacity: 1;
}

/* Mobile drawer smooth slide (panel stays mounted, animates via transform) */
#mobile-drawer {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
#mobile-drawer.drawer-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.45s ease;
}
#mobile-drawer .drawer-panel {
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-drawer.drawer-open .drawer-panel {
  transform: translateX(0);
}
