/*
================================================================================
  Scanner Comparison Styles
  This file provides styling for the scanner comparison shortcode.
================================================================================
*/

/* Container styling for the overall comparison box */
.scanner-comparison {
  background-color: #fff;
  padding: 0.5rem;
  margin: 2rem auto;
  max-width: 1000px;
  border: 2px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Base table styles */
#comparison-table {
  border-radius: 12px;
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

/* Table header styles */
#comparison-table thead {
  border-bottom: 2px solid #ddd;
}

#comparison-table th {
  padding: 1rem;
  text-align: left;
  font-weight: bold;
  text-transform: uppercase;
  background-color: #f3f3f3;
}

/* Ensure the select dropdowns in header cells have normal styling */
#comparison-table thead th select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 12px;
  background-color: #fff;
  font-size: 1rem;
}

/* Table row styles */
#comparison-table tbody tr {
  border-bottom: 1px solid #d6d6d6;
}
/* Alternate row colours */
#comparison-table tbody tr:nth-child(even) {
  background-color: #f3f3f3;
}
#comparison-table td {
  padding: 0.75rem 1rem;
  box-sizing: border-box;
}

/* Make the first column (spec title) bold */
#comparison-table td:first-child {
  font-weight: bold;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  /* Force thead to use block display */
  #comparison-table thead {
    display: block;
  }
  /* Make header row flex and wrap */
  #comparison-table thead tr {
    display: flex;
    flex-wrap: wrap;
  }
  /* First header cell spans full width */
  #comparison-table thead th:first-child {
    flex: 0 0 100%;
    display: block;
    text-align: center;
    box-sizing: border-box;
  }
  /* Other header cells share the next line */
  #comparison-table thead th:not(:first-child) {
    flex: 0 0 50%;
    display: block;
    text-align: center;
    box-sizing: border-box;
  }
  
  /* Force tbody to use block display */
  #comparison-table tbody {
    display: block;
  }
  /* Make body rows flex and wrap */
  #comparison-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    padding-top: 1rem;
    padding-bottom: 2rem;
  }
  /* First body cell spans full width */
  #comparison-table tbody td:first-child {
    flex: 0 0 100%;
    background-color: #e1e1e1;
    text-align: center;
  }
  /* Other body cells share the next line */
  #comparison-table tbody td:not(:first-child) {
    flex: 0 0 50%;
    text-align: center;
  }
  
  /* Remove inherited background for even rows if needed */
  #comparison-table tbody tr:nth-child(even) {
    background-color: unset;
  }

}