/**
 * Comparison Table Styles
 * 
 * Usage: Add class "comparison-table" to your table element OR container
 * Example: <table class="comparison-table">...</table>
 * Or in Page Builder: Add "comparison-table minimal" to Extra Class Name
 */

/* Base Table Styles */
.comparison-table table,
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2rem 0;
  font-family: 'Neue Montreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  overflow: visible;
  background: #fff;
}

/* Ensure table itself has no extra borders */
.comparison-table table,
.wpb_text_column.comparison-table table {
  border: none !important;
}

/* Force left alignment for all table content */
.comparison-table table,
.comparison-table table td,
.comparison-table table th,
.comparison-table td,
.comparison-table th {
  text-align: left !important;
}

/* Header Styles */
.comparison-table table thead,
.comparison-table thead,
.wpb_text_column.comparison-table table thead {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%) !important;
  color: #fff !important;
}

.comparison-table table thead tr td,
.comparison-table table thead tr th,
.comparison-table thead tr td,
.comparison-table thead tr th,
.wpb_text_column.comparison-table table thead tr td,
.wpb_text_column.comparison-table table thead tr th {
  padding: 2.5rem 2rem !important;
  text-align: left !important;
  font-weight: 700 !important;
  font-size: 1.2rem !important;
  letter-spacing: 0.01em;
  border: none !important;
  vertical-align: middle;
}

.comparison-table table thead tr td:first-child,
.comparison-table table thead tr th:first-child,
.comparison-table thead tr td:first-child,
.comparison-table thead tr th:first-child {
  border-top-left-radius: 12px;
}

.comparison-table table thead tr td:last-child,
.comparison-table table thead tr th:last-child,
.comparison-table thead tr td:last-child,
.comparison-table thead tr th:last-child {
  border-top-right-radius: 12px;
}

/* Body Styles */
.comparison-table table tbody tr,
.comparison-table tbody tr,
.wpb_text_column.comparison-table table tbody tr {
  transition: all 0.3s ease;
}

.comparison-table table tbody tr:hover,
.comparison-table tbody tr:hover,
.wpb_text_column.comparison-table table tbody tr:hover {
  background-color: #fafbfc;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.comparison-table table tbody tr td,
.comparison-table tbody tr td,
.wpb_text_column.comparison-table table tbody tr td {
  padding: 1.75rem 2rem !important;
  border-bottom: 1px solid #f0f0f0 !important;
  font-size: 1rem !important;
  line-height: 1.7;
  vertical-align: middle;
  text-align: left !important;
}

/* First Column (Criteria) */
.comparison-table table tbody tr td:first-child,
.comparison-table tbody tr td:first-child,
.wpb_text_column.comparison-table table tbody tr td:first-child {
  font-weight: 700;
  color: #0a0a0a;
  background-color: #fafbfc;
  border-right: 1px solid #e8e8e8;
  font-size: 1.05rem;
}

/* Remove border from last row - MUST come after general td styles */
.comparison-table table tbody tr:last-child td,
.comparison-table tbody tr:last-child td,
.wpb_text_column.comparison-table table tbody tr:last-child td {
  border-bottom: 0 !important;
  padding-bottom: 1.75rem !important;
}

/* Ensure last row has proper bottom radius */
.comparison-table table tbody tr:last-child td:first-child,
.comparison-table tbody tr:last-child td:first-child,
.wpb_text_column.comparison-table table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 16px;
}

.comparison-table table tbody tr:last-child td:last-child,
.comparison-table tbody tr:last-child td:last-child,
.wpb_text_column.comparison-table table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}

/* Ensure no double borders on table wrapper */
.comparison-table.wpb_text_column,
.wpb_text_column.comparison-table {
  border: none !important;
  padding: 0 !important;
}

/* Highlight Column (for emphasized content) */
.comparison-table table tbody tr td:last-child,
.comparison-table tbody tr td:last-child {
  background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
  font-weight: 600;
  position: relative;
}

.comparison-table table tbody tr:hover td:last-child,
.comparison-table tbody tr:hover td:last-child {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f3ff 100%);
}

/* Strong text in cells */
.comparison-table table td strong,
.comparison-table td strong {
  color: #0a0a0a;
  font-weight: 700;
}

/* Second column styling */
.comparison-table table tbody tr td:nth-child(2),
.comparison-table tbody tr td:nth-child(2) {
  color: #666;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
  /* Tablet: Reduce padding and font sizes */
  .comparison-table table,
  .comparison-table,
  .comparison-table.minimal table,
  .comparison-table.minimal {
    font-size: 0.95rem;
  }
  
  .comparison-table table thead tr td,
  .comparison-table table thead tr th,
  .comparison-table thead tr td,
  .comparison-table thead tr th,
  .wpb_text_column.comparison-table table thead tr td,
  .wpb_text_column.comparison-table table thead tr th {
    padding: 1.5rem 1rem !important;
    font-size: 1rem !important;
  }
  
  .comparison-table table tbody tr td,
  .comparison-table tbody tr td,
  .wpb_text_column.comparison-table table tbody tr td {
    padding: 1.25rem 1rem !important;
    font-size: 0.95rem !important;
  }
}

