/* ============================================
   AI Nav — Glassmorphism Dark Theme
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg-primary: #070b16;
  --bg-secondary: #0d1225;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --accent-purple: #7c3aed;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-orange: #f97316;
  --accent-blue: #3b82f6;

  --gradient-main: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  --gradient-warm: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-full: 100px;

  --blur-sm: 10px;
  --blur-md: 20px;
  --blur-lg: 40px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-glow-purple: 0 0 40px rgba(124, 58, 237, 0.15);
  --shadow-glow-cyan: 0 0 40px rgba(6, 182, 212, 0.1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---------- Background Blobs ---------- */
.bg-decoration {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(140px); opacity: 0.3;
  animation: blobFloat 18s ease-in-out infinite;
  will-change: transform;
}
.blob-1 { width: 550px; height: 550px; background: var(--accent-purple); top: -150px; left: -100px; }
.blob-2 { width: 450px; height: 450px; background: var(--accent-cyan); top: 35%; right: -120px; animation-delay: -5s; animation-duration: 22s; }
.blob-3 { width: 400px; height: 400px; background: var(--accent-pink); bottom: -80px; left: 35%; animation-delay: -10s; animation-duration: 20s; }
.blob-4 { width: 300px; height: 300px; background: var(--accent-blue); top: 60%; left: 10%; animation-delay: -15s; animation-duration: 25s; opacity: 0.2; }

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 40px) scale(0.95); }
  75% { transform: translate(30px, 20px) scale(1.03); }
}

/* ---------- Container ---------- */
.container {
  position: relative; z-index: 1;
  max-width: 1280px; margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 28px;
  transition: var(--transition-medium);
  background: transparent;
}
.navbar.scrolled {
  background: rgba(7, 11, 22, 0.75);
  backdrop-filter: blur(var(--blur-md));
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800;
  transition: opacity var(--transition-fast);
}
.nav-logo:hover { opacity: 0.8; }
.logo-icon { font-size: 26px; }
.logo-highlight {
  background: var(--gradient-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-stats {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--text-muted);
}
.nav-stat-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(var(--blur-sm));
}
.nav-stat-num { color: var(--text-primary); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 120px 0 48px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  padding: 8px 20px; border-radius: var(--radius-full);
  font-size: 13px; color: #c4b5fd;
  margin-bottom: 28px;
  backdrop-filter: blur(var(--blur-sm));
  animation: fadeInDown 0.6s ease-out;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.hero-title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 900; line-height: 1.15;
  margin-bottom: 18px; letter-spacing: -0.02em;
  animation: fadeInDown 0.6s ease-out 0.1s both;
}
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a78bfa 40%, #06b6d4 70%, #ec4899 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-desc {
  font-size: 17px; color: var(--text-secondary);
  max-width: 580px; margin: 0 auto 40px;
  animation: fadeInDown 0.6s ease-out 0.2s both;
}

/* ---------- Search ---------- */
.search-wrapper {
  max-width: 560px; margin: 0 auto;
  position: relative;
  animation: fadeInDown 0.6s ease-out 0.3s both;
}
.search-icon {
  position: absolute; left: 20px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
  transition: color var(--transition-fast);
}
.search-wrapper:focus-within .search-icon { color: var(--accent-purple); }
.search-wrapper input {
  width: 100%; padding: 17px 100px 17px 54px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 15px; color: var(--text-primary);
  backdrop-filter: blur(var(--blur-md));
  outline: none; transition: var(--transition-medium);
}
.search-wrapper input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08), var(--shadow-glow-purple);
  background: rgba(255, 255, 255, 0.07);
}
.search-wrapper input::placeholder { color: var(--text-muted); }
.search-kbd {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  padding: 4px 10px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  font-size: 11px; color: var(--text-muted); font-weight: 500;
  pointer-events: none;
}

