/* Custom styles for new home page design */

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes gradient-shift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes slow-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

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

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

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
}

.animate-slow-spin {
  animation: slow-spin 60s linear infinite;
}

/* ========================================
   MESH GRADIENT BACKGROUND
   ======================================== */

.mesh-gradient {
  background:
    radial-gradient(at 40% 20%, hsla(239, 84%, 67%, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 0%, hsla(263, 70%, 66%, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 50%, hsla(160, 84%, 39%, 0.1) 0px, transparent 50%),
    radial-gradient(at 80% 50%, hsla(239, 84%, 67%, 0.1) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsla(263, 70%, 66%, 0.15) 0px, transparent 50%);
}

[data-theme="dark"] .mesh-gradient {
  background:
    radial-gradient(at 40% 20%, hsla(239, 84%, 67%, 0.12) 0px, transparent 50%),
    radial-gradient(at 80% 0%, hsla(263, 70%, 66%, 0.10) 0px, transparent 50%),
    radial-gradient(at 0% 50%, hsla(160, 84%, 39%, 0.06) 0px, transparent 50%),
    radial-gradient(at 80% 50%, hsla(239, 84%, 67%, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsla(263, 70%, 66%, 0.10) 0px, transparent 50%);
  background-color: hsl(222, 47%, 7%);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

[data-theme="dark"] .hero-section {
  background-color: hsl(222, 47%, 7%);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: pulse-glow 4s ease-in-out infinite;
}

.hero-orb-1 {
  top: 5rem;
  right: 25%;
  width: 24rem;
  height: 24rem;
  background-color: rgba(99, 102, 241, 0.2);
}

.hero-orb-2 {
  bottom: 5rem;
  left: 25%;
  width: 20rem;
  height: 20rem;
  background-color: rgba(168, 85, 247, 0.2);
  animation-delay: 2s;
}

.hero-orb-3 {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 37rem;
  height: 37rem;
  background-color: rgba(16, 185, 129, 0.1);
  animation-delay: 1s;
}

[data-theme="dark"] .hero-orb-1 {
  background-color: rgba(99, 102, 241, 0.12);
}

[data-theme="dark"] .hero-orb-2 {
  background-color: rgba(168, 85, 247, 0.12);
}

[data-theme="dark"] .hero-orb-3 {
  background-color: rgba(16, 185, 129, 0.06);
}

/* Static fallback for no-js */
.no-js .hero-section {
  background: linear-gradient(135deg,
      oklch(var(--p) / 0.1) 0%,
      oklch(var(--s) / 0.1) 50%,
      oklch(var(--a) / 0.05) 100%);
}

/* ========================================
   FERRIS ANIMATION
   ======================================== */

.ferris-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 500px;
  margin: 0 auto;
}

.ferris-orbit-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: slow-spin 30s linear infinite;
  pointer-events: none;
}

.ferris-orbit-icon {
  position: absolute;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translate(-50%, -50%);
}

.ferris-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.ferris-glow {
  position: absolute;
  width: 80%;
  height: 80%;
  background: linear-gradient(to right, rgba(251, 146, 60, 0.3), rgba(168, 85, 247, 0.3));
  border-radius: 50%;
  filter: blur(40px);
  animation: pulse-glow 4s ease-in-out infinite;
}

.ferris-svg {
  width: 16rem;
  height: 16rem;
  position: relative;
  z-index: 10;
}

.ferris-hint {
  position: relative;
  z-index: 10;
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.5);
  white-space: nowrap;
  margin-top: -0.5rem;
}

.ferris-ping {
  position: absolute;
  border-radius: 50%;
  animation: ping 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ========================================
   FERRIS KEYFRAMES
   ======================================== */

@keyframes legKick {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(5deg);
  }
}

@keyframes clawIdle {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-5deg);
  }

  75% {
    transform: rotate(5deg);
  }
}

@keyframes wave {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-30deg);
  }

  50% {
    transform: rotate(0deg);
  }

  75% {
    transform: rotate(-30deg);
  }
}

@keyframes blink {

  0%,
  45%,
  55%,
  100% {
    opacity: 0;
  }

  48%,
  52% {
    opacity: 1;
  }
}

@keyframes ping {

  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ========================================
   FLOATING BUBBLES
   ======================================== */

@keyframes floatBubble {

  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.2;
  }

  50% {
    transform: translateY(-30px) scale(1.1);
    opacity: 0.4;
  }
}

/* ========================================
   FADE IN ANIMATION
   ======================================== */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ========================================
   TECH STACK BADGES
   ======================================== */

.tech-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.tech-badge-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tech-badge-rust {
  background-color: rgba(251, 146, 60, 0.1);
  border: 1px solid rgba(251, 146, 60, 0.2);
  color: #ea580c;
}

.tech-badge-wasm {
  background-color: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: #7c3aed;
}

.tech-badge-fast {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #2563eb;
}

.dark .tech-badge-rust {
  background-color: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.3);
  color: #fb923c;
}

.dark .tech-badge-wasm {
  background-color: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: #a78bfa;
}

