/* ==========================================================================
   Monetization Components - Comparison Tables & Product Recommendations
   ========================================================================== */

/* --------------------------------------------------------------------------
   Comparison Table
   -------------------------------------------------------------------------- */

.comparison-section {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--color-surface, #f8f9fa);
  border-radius: var(--radius-medium, 12px);
  border: 1px solid var(--color-border, #e0e0e0);
}

.comparison-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  color: var(--color-text, #333);
}

.comparison-subtitle {
  color: var(--color-text-muted, #666);
  margin: 0 0 1.5rem 0;
}

.comparison-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.comparison-header {
  text-align: left;
  padding: 1rem;
  background: var(--color-primary, #4a6fa5);
  color: white;
  font-weight: 600;
  white-space: nowrap;
}

.comparison-header:first-child {
  border-radius: var(--radius-small, 8px) 0 0 0;
}

.comparison-header:last-child {
  border-radius: 0 var(--radius-small, 8px) 0 0;
}

.comparison-row {
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.comparison-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.comparison-current {
  background: rgba(var(--color-primary-rgb, 74, 111, 165), 0.08);
}

.comparison-current:hover {
  background: rgba(var(--color-primary-rgb, 74, 111, 165), 0.12);
}

.comparison-row td {
  padding: 1rem;
  vertical-align: middle;
}

.comparison-product-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.comparison-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--radius-small, 4px);
  background: white;
  padding: 4px;
  border: 1px solid var(--color-border, #e0e0e0);
}

.comparison-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.comparison-name {
  font-weight: 500;
  color: var(--color-text, #333);
  line-height: 1.3;
}

.comparison-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: var(--color-primary, #4a6fa5);
  color: white;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.rating-stars {
  color: #f5a623;
  font-weight: 600;
}

.comparison-reviews {
  color: var(--color-text-muted, #666);
}

/* Price tier badges */
.tier-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: capitalize;
}

.tier-budget {
  background: #e8f5e9;
  color: #2e7d32;
}

.tier-mid-range {
  background: #e3f2fd;
  color: #1565c0;
}

.tier-premium {
  background: #fce4ec;
  color: #c2185b;
}

/* Amazon buttons */
.btn-amazon {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: #ff9900;
  color: #111;
  text-decoration: none;
  border-radius: var(--radius-button, 6px);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-amazon:hover {
  background: #e88a00;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.4);
}

.btn-amazon-alt {
  background: #232f3e;
  color: white;
}

.btn-amazon-alt:hover {
  background: #37475a;
  box-shadow: 0 2px 8px rgba(35, 47, 62, 0.4);
}

.comparison-disclaimer {
  margin-top: 1rem;
  color: var(--color-text-muted, #888);
  font-size: 0.8rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .comparison-section {
    padding: 1rem;
    margin: 2rem -1rem;
    border-radius: 0;
  }

  .comparison-table {
    font-size: 0.85rem;
  }

  .comparison-row td {
    padding: 0.75rem 0.5rem;
  }

  .comparison-image {
    width: 50px;
    height: 50px;
  }

  .comparison-name {
    font-size: 0.9rem;
  }

  .btn-amazon {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* --------------------------------------------------------------------------
   Related Products Grid
   -------------------------------------------------------------------------- */

.related-products {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--color-surface, #f8f9fa);
  border-radius: var(--radius-medium, 12px);
}

.related-title {
  font-size: 1.25rem;
  margin: 0 0 1.5rem 0;
  color: var(--color-text, #333);
}

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

.related-card {
  background: white;
  border-radius: var(--radius-small, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-small, 0 2px 4px rgba(0,0,0,0.08));
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.related-card:hover {
  box-shadow: var(--shadow-medium, 0 4px 12px rgba(0,0,0,0.12));
  transform: translateY(-2px);
}

.related-image-link {
  display: block;
  padding: 1rem;
  background: white;
  text-align: center;
}

.related-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.related-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.related-name {
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.4;
}

.related-name a {
  color: var(--color-text, #333);
  text-decoration: none;
}

.related-name a:hover {
  color: var(--color-primary, #4a6fa5);
}

.related-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.related-rating {
  color: #f5a623;
  font-weight: 600;
}

.related-reviews {
  color: var(--color-text-muted, #888);
}

.related-tier {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  width: fit-content;
}

.related-btn {
  display: inline-block;
  margin-top: auto;
  padding: 0.5rem 1rem;
  background: var(--color-primary, #4a6fa5);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-button, 6px);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  transition: background 0.2s;
}

.related-btn:hover {
  background: var(--color-primary-dark, #3a5a8a);
}

.related-disclaimer {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--color-text-muted, #888);
}

/* Sidebar variant */
.related-products.sidebar-layout {
  padding: 1.5rem;
}

.related-products.sidebar-layout .related-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
}

.related-products.sidebar-layout .related-card {
  flex-direction: row;
  align-items: center;
}

.related-products.sidebar-layout .related-image-link {
  padding: 0.5rem;
  flex-shrink: 0;
  width: 80px;
}

.related-products.sidebar-layout .related-image {
  height: 60px;
  width: 60px;
}

.related-products.sidebar-layout .related-info {
  padding: 0.75rem;
}

.related-products.sidebar-layout .related-name {
  font-size: 0.85rem;
}

.related-products.sidebar-layout .related-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   In-Article Product Callout
   -------------------------------------------------------------------------- */

.product-callout {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--color-surface, #f8f9fa) 0%, #fff 100%);
  border: 2px solid var(--color-primary, #4a6fa5);
  border-radius: var(--radius-medium, 12px);
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.product-callout-image {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: white;
  padding: 8px;
  border-radius: var(--radius-small, 8px);
}

.product-callout-content {
  flex: 1;
}

.product-callout-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-primary, #4a6fa5);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-callout-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--color-text, #333);
}

.product-callout-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.product-callout .btn-amazon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .product-callout {
    flex-direction: column;
    text-align: center;
  }

  .product-callout-meta {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Ad Slots - Display Ads and Native Ads
   -------------------------------------------------------------------------- */

.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem auto;
  max-width: 100%;
  overflow: hidden;
}

.ad-slot--header {
  margin: 1rem auto 0;
  padding: 0.5rem 0;
  background: var(--color-surface, #f8f9fa);
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.ad-slot--sidebar {
  margin: 0 0 1.5rem 0;
}

.ad-slot--sidebar.sticky {
  position: sticky;
  top: 1rem;
}

.ad-slot--inArticle {
  margin: 2rem auto;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border, #e0e0e0);
  border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.ad-slot--belowArticle {
  margin: 2rem auto;
  padding: 1.5rem 0;
  background: var(--color-surface, #f8f9fa);
  border-radius: var(--radius-medium, 12px);
}

.ad-slot--beforeFooter {
  margin: 0;
  padding: 1.5rem 0;
  background: var(--color-surface, #f8f9fa);
  border-top: 1px solid var(--color-border, #e0e0e0);
}

/* Native ads */
.native-ad {
  margin: 2rem auto;
  max-width: 100%;
}

.native-ad--taboola,
.native-ad--outbrain {
  padding: 1rem 0;
  border-top: 1px solid var(--color-border, #e0e0e0);
}

/* Ad label (optional - for transparency) */
.ad-slot::before {
  content: "";
  /* Uncomment below to show "Advertisement" label */
  /* content: "Advertisement";
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  text-align: center; */
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ad-slot--header {
    margin: 0.5rem 0;
  }

  .ad-slot--inArticle {
    margin: 1.5rem -1rem;
    padding: 1rem;
  }

  .ad-slot--belowArticle {
    margin: 1.5rem -1rem;
    border-radius: 0;
  }

  .ad-slot--sidebar {
    display: none; /* Hide sidebar ads on mobile */
  }
}

/* --------------------------------------------------------------------------
   Debug Mode - Red Placeholder Boxes
   -------------------------------------------------------------------------- */

.ad-debug-placeholder {
  background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
  border: 3px dashed #990000;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: white;
  font-family: monospace;
  text-align: center;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
}

.ad-debug-placeholder--native {
  background: linear-gradient(135deg, #ff6600 0%, #cc4400 100%);
  border-color: #994400;
}

.ad-debug-label {
  font-size: 1.2rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.ad-debug-size {
  font-size: 0.9rem;
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.ad-debug-format {
  font-size: 0.75rem;
  opacity: 0.8;
  text-transform: uppercase;
}

.ad-slot--debug {
  background: transparent;
  border: none;
}

/* Debug mode indicator in corner */
.ad-slot--debug::after {
  content: "DEBUG";
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.6rem;
  background: #000;
  color: #ff4444;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  font-weight: bold;
}

.native-ad--debug {
  margin: 2rem 0;
}
