/* Page-specific styles */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 0 5rem;
  background: linear-gradient(to bottom, rgba(99, 102, 241, 0.05), var(--background));
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(120, 119, 198, 0.1), transparent 50%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; }
@media (min-width: 640px) { .hero h1 { font-size: 3rem; } }
@media (min-width: 1024px) { .hero h1 { font-size: 3.75rem; } }
.hero p { margin-top: 1.5rem; font-size: 1.125rem; color: var(--muted-foreground); }

.search-box { position: relative; max-width: 42rem; margin: 2.5rem auto 0; }
.search-input {
  width: 100%;
  height: 3.5rem;
  padding: 0 7rem 0 3rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  font-size: 1.25rem;
}
.search-btn { position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); }

.trending {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.trending span { font-size: 0.875rem; color: var(--muted-foreground); }
.trending a.badge { text-decoration: none; }

section { padding: 4rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 2rem; }
@media (min-width: 640px) { .section-title { font-size: 1.875rem; } }

.categories-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .categories-grid { grid-template-columns: repeat(3, 1fr); } }

.category-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  cursor: pointer;
}
.category-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  border-color: rgba(99, 102, 241, 0.2);
}
.category-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 0.75rem;
}
.category-card:hover .category-icon {
  background: var(--primary);
  color: var(--primary-foreground);
}
.category-info h3 { font-weight: 600; font-size: 1rem; }
.category-info p { font-size: 0.875rem; color: var(--muted-foreground); }
.category-arrow {
  margin-left: auto;
  color: var(--muted-foreground);
  transition: transform 0.2s;
}
.category-card:hover .category-arrow {
  transform: translateX(4px);
  color: var(--primary);
}

.tools-section { background: rgba(244, 244, 245, 0.5); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.section-header a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
}
.section-header a:hover { color: var(--foreground); }

.tools-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }

.tools-grid-compact { grid-template-columns: 1fr; }
@media (min-width: 640px) { .tools-grid-compact { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tools-grid-compact { grid-template-columns: repeat(4, 1fr); } }

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.tool-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  border-color: rgba(99, 102, 241, 0.2);
}
.tool-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.tool-card-main { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.tool-card-main > div { min-width: 0; flex: 1; overflow: hidden; }
.loading, .error-msg { color: var(--muted-foreground); font-size: 0.875rem; }
.error-msg { color: #dc2626; }
.tool-avatar-img { width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: 0.75rem; }
.tool-avatar {
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--muted);
  color: var(--muted-foreground);
  border-radius: 0.75rem;
}
.tool-card h3 { font-size: 1.125rem; font-weight: 600; }
.tool-card h3 a { color: inherit; text-decoration: none; transition: color 0.2s; }
.tool-card h3 a:hover { color: var(--primary); }
.tool-tagline {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  cursor: help;
}
.tool-card .tool-description {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  min-height: 2.25em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  cursor: help;
}
.tool-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: hidden;
  max-height: 1.75rem;
}
.tool-tags .badge { flex-shrink: 0; white-space: nowrap; }
.tool-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.tool-meta { display: flex; align-items: center; gap: 0.75rem; }
.pricing-badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
  min-width: 3.5rem;
  text-align: center;
  flex-shrink: 0;
}
.pricing-free { background: rgba(34, 197, 94, 0.2); color: #15803d; }
.pricing-freemium { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.pricing-paid { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.tool-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  line-height: 1;
}
.tool-rating .rating-star { font-size: 0.9em; line-height: 1; display: inline-flex; align-items: center; }
.tool-rating .rating-count { color: var(--muted-foreground); font-size: 0.8125rem; }
.tool-rate-stars { display: inline-flex; gap: 0.25rem; font-size: 1.25rem; }
.tool-rate-stars .star { color: #e5e7eb; cursor: default; }
.tool-rate-stars .star.filled { color: #facc15; }
.tool-rate-stars .rate-star { cursor: pointer; transition: color 0.15s; }

.tool-card-compact .tool-card-content { padding: 1rem; }
.tool-card-compact .tool-card-header { flex-direction: row; align-items: center; }
.tool-card-compact .tool-avatar { width: 2.5rem; height: 2.5rem; font-size: 1.125rem; }
.tool-card-compact .tool-tagline { font-size: 0.75rem; }

.newsletter {
  background: var(--primary);
  color: var(--primary-foreground);
  text-align: center;
  padding: 3rem 1rem;
}
.newsletter-inner {
  max-width: 36rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.newsletter-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.8; }
.newsletter h2 { font-size: 1.5rem; font-weight: 700; }
@media (min-width: 640px) { .newsletter h2 { font-size: 1.875rem; } }
.newsletter p { margin-top: 0.5rem; opacity: 0.8; }
.newsletter-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  align-items: center;
  justify-content: center;
}
@media (min-width: 640px) {
  .newsletter-form { flex-direction: row; max-width: 28rem; justify-content: center; align-items: stretch; margin-left: auto; margin-right: auto; }
}
.newsletter-input {
  flex: 1;
  width: 100%;
  max-width: 100%;
  height: 3rem;
  padding: 0 1rem;
  border: none;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.1);
  color: var(--primary-foreground);
  font-size: 1rem;
}
.newsletter-input::placeholder { color: rgba(255,255,255,0.6); }
.newsletter-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}
.newsletter-btn {
  height: 3rem;
  padding: 0 1.5rem;
  background: var(--primary-foreground);
  color: var(--primary);
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}
.newsletter-btn:hover { opacity: 0.9; }

.newsletter-login-prompt {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.newsletter-login-prompt .newsletter-login-text {
  margin: 0;
  opacity: 0.9;
}
.newsletter-btn-inline {
  display: inline-block;
  text-decoration: none;
  line-height: 3rem;
  text-align: center;
}

.newsletter-subscribed {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem 1.5rem;
  background: rgba(255,255,255,0.12);
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.2);
  min-height: 3.5rem;
}
.newsletter-subscribed .newsletter-email {
  font-weight: 500;
  font-size: 1rem;
  color: var(--primary-foreground);
  letter-spacing: 0.01em;
}
.newsletter-subscribed .newsletter-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  background: rgba(34, 197, 94, 0.4);
  color: #fff;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}
.newsletter-subscribed .newsletter-status::before {
  content: '✓';
  font-weight: 700;
  font-size: 0.8rem;
  opacity: 0.95;
}
.newsletter-unsubscribe-btn {
  padding: 0.35rem 0.9rem;
  font-size: 0.875rem;
  color: var(--primary-foreground);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 0.5rem;
  cursor: pointer;
  opacity: 0.9;
}
.newsletter-unsubscribe-btn:hover {
  background: rgba(255,255,255,0.1);
  opacity: 1;
}
.newsletter-unsubscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
@media (max-width: 480px) {
  .newsletter-subscribed {
    flex-direction: column;
    padding: 1.25rem 1rem;
  }
}

.bookmark-btn {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.5;
}
.bookmark-btn:hover { opacity: 0.8; color: var(--foreground); }
.bookmark-btn.bookmarked { opacity: 1; color: var(--primary); }

/* Tools page */
.tools-layout { display: flex; gap: 2rem; flex-direction: column; }
@media (min-width: 1024px) { .tools-layout { flex-direction: row; } }
.tools-sidebar, .sidebar { width: 16rem; flex-shrink: 0; }
.tools-sidebar .card, .sidebar .card { padding: 1.25rem; }
.filter-title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem; font-weight: 600; }
.filter-group { margin-bottom: 1.5rem; }
.filter-group h4 { font-size: 0.875rem; font-weight: 500; margin-bottom: 0.75rem; }
.filter-option { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; cursor: pointer; }
.filter-option input { width: 1rem; height: 1rem; }
.filter-option span { font-size: 0.875rem; color: var(--muted-foreground); }
.tools-main { flex: 1; }
.search-row { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 640px) { .search-row { flex-direction: row; } }
.search-input-wrap { position: relative; flex: 1; }
.search-input-wrap input { width: 100%; height: 2.75rem; padding-left: 2.5rem; }
.search-input-wrap::before { content: '🔍'; position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); }
.tools-count { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 1rem; }
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; }