.dark .tech-badge-fast {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* ========================================
   TOOL CARDS
   ======================================== */

.tool-card {
  position: relative;
  transition: all 0.3s ease-out;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.tool-card-icon {
  transition: all 0.3s ease;
}

.tool-card:hover .tool-card-icon {
  background: linear-gradient(135deg, oklch(var(--p) / 0.2), oklch(var(--s) / 0.2));
}

.tool-card-favorite {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tool-card:hover .tool-card-favorite,
.tool-card-favorite.is-favorite {
  opacity: 1;
}

.tool-card-favorite.is-favorite svg {
  fill: currentColor;
}

/* ========================================
   CATEGORY HEADERS (Dividers)
   ======================================== */

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.category-header-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, oklch(var(--p) / 0.15), oklch(var(--s) / 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.category-header-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: oklch(var(--p));
}

.category-header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: oklch(var(--bc));
  line-height: 1.25;
  white-space: nowrap;
}

.category-header-line {
  flex: 1;
  height: 1px;
  background: oklch(var(--bc) / 0.1);
  min-width: 2rem;
}

.category-header-count {
  font-size: 0.875rem;
  color: oklch(var(--bc) / 0.5);
  font-weight: 400;
  white-space: nowrap;
}

/* Dark theme adjustments */
[data-theme="dark"] .category-header-icon {
  background: linear-gradient(135deg, oklch(var(--p) / 0.2), oklch(var(--s) / 0.2));
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .category-header-icon svg {
  color: oklch(var(--p));
}

[data-theme="dark"] .category-header-line {
  background: oklch(var(--bc) / 0.15);
}

/* ========================================
   CATEGORY TABS
   ======================================== */

.category-tabs-container {
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs-container::-webkit-scrollbar {
  display: none;
}

.category-tab {
  position: relative;
  white-space: nowrap;
}

.category-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: oklch(var(--p));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.category-tab.active::after,
.category-tab:hover::after {
  transform: scaleX(1);
}

/* ========================================
   FEATURE CARDS
   ======================================== */

.feature-card {
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Updated styles to match design */
.feature-card .card-body {
  padding: 1.5rem;
}

.feature-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Light theme specific styles */
[data-theme="light"] .feature-card {
  background-color: oklch(var(--b1));
  border-color: oklch(var(--bc) / 0.1);
}

[data-theme="light"] .feature-card:hover {
  border-color: oklch(var(--p) / 0.3);
}

/* Dark theme specific styles */
[data-theme="dark"] .feature-card {
  background-color: oklch(var(--b1));
  border-color: oklch(var(--bc) / 0.15);
}

[data-theme="dark"] .feature-card:hover {
  border-color: oklch(var(--p) / 0.4);
}

[data-theme="dark"] .feature-icon {
  opacity: 0.95;
}

/* ========================================
   FAVORITES SECTION
   ======================================== */

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .favorites-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .favorites-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .favorites-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.favorite-item {
  transition: all 0.2s ease;
}

.favorite-item:hover {
  transform: scale(1.05);
}

/* ========================================
   COMMAND PALETTE
   ======================================== */

.command-palette-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.command-palette-overlay.open {
  opacity: 1;
  visibility: visible;
}

.command-palette-modal {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  width: 90%;
  max-width: 640px;
  background-color: oklch(var(--b1));
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 101;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}

.command-palette-overlay.open+.command-palette-modal,
.command-palette-modal.open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.command-palette-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid oklch(var(--bc) / 0.1);
}

.command-palette-header svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.command-palette-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.125rem;
  outline: none;
  padding: 0;
}

.command-palette-input::placeholder {
  opacity: 0.5;
}

.command-palette-list {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem;
}

.command-palette-group {
  margin-bottom: 0.5rem;
}

.command-palette-group-title {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: oklch(var(--bc) / 0.6);
  letter-spacing: 0.05em;
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.command-palette-item:hover,
.command-palette-item.selected {
  background-color: oklch(var(--bc) / 0.1);
}

.command-palette-item-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background-color: oklch(var(--b2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Ensure command palette is visible when JS adds .open class */
.command-palette-overlay.open,
.command-palette-modal.open {
  opacity: 1;
  visibility: visible;
}

.command-palette-modal.open {
  transform: translateX(-50%) scale(1);
}

/* ========================================
   HEADER STYLES
   ======================================== */

/* Gradient text for logo */
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-indigo-600 {
  --tw-gradient-from: #4f46e5 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(79 70 229 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-purple-600 {
  --tw-gradient-to: #9333ea var(--tw-gradient-to-position);
}

.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

.text-transparent {
  color: transparent;
}

/* Glass effect - matching new design */
.glass {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass {
  background-color: rgb(10, 10, 15) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Muted foreground utility */
.text-muted-foreground {
  color: oklch(var(--bc) / 0.6);
}

.hover\:text-foreground:hover {
  color: oklch(var(--bc));
}

/* Logo gradient background */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-indigo-500 {
  --tw-gradient-from: #6366f1 var(--tw-gradient-from-position);
  --tw-gradient-to: rgb(99 102 241 / 0) var(--tw-gradient-to-position);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-purple-600 {
  --tw-gradient-to: #9333ea var(--tw-gradient-to-position);
}

/* ========================================
   COLORED BADGES (matching new design)
   ======================================== */

.badge-emerald {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-amber {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-indigo {
  background-color: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Dark theme badge colors */
[data-theme="dark"] .badge-emerald {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .badge-amber {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .badge-indigo {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

/* ========================================
   PWA INSTALL PROMPT - Alert bar at bottom
   ======================================== */

#pwa-install-prompt {
  display: none;
}

#pwa-install-prompt[style*="flex"],
#pwa-install-prompt[style*="block"] {
  display: flex !important;
}