/* ---------- Categories ---------- */
.categories-wrapper {
  margin-bottom: 12px;
  animation: fadeInDown 0.6s ease-out 0.4s both;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 4px 0;
}
.categories-wrapper::-webkit-scrollbar { display: none; }
.categories {
  display: flex; justify-content: center; gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.cat-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  backdrop-filter: blur(var(--blur-sm));
  transition: var(--transition-medium);
}
.cat-btn:hover {
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
  transform: translateY(-1px);
}
.cat-btn.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.45);
  color: #c4b5fd;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.1);
}
.cat-count {
  font-size: 11px; padding: 2px 7px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted); font-weight: 600;
  min-width: 22px; text-align: center;
}
.cat-btn.active .cat-count {
  background: rgba(124, 58, 237, 0.25);
  color: #c4b5fd;
}

/* ---------- Results Bar ---------- */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; margin-bottom: 20px;
  font-size: 13px; color: var(--text-muted);
}

/* ---------- Cards Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
  min-height: 200px;
}

/* ---------- Card ---------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(var(--blur-md));
  transition: var(--transition-medium);
  cursor: pointer;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: cardIn 0.45s ease-out both;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: var(--radius-lg); padding: 1.5px;
  background: linear-gradient(135deg, rgba(124,58,237,0), rgba(6,182,212,0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  transition: background var(--transition-slow);
  pointer-events: none;
}
.card::after {
  content: ''; position: absolute;
  top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  transition: left 0.7s ease;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px) scale(1.01);
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.3),
    var(--shadow-glow-purple),
    var(--shadow-glow-cyan);
}
.card:hover::before {
  background: linear-gradient(135deg,
    rgba(124, 58, 237, 0.5),
    rgba(6, 182, 212, 0.5));
}
.card:hover::after { left: 125%; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Card content */
.card-header { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 14px; }
.card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; flex-shrink: 0;
  position: relative;
  transition: transform var(--transition-fast);
}
.card:hover .card-icon { transform: scale(1.08) rotate(-3deg); }

.card-meta { flex: 1; min-width: 0; }
.card-title-row { display: flex; align-items: center; gap: 8px; }
.card-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.card-new {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: rgba(16, 185, 129, 0.2); color: var(--accent-green);
  font-weight: 700; letter-spacing: 0.5px;
}
.card-hot {
  font-size: 10px; padding: 2px 7px; border-radius: 4px;
  background: rgba(249, 115, 22, 0.2); color: var(--accent-orange);
  font-weight: 700; letter-spacing: 0.5px;
}
.card-cat {
  font-size: 12px; color: #a78bfa;
  margin-top: 3px; font-weight: 500;
}
.card-desc {
  font-size: 13.5px; color: var(--text-secondary);
  line-height: 1.75; margin-bottom: 18px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Card tags */
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.card-tag {
  padding: 3px 10px; border-radius: 6px; font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted); font-weight: 500;
}

/* Card footer */
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.card-pricing {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.pricing-free { color: var(--accent-green); }
.pricing-paid { color: var(--accent-orange); }
.visit-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600;
  background: var(--gradient-main);
  color: #fff; border: none;
  transition: var(--transition-fast);
  position: relative; overflow: hidden;
}
.visit-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0; transition: opacity var(--transition-fast);
}
.visit-btn:hover::before { opacity: 1; }
.visit-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}
.visit-arrow {
  transition: transform var(--transition-fast);
}
.card:hover .visit-arrow { transform: translateX(3px); }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center; padding: 80px 20px;
  animation: fadeInDown 0.4s ease-out;
}
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 20px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-muted); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 80px; padding: 28px 0;
  border-top: 1px solid var(--border-subtle);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.footer-brand {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.footer-sep { color: var(--text-muted); }
.footer-copy { font-weight: 400; color: var(--text-muted); font-size: 13px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
  font-size: 13px; color: var(--text-muted);
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--text-primary); }

/* ---------- Animations ---------- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .hero { padding: 100px 0 36px; }
  .hero-title { font-size: 32px; }
  .hero-desc { font-size: 15px; }
  .search-kbd { display: none; }
  .search-wrapper input { padding-right: 20px; }
  .categories { justify-content: flex-start; flex-wrap: nowrap; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .nav-stats { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ---------- Selection ---------- */
::selection {
  background: rgba(124, 58, 237, 0.3);
  color: #fff;
}
