/* Global Variables & Theme Config */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Colors */
  --bg-primary: #0a0b10;
  --bg-surface: rgba(25, 27, 38, 0.45);
  --bg-surface-hover: rgba(35, 38, 54, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(139, 92, 246, 0.3);

  --color-text-main: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-text-inverse: #030712;

  /* Accent Colors */
  --accent-primary: #8b5cf6;      /* Violet */
  --accent-secondary: #06b6d4;    /* Cyan */
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #06b6d4 100%);
  --accent-glow: rgba(139, 92, 246, 0.15);

  /* Categories Color Coding */
  --color-cat-dev: #a78bfa;
  --color-cat-prod: #34d399;
  --color-cat-media: #f472b6;
  --color-cat-fun: #fb7185;

  /* Details */
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Background Glowing Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: 0;
  opacity: 0.4;
  pointer-events: none;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-primary);
  top: -100px;
  right: -50px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-secondary);
  bottom: 10%;
  left: -200px;
  opacity: 0.3;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #d946ef;
  top: 40%;
  right: 15%;
  opacity: 0.15;
}

/* Main Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-symbol {
  background: var(--accent-gradient);
  color: var(--color-text-inverse);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--color-text-main);
}

.logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 500;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: var(--color-cat-prod);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-cat-prod);
  animation: pulse 2s infinite;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 5rem 0 3rem 0;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

/* Toolbar & Filters */
.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  pointer-events: none;
  transition: var(--transition-fast);
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1rem 1rem 3.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text-main);
  outline: none;
  transition: var(--transition-normal);
}

.search-input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

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

.clear-search-btn {
  position: absolute;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.clear-search-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-main);
}

.clear-search-btn svg {
  width: 16px;
  height: 16px;
}

.categories-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.category-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1.15rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition-normal);
  outline: none;
}

.category-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-text-main);
}

.category-pill.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: var(--color-text-inverse);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.cat-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: 600;
}

.category-pill.active .cat-count {
  background: rgba(0, 0, 0, 0.15);
}

/* Tools Grid Section */
.grid-section {
  min-height: 400px;
  margin-bottom: 5rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Card Design */
.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-4px);
  background: var(--bg-surface-hover);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(139, 92, 246, 0.1);
}

.tool-card:hover::before {
  background: var(--accent-gradient);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.tool-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  transition: var(--transition-normal);
}

.tool-card:hover .tool-icon-wrapper {
  background: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-primary);
  color: var(--color-text-main);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.tool-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Category-specific styling for tags */
.badge-developer {
  background: rgba(167, 139, 250, 0.08);
  color: var(--color-cat-dev);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.badge-productivity {
  background: rgba(52, 211, 153, 0.08);
  color: var(--color-cat-prod);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-media {
  background: rgba(244, 114, 182, 0.08);
  color: var(--color-cat-media);
  border: 1px solid rgba(244, 114, 182, 0.2);
}

.badge-fun {
  background: rgba(251, 113, 133, 0.08);
  color: var(--color-cat-fun);
  border: 1px solid rgba(251, 113, 133, 0.2);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.tool-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.tool-description {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-top: auto;
  transition: var(--transition-fast);
}

.card-footer svg {
  width: 16px;
  height: 16px;
  transition: var(--transition-fast);
}

.tool-card:hover .card-footer {
  color: var(--accent-primary);
}

.tool-card:hover .card-footer svg {
  transform: translateX(4px);
}

/* Loading State */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  color: var(--color-text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 1rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 480px;
  margin: 2rem auto;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
  text-decoration: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--color-text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Footer */
.main-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 0;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-meta {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px var(--color-cat-prod);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.9);
    box-shadow: 0 0 3px var(--color-cat-prod);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Rules */
@media (max-width: 768px) {
  .app-container {
    padding: 0 1rem;
  }
  
  .hero-section {
    padding: 3rem 0 2rem 0;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .toolbar-section {
    padding: 1rem;
  }
  
  .tools-grid {
    grid-template-columns: 1fr;
  }
}
