/* ============================================
   TOOL DETAIL PAGE STYLES
   /tool/:slug
   ============================================ */

/* === Layout === */
.tool-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.tool-page-section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tool-page-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-page-section h2 .section-icon {
  font-size: 1.125rem;
}

/* === Hero === */
.tool-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
}

.tool-hero-logo {
  font-size: 3rem;
  line-height: 1;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 1rem;
}

.tool-hero-info {
  flex: 1;
  min-width: 0;
}

.tool-hero-name {
  font-size: 2rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.tool-hero-category {
  display: inline-block;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.tool-hero-description {
  color: #6b7280;
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

.tool-hero-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tool-hero-link {
  font-size: 0.875rem;
  color: #2563eb;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tool-hero-link:hover {
  text-decoration: underline;
}

/* === Vibe Score === */
.vibe-score-container {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.vibe-score-gauge {
  flex-shrink: 0;
  position: relative;
  width: 120px;
  height: 120px;
}

.vibe-score-gauge svg {
  transform: rotate(-90deg);
}

.vibe-score-gauge .gauge-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 8;
}

.vibe-score-gauge .gauge-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease-out;
}

.vibe-score-gauge .gauge-fill.score-high { stroke: #10b981; }
.vibe-score-gauge .gauge-fill.score-mid { stroke: #f59e0b; }
.vibe-score-gauge .gauge-fill.score-low { stroke: #ef4444; }

.vibe-score-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 800;
  color: #111827;
}

.vibe-score-label {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.625rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.vibe-score-breakdown {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vibe-component {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vibe-component-label {
  font-size: 0.8125rem;
  color: #6b7280;
  min-width: 130px;
  white-space: nowrap;
}

.vibe-component-bar {
  flex: 1;
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.vibe-component-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.5s ease-out;
}

.vibe-component-fill.comp-downloads { background: #10b981; }
.vibe-component-fill.comp-github { background: #3b82f6; }
.vibe-component-fill.comp-community { background: #8b5cf6; }
.vibe-component-fill.comp-benchmarks { background: #f59e0b; }

.vibe-component-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  min-width: 28px;
  text-align: right;
}

/* === Charts === */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.no-data-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #9ca3af;
  font-size: 0.9375rem;
}

/* === Sentiment === */
.sentiment-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.sentiment-chart-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}

.sentiment-mentions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mention-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.mention-source {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 60px;
}

.mention-source.reddit { color: #ff4500; }
.mention-source.hackernews { color: #ff6600; }
.mention-source.stackoverflow { color: #f48024; }

.mention-title {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.4;
  flex: 1;
}

.mention-title a {
  color: inherit;
  text-decoration: none;
}

.mention-title a:hover {
  color: #2563eb;
}

.mention-score {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

/* === Benchmarks === */
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
}

.benchmark-table th,
.benchmark-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.benchmark-table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.benchmark-table td {
  font-size: 0.875rem;
  color: #374151;
}

.benchmark-score {
  font-weight: 700;
  font-size: 1rem;
}

.velocity-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
}

.velocity-badge.positive {
  background: #dcfce7;
  color: #16a34a;
}

.velocity-badge.negative {
  background: #fee2e2;
  color: #dc2626;
}

.velocity-badge.neutral {
  background: #f3f4f6;
  color: #6b7280;
}

/* === Pricing === */
.pricing-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.pricing-tier-card {
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.2s;
}

.pricing-tier-card:hover {
  border-color: #2563eb;
}

.pricing-tier-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.pricing-tier-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.25rem;
}

.pricing-tier-price .billing-cycle {
  font-size: 0.875rem;
  font-weight: 400;
  color: #6b7280;
}

.pricing-tier-features {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  text-align: left;
}

.pricing-tier-features li {
  font-size: 0.8125rem;
  color: #6b7280;
  padding: 0.25rem 0;
}

.pricing-tier-features li::before {
  content: "\2713 ";
  color: #10b981;
  font-weight: 600;
}

.pricing-history-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #2563eb;
  text-decoration: none;
}

.pricing-history-link:hover {
  text-decoration: underline;
}

/* === Compare === */
.compare-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.compare-select {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: white;
  color: #374151;
  min-width: 200px;
}

.compare-remove-btn {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  display: none;
}

.compare-remove-btn.visible {
  display: inline-block;
}

.compare-status {
  font-size: 0.875rem;
  color: #6b7280;
}

/* === Related Tools === */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.related-tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, box-shadow 0.2s;
}

.related-tool-card:hover {
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.related-tool-emoji {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.related-tool-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  text-align: center;
}

.related-tool-category {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

/* === Pro Gate Overlay === */
.pro-gated {
  position: relative;
}

.pro-gated-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  border-radius: 0.75rem;
  z-index: 10;
}

.pro-gate-message {
  text-align: center;
  padding: 1.5rem;
}

.pro-gate-message .lock-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.pro-gate-message p {
  font-size: 0.9375rem;
  color: #374151;
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.pro-gate-cta {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
}

.pro-gate-cta:hover {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* === 404 === */
.tool-404 {
  text-align: center;
  padding: 6rem 2rem;
}

.tool-404 h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.5rem;
}

.tool-404 p {
  font-size: 1.125rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

.tool-404 a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.tool-404 a:hover {
  text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 767px) {
  .tool-page {
    padding: 1rem 1rem 5rem;
  }

  .tool-page-section {
    padding: 1rem;
  }

  .tool-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
  }

  .tool-hero-name {
    font-size: 1.5rem;
  }

  .tool-hero-links {
    justify-content: center;
  }

  .vibe-score-container {
    flex-direction: column;
    align-items: center;
  }

  .vibe-component-label {
    min-width: 100px;
    font-size: 0.75rem;
  }

  .chart-container {
    height: 220px;
  }

  .sentiment-grid {
    grid-template-columns: 1fr;
  }

  .sentiment-chart-wrap {
    margin: 0 auto;
  }

  .pricing-tiers-grid {
    grid-template-columns: 1fr;
  }

  .related-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .compare-select {
    min-width: 100%;
  }

  .benchmark-table {
    font-size: 0.8125rem;
  }

  .benchmark-table th,
  .benchmark-table td {
    padding: 0.5rem;
  }
}