@media screen and (max-width: 768px) {
  /* Mobile: Stack table or make it scrollable */
  .comparison-table table,
  .comparison-table,
  .comparison-table.minimal table,
  .comparison-table.minimal {
    font-size: 0.85rem;
    border-radius: 8px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .comparison-table table thead tr td,
  .comparison-table table thead tr th,
  .comparison-table thead tr td,
  .comparison-table thead tr th,
  .wpb_text_column.comparison-table table thead tr td,
  .wpb_text_column.comparison-table table thead tr th {
    padding: 1rem 0.75rem !important;
    font-size: 0.9rem !important;
  }
  
  .comparison-table table tbody tr td,
  .comparison-table tbody tr td,
  .wpb_text_column.comparison-table table tbody tr td {
    padding: 1rem 0.75rem !important;
    font-size: 0.85rem !important;
  }
  
  /* Make table scrollable on mobile */
  .comparison-table table,
  .wpb_text_column.comparison-table table {
    min-width: 600px;
    display: table;
  }
}
  
  /* Stack table on mobile if needed */
  .comparison-table.mobile-stack {
    display: block;
  }
  
  .comparison-table.mobile-stack thead,
  .comparison-table.mobile-stack tbody,
  .comparison-table.mobile-stack tr,
  .comparison-table.mobile-stack td {
    display: block;
    width: 100%;
  }
  
  .comparison-table.mobile-stack thead {
    display: none;
  }
  
  .comparison-table.mobile-stack tbody tr {
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
  }
  
  .comparison-table.mobile-stack tbody tr td {
    text-align: left;
    padding-left: 50%;
    position: relative;
    border: none;
    border-bottom: 1px solid #e9ecef;
  }
  
  .comparison-table.mobile-stack tbody tr td:last-child {
    border-bottom: none;
  }
  
  .comparison-table.mobile-stack tbody tr td:before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: 600;
    color: #2d2d44;
  }
}

/* Alternative Color Schemes */

/* Green Highlight Variant */
.comparison-table.green-highlight table tbody tr td:last-child,
.comparison-table.green-highlight tbody tr td:last-child {
  background-color: #f0fdf4;
}

.comparison-table.green-highlight table tbody tr:hover td:last-child,
.comparison-table.green-highlight tbody tr:hover td:last-child {
  background-color: #dcfce7;
}

/* Accent Color Variant */
.comparison-table.accent-header table thead,
.comparison-table.accent-header thead {
  background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
}

/* Minimal Variant */
.comparison-table.minimal table,
.comparison-table.minimal,
.wpb_text_column.comparison-table.minimal table {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
}

.comparison-table.minimal table tbody tr:hover,
.comparison-table.minimal tbody tr:hover,
.wpb_text_column.comparison-table.minimal table tbody tr:hover {
  background-color: #fafbfc;
  box-shadow: none;
}

.comparison-table.minimal table tbody tr td:first-child,
.comparison-table.minimal tbody tr td:first-child,
.wpb_text_column.comparison-table.minimal table tbody tr td:first-child {
  background-color: #fafbfc;
  border-right: 1px solid #e8e8e8;
}

.comparison-table.minimal table tbody tr td:last-child,
.comparison-table.minimal tbody tr td:last-child,
.wpb_text_column.comparison-table.minimal table tbody tr td:last-child {
  background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
  font-weight: 600;
}

.comparison-table.minimal table tbody tr:hover td:last-child,
.comparison-table.minimal tbody tr:hover td:last-child,
.wpb_text_column.comparison-table.minimal table tbody tr:hover td:last-child {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f3ff 100%);
}

/* Responsive fixes for minimal variant */
@media screen and (max-width: 768px) {
  .comparison-table.minimal table,
  .comparison-table.minimal,
  .wpb_text_column.comparison-table.minimal table {
    overflow-x: auto !important;
    display: block !important;
  }
}

/* Striped Variant */
.comparison-table.striped table tbody tr:nth-child(even),
.comparison-table.striped tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.comparison-table.striped table tbody tr:nth-child(odd),
.comparison-table.striped tbody tr:nth-child(odd) {
  background-color: #fff;
}

.comparison-table.striped table tbody tr:hover,
.comparison-table.striped tbody tr:hover {
  background-color: #e9ecef;
}
