/* Fee Comparator Styles */
/* Mobile-first approach using CSS variables from variables.css */

:root {
  --header-height: 80px;
}

.fee-comparator-section {
  padding: 120px 16px 24px 16px; /* header-height + extra clearance */
  min-height: 100vh;
  background: var(--bg-primary, #ffffff);
}

.comparator-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Header Styles */
.comparator-header {
  text-align: center;
  margin-bottom: 24px;
}

.comparator-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin-bottom: 12px;
}

.comparator-subtitle {
  font-size: 1rem;
  color: var(--text-secondary, #666);
}

@media (min-width: 768px) {
  .fee-comparator-section {
    padding: 60px 20px;
  }

  .comparator-header {
    margin-bottom: 32px;
  }

  .comparator-title {
    font-size: 2.5rem;
  }

  .comparator-subtitle {
    font-size: 1.125rem;
  }
}

/* Glass Card Base */
.glass-card {
  padding: 20px 16px;
  border-radius: 12px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
  box-shadow: var(--card-shadow, 0 5px 15px rgba(0, 0, 0, 0.05));
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .glass-card {
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
  }
}

/* Price Input Section */
.price-input-section {
  text-align: center;
}

.input-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 12px;
}

.price-input-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
}

.input-prefix {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-green, #039139);
}

#sale-price {
  width: 120px;
  padding: 10px 12px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid var(--input-border, #ddd);
  border-radius: 12px;
  background: var(--input-bg, #fff);
  color: var(--text-primary, #333);
  transition: border-color 0.2s ease;
  -moz-appearance: textfield;
}

@media (min-width: 768px) {
  .input-label {
    margin-bottom: 16px;
  }

  .price-input-wrapper {
    margin-bottom: 24px;
  }

  .input-prefix {
    font-size: 2rem;
  }

  #sale-price {
    width: 180px;
    padding: 12px 16px;
    font-size: 2rem;
  }
}

#sale-price::-webkit-outer-spin-button,
#sale-price::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#sale-price:focus {
  outline: none;
  border-color: var(--primary-green, #039139);
}

/* Price Slider */
.price-slider-wrapper {
  max-width: 400px;
  margin: 0 auto;
}

#price-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border-color, #e8e8e8);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

#price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-green, #039139);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

#price-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

#price-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-green, #039139);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary, #666);
}

.slider-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  margin-top: 8px;
  font-style: italic;
}

/* Sort Controls */
.sort-controls-section {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary, #666);
}

.sort-select {
  padding: 10px 36px 10px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--input-border, #ddd);
  border-radius: 8px;
  background: var(--input-bg, #fff);
  color: var(--text-primary, #333);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-green, #039139);
}

@media (min-width: 768px) {
  .sort-controls-section {
    justify-content: flex-end;
  }
}

/* Comparison Table */
.comparison-section {
  overflow: hidden;
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin: -20px -16px;
  padding: 20px 16px;
}

.fee-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  table-layout: auto;
}

.fee-comparison-table th,
.fee-comparison-table td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #eee);
}

