/* Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* CSS Variables for Premium Light Theme */
:root {
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --bg-main: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(241, 245, 249, 0.8);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --card-shadow-hover: 0 20px 40px -15px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.15);
  
  --primary: #4f46e5;
  --primary-glow: rgba(79, 70, 229, 0.15);
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Decorative Background Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 25s infinite alternate;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(165, 180, 252, 0.6) 0%, rgba(199, 210, 254, 0.1) 80%);
  top: -10%;
  right: -5%;
  animation-duration: 20s;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.5) 0%, rgba(191, 219, 254, 0.1) 80%);
  bottom: -15%;
  left: -10%;
  animation-delay: -5s;
  animation-duration: 30s;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(253, 164, 175, 0.35) 0%, rgba(254, 205, 211, 0.05) 80%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
  animation-duration: 25s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  33% {
    transform: translate(30px, -50px) scale(1.05) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95) rotate(240deg);
  }
  100% {
    transform: translate(0, 0) scale(1) rotate(360deg);
  }
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  position: relative;
  z-index: 10;
}

/* Header Section */
header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.15);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  font-family: var(--font-title);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.03);
}

header h1 {
  font-family: var(--font-title);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

header p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

/* Search and Filter Section */
.search-filter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 3rem;
  width: 100%;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 3rem;
  border-radius: 9999px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.search-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 24px var(--primary-glow);
  background: #ffffff;
}

.search-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.search-input:focus + .search-icon {
  color: var(--primary);
}

/* Filters Tabs */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  max-width: 100%;
  padding: 0.25rem;
  scrollbar-width: none; /* Firefox */
}

.filter-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.filter-btn:hover {
  color: var(--text-main);
  background: rgba(241, 245, 249, 0.6);
}

.filter-btn.active {
  background: #ffffff;
  border-color: rgba(226, 232, 240, 0.8);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Grid of Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  width: 100%;
}

/* Card Styling */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  cursor: pointer;
  text-decoration: none;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.03), transparent 70%);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(99, 102, 241, 0.15);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

/* Icon Container */
.icon-container {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
  background: #ffffff;
  position: relative;
}

.icon-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.card:hover .icon-container img {
  transform: scale(1.08);
}

.icon-container svg {
  width: 100%;
  height: 100%;
}

/* Meta tags / Badges on card */
.card-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(241, 245, 249, 0.8);
  color: var(--text-muted);
  border: 1px solid rgba(226, 232, 240, 0.5);
  transition: var(--transition-smooth);
}

.card:hover .card-badge {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.15);
}

/* Card Content */
.card-body {
  flex-grow: 1;
}

.card-body h2 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body p {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Card Footer */
.card-footer {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tag-list {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.725rem;
  color: var(--text-muted);
  background: rgba(241, 245, 249, 0.5);
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition-smooth);
}

.action-link svg {
  width: 16px;
  height: 16px;
  transition: var(--transition-smooth);
}

.card:hover .action-link {
  color: #312e81;
}

.card:hover .action-link svg {
  transform: translateX(4px);
}

/* Stats / Health Bar at the bottom of the grid */
.footer-stats {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Back link / Branding */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vercel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #000;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.vercel-badge:hover {
  background: #222;
}

/* Responsive adjust */
@media (max-width: 640px) {
  .container {
    padding: 2rem 1.25rem;
  }
  header h1 {
    font-size: 2.25rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .search-wrapper {
    max-width: 100%;
  }
  .footer-stats {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
