/* ==========================================================================
   CSSCraft – Free CSS Design Toolkit
   Homepage Stylesheet (home.css)
   ========================================================================== */

/* Hero Section */
.hero-section {
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-background-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.1) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
}

.hero-container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  margin-bottom: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  background: var(--brand-primary-light);
  border: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 8px var(--brand-primary);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.hero-title-highlight {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subheading {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Search & Filter */
.hero-search-wrapper {
  max-width: 580px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3.25rem;
  font-size: 1.0625rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.hero-search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--brand-glow), var(--shadow-xl);
}

.hero-search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.hero-quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.quick-tag {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.quick-tag:hover, .quick-tag.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* Tools Directory Section */
.tools-directory {
  padding: 4rem 0;
}

.directory-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.directory-title-wrap h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.directory-title-wrap p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Tools Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.filter-tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--brand-primary);
  color: #ffffff;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-xl);
}

.tool-card-preview {
  height: 160px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

/* Live Card Miniature Previews */
.card-preview-image-gradient {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 50%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-preview-image-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: 
    radial-gradient(circle at 70% 30%, #fef08a 0%, transparent 25%),
    linear-gradient(180deg, #38bdf8 0%, #f472b6 60%, #fb923c 100%);
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.card-preview-image-gradient::after {
  content: 'IMG ⇄ GRAD';
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  z-index: 2;
}

.card-preview-gradient {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f59e0b 100%);
}

.card-preview-mesh {
  width: 100%;
  height: 100%;
  background-color: #6366f1;
  background-image: 
    radial-gradient(at 10% 20%, #ec4899 0px, transparent 50%),
    radial-gradient(at 80% 0%, #38bdf8 0px, transparent 50%),
    radial-gradient(at 0% 90%, #a855f7 0px, transparent 50%),
    radial-gradient(at 90% 90%, #f59e0b 0px, transparent 50%);
}

.card-preview-pattern {
  width: 100%;
  height: 100%;
  background-color: #0f172a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.25) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
}

.card-preview-shadow {
  width: 80px;
  height: 80px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.35);
}

[data-theme="dark"] .card-preview-shadow {
  background: #1e293b;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
}

.card-preview-border {
  width: 80px;
  height: 80px;
  background: var(--bg-secondary);
  border: 4px dashed #6366f1;
  border-radius: 20px 8px 30px 12px;
}

.card-preview-glass {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-mini-chip {
  width: 140px;
  height: 60px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
}

.card-preview-neumorph {
  width: 100%;
  height: 100%;
  background: #e0e5ec;
  display: flex;
  align-items: center;
  justify-content: center;
}

.neumorph-mini-chip {
  width: 80px;
  height: 80px;
  background: #e0e5ec;
  border-radius: 16px;
  box-shadow: 8px 8px 16px #b8b9be, -8px -8px 16px #ffffff;
}

.card-preview-text-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.text-gradient-mini {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tool-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

.tool-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.tool-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.tool-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.tool-btn-open {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-primary);
  transition: gap var(--transition-fast);
}

.tool-btn-open:hover {
  gap: 0.55rem;
}

/* Why Choose Section */
.why-section {
  padding: 5rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.why-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.why-header h2 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.why-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.why-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  transition: all var(--transition-fast);
}

.why-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.why-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px var(--brand-glow);
}

.why-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.why-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* CTA Section */
.cta-section {
  padding: 5rem 0;
}

.cta-banner {
  background: var(--brand-gradient);
  border-radius: var(--radius-xl);
  padding: 4rem 2rem;
  text-align: center;
  color: #ffffff;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.cta-banner h2 {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cta-banner p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  opacity: 0.92;
}

.cta-btn-white {
  background: #ffffff;
  color: var(--brand-primary);
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-fast);
}

.cta-btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subheading {
    font-size: 1.0625rem;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .cta-banner h2 {
    font-size: 1.875rem;
  }
}