.fee-comparison-table th {
  font-weight: 600;
  color: var(--text-secondary, #666);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.fee-comparison-table tbody tr {
  transition: background 0.2s ease;
}

.fee-comparison-table tbody tr:hover {
  background: rgba(3, 145, 57, 0.03);
}

.fee-comparison-table tbody tr.lowest-fee {
  background: rgba(3, 145, 57, 0.08);
}

.fee-comparison-table tbody tr.highest-fee {
  background: rgba(220, 53, 69, 0.04);
}

/* Table Cells */
.platform-cell {
  font-weight: 600;
  color: var(--text-primary, #333);
}

.platform-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.platform-link:hover {
  color: var(--primary-green, #039139);
}

.platform-link:hover .external-icon {
  opacity: 1;
}

.platform-icon {
  width: 14px;
  height: 14px;
  max-width: 14px;
  max-height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

.platform-name {
  white-space: nowrap;
}

.platform-cell {
  text-align: left;
}

.fee-cell,
.you-keep-cell {
  text-align: right;
  white-space: nowrap;
}

.external-icon {
  display: none;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

@media (min-width: 768px) {
  .external-icon {
    display: block;
  }
}

/* Hide less important columns on mobile */
.fee-formula-cell,
.fee-bar-column,
.benefits-column,
.benefits-cell,
.effective-column,
.effective-cell {
  display: none;
}

.fee-cell {
  font-weight: 700;
  color: var(--text-primary, #333);
}

.fee-cell.zero-fee {
  color: var(--primary-green, #039139);
}

.effective-cell {
  color: var(--text-secondary, #666);
}

.you-keep-cell {
  font-weight: 600;
  color: var(--primary-green, #039139);
}

/* Fee Bar Column */
.fee-bar-column {
  width: 100px;
}

.fee-bar-container {
  position: relative;
  height: 16px;
  background: var(--border-color, #f0f0f0);
  border-radius: 4px;
  overflow: hidden;
}

.fee-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
  min-width: 2px;
}

@media (min-width: 768px) {
  .comparison-table-wrapper {
    margin: -28px;
    padding: 28px;
  }

  .fee-comparison-table {
    font-size: 0.9375rem;
    table-layout: auto;
  }

  .fee-comparison-table th,
  .fee-comparison-table td {
    padding: 16px 14px;
    overflow: visible;
  }

  .fee-comparison-table th {
    font-size: 0.8125rem;
  }

  .platform-cell {
    width: auto;
    min-width: auto;
  }

  .platform-link {
    gap: 10px;
  }

  .platform-icon {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
  }

  .fee-cell,
  .you-keep-cell {
    text-align: left;
  }

  .platform-name {
    white-space: nowrap;
  }

  .fee-formula-cell,
  .fee-bar-column,
  .benefits-column,
  .benefits-cell,
  .effective-column,
  .effective-cell {
    display: table-cell;
  }

  .fee-formula-cell {
    color: var(--text-secondary, #666);
    font-size: 0.875rem;
  }

  .benefits-column,
  .benefits-cell {
    max-width: 200px;
    font-size: 0.75rem;
    color: var(--text-secondary, #666);
    line-height: 1.4;
  }
}

/* Insights Section */
.insights-section {
  padding: 24px 16px;
}

.insights-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin-bottom: 20px;
  text-align: center;
}

.insights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.insight-card {
  padding: 16px;
  background: var(--bg-secondary, #f8f9fa);
  border-radius: 12px;
  text-align: center;
}

.insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  background: rgba(3, 145, 57, 0.1);
  color: var(--primary-green, #039139);
  border-radius: 12px;
}

.insight-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 8px;
}

.insight-description {
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .insights-section {
    padding: 32px;
  }

  .insights-heading {
    font-size: 1.5rem;
    margin-bottom: 24px;
  }

  .insights-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .insight-card {
    padding: 20px;
  }

  .insight-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
  }
}

/* Share Section */
.share-section {
  text-align: center;
  padding: 20px 16px;
}

.share-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-bottom: 14px;
}

.share-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.share-btn.primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary-green, #039139);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn.primary:hover {
  background: var(--primary-green-hover, #027a30);
  transform: translateY(-2px);
}

.copied-feedback {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-green, #039139);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.copied-feedback.visible {
  opacity: 1;
}

.social-share-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.social-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-share-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

.social-share-btn.twitter { background: #000000; }
.social-share-btn.facebook { background: #1877F2; }
.social-share-btn.linkedin { background: #0A66C2; }
.social-share-btn.whatsapp { background: #25D366; }
.social-share-btn.native-share {
  background: var(--primary-green, #039139);
  border: none;
  cursor: pointer;
}

@media (min-width: 768px) {
  .share-section {
    padding: 24px 28px;
  }

  .share-heading {
    font-size: 1.125rem;
    margin-bottom: 16px;
  }

  .share-buttons {
    gap: 12px;
    margin-bottom: 16px;
  }

  .share-btn.primary {
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
  }

  .social-share-buttons {
    gap: 12px;
  }

  .social-share-btn {
    width: 44px;
    height: 44px;
  }
}

/* CTA Section */
.comparator-cta {
  text-align: center;
  padding: 28px 16px;
  background: linear-gradient(135deg, rgba(3, 145, 57, 0.05), rgba(3, 145, 57, 0.1));
}

.comparator-cta .cta-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #333);
  margin-bottom: 10px;
}

.comparator-cta .cta-description {
  font-size: 0.9375rem;
  color: var(--text-secondary, #666);
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.comparator-cta .cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary-green, #039139);
  border: none;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.comparator-cta .cta-button:hover {
  background: var(--primary-green-hover, #027a30);
  transform: translateY(-2px);
}

.comparator-cta .app-badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.comparator-cta .app-badge {
  height: 40px;
  transition: transform 0.2s ease;
}

.comparator-cta .app-badge:hover {
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .comparator-cta {
    padding: 36px 28px;
  }

  .comparator-cta .cta-heading {
    font-size: 1.5rem;
    margin-bottom: 12px;
  }

  .comparator-cta .cta-description {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .comparator-cta .cta-button {
    width: auto;
    padding: 16px 32px;
    font-size: 1.125rem;
  }

  .comparator-cta .app-badges {
    flex-direction: row;
    gap: 16px;
    margin-top: 20px;
  }

  .comparator-cta .app-badge {
    height: 44px;
  }
}

/* FAQ styles now in site.css */

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Dark Mode Support */
[data-theme="dark"] .glass-card {
  background: var(--glass-bg, rgba(26, 26, 26, 0.9));
  border-color: var(--glass-border, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] #sale-price {
  background: var(--input-bg, #1a1a1a);
  border-color: var(--input-border, #333);
}

[data-theme="dark"] #price-slider {
  background: var(--border-color, #444);
}

[data-theme="dark"] .sort-select {
  background: var(--input-bg, #1a1a1a);
  border-color: var(--input-border, #333);
}

[data-theme="dark"] .insight-card {
  background: var(--bg-secondary, #1a1a1a);
}

[data-theme="dark"] .comparator-cta {
  background: linear-gradient(135deg, rgba(4, 182, 71, 0.1), rgba(4, 182, 71, 0.15));
}

[data-theme="dark"] .fee-bar-container {
  background: var(--border-color, #333);
}