/* Categories page */
.categories-page .categories-grid { grid-template-columns: 1fr; }
@media (min-width: 768px) { .categories-page .categories-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .categories-page .categories-grid { grid-template-columns: repeat(3, 1fr); } }
.category-card-detail {
  display: block;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.category-card-detail:hover {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  border-color: rgba(99, 102, 241, 0.2);
}
.category-card-detail .category-icon {
  width: 4rem;
  height: 4rem;
  font-size: 2rem;
  border-radius: 1rem;
}
.category-card-detail h2 { margin-top: 1rem; font-size: 1.25rem; font-weight: 600; }
.category-card-detail > p { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.category-meta { margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; }
.category-meta span { font-size: 0.875rem; font-weight: 500; color: var(--primary); }
.category-preview { margin-top: 1rem; display: flex; }
.category-preview .avatar {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--muted);
  color: var(--muted-foreground);
  border-radius: 50%;
  border: 2px solid var(--card);
  margin-left: -0.5rem;
}
.category-preview .avatar:first-child { margin-left: 0; }

/* Submit page */
.submit-page { max-width: 48rem; margin: 0 auto; }
.submit-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 1rem;
}
.submit-form .card { padding: 1.5rem; }
.submit-form .card-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.25rem; }
.submit-form .card-desc { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 1.5rem; }
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s;
}
.upload-zone:hover { border-color: rgba(99, 102, 241, 0.5); }
.upload-zone .icon { font-size: 2rem; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.upload-zone p { font-size: 0.875rem; color: var(--muted-foreground); }
.upload-zone .hint { font-size: 0.75rem; margin-top: 0.25rem; }
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }

/* Pricing page */
.pricing-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
}
.pricing-badge-popular {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 9999px;
}
.pricing-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--muted);
  color: var(--muted-foreground);
  border-radius: 1rem;
}
.pricing-card.featured .pricing-icon {
  background: var(--primary);
  color: var(--primary-foreground);
}
.pricing-card h3 { font-size: 1.25rem; font-weight: 600; text-align: center; }
.pricing-card .desc { font-size: 0.875rem; color: var(--muted-foreground); text-align: center; margin-top: 0.25rem; }
.pricing-price { text-align: center; margin: 1rem 0; }
.pricing-price .amount { font-size: 2.25rem; font-weight: 700; }
.pricing-price .period { color: var(--muted-foreground); }
.pricing-features { list-style: none; }
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.pricing-features li::before { content: '✓'; color: var(--accent); font-weight: bold; }
.pricing-cta { margin-top: auto; padding-top: 1.5rem; }
.faq-section { margin-top: 4rem; }
.faq-section h2 { text-align: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 2rem; }
.faq-list { max-width: 48rem; margin: 0 auto; }
.faq-item { margin-bottom: 1rem; }
.faq-item .card { padding: 1.5rem; }
.faq-item h3 { font-size: 1rem; font-weight: 600; }
.faq-item p { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }

.tool-comment-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.comment-avatar-wrap {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
}
.comment-avatar-wrap img,
.comment-avatar {
  width: 2.5rem !important;
  height: 2.5rem !important;
  min-width: 2.5rem;
  min-height: 2.5rem;
  max-width: 2.5rem;
  max-height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.comment-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 600;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 0.25rem; }
.comment-content { line-height: 1.6; font-size: 0.9375rem; }
