/* Screen reader text - visually hidden but accessible to assistive technologies */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

.wp-compare-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0px;
  padding-top: 40px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
}

.wp-compare-header {
  text-align: center;
  margin-bottom: 40px;
}

.wp-compare-title {
  font-size: 48px;
  font-weight: bold;
  margin: 0 0 20px 0;
  color: #000;
}

.wp-compare-intro {
  font-size: 16px;
  color: #333;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.wp-compare-controls {
  margin-bottom: 10px;
}

.wp-compare-subtitle {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 15px 0;
  color: #000;
  text-align: center;
}

.wp-compare-controls-inner {
  display: flex;
  align-items: start;
  gap: 20px;
}

.wp-compare-filter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: -webkit-fill-available;
  width: 100%;
}

.wp-compare-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.feature-filter-wrapper {
  height: -webkit-fill-available;
  border-radius: 4px;
}

.wp-compare-filter-label {
  font-weight: 500;
}

.wp-compare-filter label {
  color: #111;
  font-weight: 400;
}

.wp-compare-filter-clear {
  border: none;
  margin: 0;
  cursor: pointer;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
  flex-shrink: 0;
  background: #2563eb !important;
  padding: 6px 8px;
  letter-spacing: 1.5px;
  border-radius: 3px;
}

.wp-compare-filter-clear:hover,
.wp-compare-filter-clear:focus {
  outline: none;
}

.wp-compare-filter-clear:active {
  color: #004a6f;
}

.wp-compare-select-wrapper {
  position: relative;
  width: 100%;
}

.wp-compare-app-clear-button-container {
  flex: 1;
}
.wp-compare-legend-wrap {
  display: flex;
  background: #ffffff4d;
  padding: 0 10px;
}

.wp-compare-filter select {
  padding: 16px 40px 16px 12px;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  min-width: 200px;
  width: 100%;
  height: 58px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.wp-compare-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  pointer-events: none;
  flex-shrink: 0;
  transition: transform 0.2s;
  width: 12px;
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wp-compare-select-arrow svg {
  width: 100%;
  height: 100%;
}

.wp-compare-filter select:focus + .wp-compare-select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Multi-select dropdown */
.wp-compare-multiselect {
  position: relative;
  width: 100%;
  min-width: 200px;
}

.wp-compare-multiselect-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  min-height: 58px;
  max-height: 58px;
  gap: 8px;
}

.wp-compare-multiselect-input > * {
  flex-shrink: 0;
}

.wp-compare-multiselect-input:focus {
  outline: 2px solid #0073aa;
  outline-offset: -2px;
}

.wp-compare-multiselect-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  flex: 1;
  align-items: center;
}

.wp-compare-multiselect-placeholder {
  color: #999;
  font-size: 14px;
}

.wp-compare-multiselect-tally {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.wp-compare-multiselect-arrow {
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
  width: 12px;
  height: 8px;
}

.wp-compare-multiselect-arrow svg {
  width: 100%;
  height: 100%;
}

.wp-compare-multiselect.open .wp-compare-multiselect-arrow {
  transform: rotate(180deg);
}

.wp-compare-multiselect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
}

.wp-compare-multiselect.open .wp-compare-multiselect-dropdown {
  display: block;
}

.wp-compare-multiselect-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.wp-compare-multiselect-option:hover {
  background: #f5f5f5;
}

.wp-compare-multiselect-option[aria-selected="true"] {
  background: #f0f7ff;
}

.wp-compare-multiselect-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.wp-compare-multiselect-option[aria-selected="true"]
  .wp-compare-multiselect-checkbox {
  background: #0073aa;
  border-color: #0073aa;
}

.wp-compare-multiselect-option[aria-selected="true"]
  .wp-compare-multiselect-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: bold;
}

.wp-compare-multiselect-option-text {
  font-size: 14px;
  color: #333;
  flex: 1;
}

/* Main Layout - Side by Side */
.wp-compare-main-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 4px;
  align-items: start;
}

.wp-compare-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 15px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 50px);
  overflow-y: auto;
  padding-right: 12px;
}

.wp-compare-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.wp-compare-no-results p {
  margin: 0 0 20px 0;
  font-size: 16px;
  color: #333;
}

.wp-compare-clear-filters {
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.wp-compare-clear-filters:hover,
.wp-compare-clear-filters:focus {
  background: #005a87;
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.wp-compare-clear-filters:active {
  background: #004a6f;
}

.wp-compare-item {
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 2px;
  border-radius: 4px;
}

.wp-compare-item:hover {
  background: rgb(78 78 78 / 6%);
  height: max-content;
}

.wp-compare-item-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%;
  border-radius: 8px;
}

.wp-compare-item-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-compare-item-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.wp-compare-item-checkmark {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 24px;
  height: 24px;
  background: #2563eb;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.wp-compare-item.selected .wp-compare-item-checkmark {
  display: flex;
}

.wp-compare-item.hidden {
  display: none;
}

.wp-compare-item-title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: #333;
  line-height: 1.3;
  word-wrap: normal;
}

/* Comparison Table - Sticky First Column Only */
.wp-compare-table-container {
  display: block;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

/* Placeholder when no apps selected */
.wp-compare-table-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  border-radius: 8px;
  background: rgb(255 255 255 / 30%);
  padding: 60px 40px;
}

.wp-compare-placeholder-content {
  text-align: center;
  max-width: 400px;
}

.wp-compare-placeholder-icon {
  color: #ccc;
  margin: 0 auto 20px;
  display: block;
}

.wp-compare-placeholder-text {
  font-size: 2em;
  font-weight: 200;

  line-height: 1.6;
  margin: 0;
}
.wp-c-disclaimer {
  text-align: center;
  font-size: 12px;
  margin-top: 20px;
}

.wp-compare-table-scroll-wrapper {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
  border: none;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

/* Legend */
.wp-compare-legend {
  margin-bottom: 10px;
  flex-shrink: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.wp-compare-legend-title {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  padding-right: 4px;
}

.wp-compare-legend-items {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.wp-compare-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wp-compare-legend-text {
  font-size: 14px;
  color: #222;
  font-weight: 600;
}

/* Table container inside scroll wrapper */
.wp-compare-table-container-inner {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.wp-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 500px;
  table-layout: fixed;
}

.wp-compare-table thead {
  background: #f5f5f5;
  position: sticky;
  top: 0;
  z-index: 100;
}

.wp-compare-table th {
  padding: 14px;
  padding-bottom: 4px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
  background: #f5f5f5;
}

.wp-compare-sticky-col {
  position: sticky;
  left: 0;
  z-index: 10;
  background: #fff;
  border-right: 1px solid #ddd;
  min-width: 150px;
  max-width: 150px;
  width: 150px;
  padding: 12px 15px;
}

.wp-compare-table thead .wp-compare-sticky-col {
  background: #f5f5f5;
  z-index: 101;
  top: 0;
  position: sticky;
}

.wp-compare-category-row {
  background: #f9f9f9;
}

.wp-compare-category-cell {
  font-weight: 600;
  background: #e8e8e8;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.wp-compare-table thead .wp-compare-sticky-col.wp-compare-category-cell {
  background: #e8e8e8;
  z-index: 11;
}

.wp-compare-feature-label {
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  font-weight: 600;
}

/* App Column Styles */
.wp-compare-app-column {
  min-width: 200px;
  max-width: 250px;
  width: 250px;
  padding: 12px 15px;
  text-align: center;
  border-bottom: 1px solid #eee;
  background: #fff;
  vertical-align: middle;
  border-left: 1px solid #eee;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.wp-compare-app-header {
  padding: 0;
  background: #f5f5f5;
  border-bottom: 2px solid #ddd;
  min-width: 200px;
  max-width: 250px;
  width: 250px;
  border-left: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 99;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  vertical-align: top;
}

.wp-compare-app-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 4px;
  padding-top: 20px;
  width: 100%;
  box-sizing: border-box;
  min-height: 140px; /* Consistent minimum height for all headers (reduced since no description) */
}

.wp-compare-table-app-icon {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  margin-bottom: 10px;
}

.wp-compare-table-app-icon-placeholder {
  width: 50px;
  height: 50px;
  background: #f0f0f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 10px;
  flex-shrink: 0;
  margin-bottom: 10px;
}

.wp-compare-table-app-title {
  font-weight: 600;
  font-size: 24px;
  text-align: center;
  margin-bottom: 12px;
  flex-shrink: 0;
  min-height: 20px;
}

.wp-compare-table-app-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
  flex-shrink: 0;
  min-height: 20px;
}

.wp-compare-description-row {
  background: #fff;
}

.wp-compare-description-label {
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  font-weight: 500;
}

.wp-compare-description-cell {
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 12px 15px;
}

.wp-compare-table-app-description {
  font-size: 12px;

  line-height: 1.5;
  text-align: left;
  width: 100%;
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.wp-compare-table-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.wp-compare-table-link svg {
  width: 28px;
  height: 28px;
}

.wp-compare-table-link:hover {
  color: #000;
}

.wp-compare-table-close {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: #666;
  transition: all 0.2s;
  z-index: 10;
  flex-shrink: 0;
}

.wp-compare-table-close:hover {
  background: #f0f0f0;
  color: #000;
}

.wp-compare-feature-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.wp-compare-icon {
  flex-shrink: 0;
}

.wp-compare-icon.check {
  color: #4caf50;
}

.wp-compare-icon.cross {
  color: #f44336;
}

.wp-compare-icon.unsure {
  color: #ff9800;
}

.wp-compare-icon-empty {
  color: #ccc;
}

.wp-compare-feature-context {
  font-size: 12px;
  font-style: italic;
  text-align: center;
}

.wp-compare-category-row .wp-compare-app-column {
  background: #e8e8e8;
  border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 1024px) {
  .wp-compare-main-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .wp-compare-items-grid {
    position: static;
    max-height: none;
  }
}

/* Tablet */
@media (max-width: 768px) {
  .wp-compare-container {
    padding: 15px;
  }

  .wp-compare-title {
    font-size: 32px;
    margin-bottom: 15px;
  }

  .wp-compare-subtitle {
    font-size: 18px;
  }

  .wp-compare-controls-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .wp-compare-no-results {
    padding: 30px 15px;
  }

  .wp-compare-no-results p {
    font-size: 14px;
  }

  .wp-compare-clear-filters {
    padding: 10px 20px;
    font-size: 13px;
  }

  .wp-compare-items-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .wp-compare-items-grid::-webkit-scrollbar {
    height: 6px;
  }

  .wp-compare-items-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
  }

  .wp-compare-items-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
  }

  .wp-compare-item {
    flex: 0 0 auto;
    width: 60px;
    min-width: 60px;
  }

  .wp-compare-item-image-wrapper {
    width: 40px;
    padding-top: 40px;
    margin: 0 auto;
  }

  .wp-compare-item-title {
    font-size: 11px;
    margin-top: 6px;
    line-height: 1.2;
  }

  .wp-compare-item-checkmark {
    width: 18px;
    height: 18px;
    top: 2px;
    right: 2px;
    font-size: 10px;
  }

  .wp-compare-table-placeholder {
    min-height: 50vh;
    padding: 40px 20px;
  }

  .wp-compare-placeholder-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
  }

  .wp-compare-placeholder-text {
    font-size: 14px;
  }

  .wp-compare-legend {
    padding: 10px 12px;
  }

  .wp-compare-legend-title {
    font-size: 12px;
  }

  .wp-compare-legend-items {
    gap: 15px;
  }

  .wp-compare-legend-text {
    font-size: 12px;
  }

  .wp-compare-table-scroll-wrapper {
    max-height: 60vh;
    border-radius: 6px;
  }

  .wp-compare-sticky-col {
    min-width: 120px;
    max-width: 120px;
    width: 120px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .wp-compare-app-column {
    min-width: 180px;
    max-width: 180px;
    width: 180px;
    padding: 10px 12px;
  }

  .wp-compare-app-header {
    min-width: 180px;
    max-width: 180px;
    width: 180px;
  }

  .wp-compare-app-header-content {
    padding: 12px;
    padding-top: 35px;
    min-height: 120px;
  }

  .wp-compare-table-app-icon,
  .wp-compare-table-app-icon-placeholder {
    width: 40px;
    height: 40px;
  }

  .wp-compare-table-app-title {
    font-size: 13px;
  }

  .wp-compare-table-link svg {
    width: 14px;
    height: 14px;
  }
  .feature-filter-wrapper {
    width: 100%;
  }
  .wp-compare-filter select {
    width: 100%;
  }
  .wp-compare-filter {
    width: 100%;
  }
}

/* Mobile Phone */
@media (max-width: 480px) {
  .wp-compare-container {
    padding: 0px;
  }

  .wp-compare-header {
    margin-bottom: 20px;
  }

  .wp-compare-title {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .wp-compare-intro {
    font-size: 14px;
  }

  .wp-compare-subtitle {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .wp-compare-controls {
    margin-bottom: 20px;
  }

  .wp-compare-filter {
    width: 100%;
    flex-direction: column;
  }

  .wp-compare-filter select {
    width: 100%;
    padding: 10px;
    font-size: 16px; /* Prevents zoom on iOS */
    min-width: auto;
  }

  .wp-compare-multiselect {
    width: 100%;
  }

  .wp-compare-multiselect-input {
    min-height: 44px;
    padding: 10px 12px;
  }

  .wp-compare-multiselect-chip {
    font-size: 14px;
    padding: 5px 10px;
  }

  .wp-compare-multiselect-dropdown {
    max-height: 250px;
  }

  .wp-compare-multiselect-option {
    padding: 12px;
    font-size: 15px;
  }

  .wp-compare-items-grid {
    gap: 10px;
    padding-bottom: 8px;
  }

  .wp-compare-item {
    width: 50px;
    min-width: 50px;
  }

  .wp-compare-item-image-wrapper {
    width: 40px;
    padding-top: 40px;
  }

  .wp-compare-item-title {
    font-size: 12px;
    margin-top: 5px;
  }

  .wp-compare-item-checkmark {
    width: 16px;
    height: 16px;
    top: 1px;
    right: 1px;
    font-size: 9px;
  }

  .wp-compare-table-placeholder {
    min-height: 40vh;
    padding: 30px 15px;
  }

  .wp-compare-placeholder-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
  }

  .wp-compare-placeholder-text {
    font-size: 16px;
    font-weight: 400;
  }

  .wp-compare-legend {
    padding: 8px 10px;
  }

  .wp-compare-legend-title {
    font-size: 11px;
  }

  .wp-compare-legend-items {
    gap: 12px;
  }

  .wp-compare-legend-item {
    gap: 5px;
  }

  .wp-compare-legend-text {
    font-size: 11px;
  }

  .wp-compare-legend-item svg {
    width: 16px;
    height: 16px;
  }

  .wp-compare-table-scroll-wrapper {
    max-height: 65vh;
    border-radius: 4px;
  }

  .wp-compare-table {
    min-width: 380px;
  }

  .wp-compare-sticky-col {
    min-width: 100px;
    max-width: 100px;
    width: 100px;
    padding: 4px;
    font-size: 12px;
  }

  .wp-compare-table th {
    padding: 4px;
    font-size: 13px;
  }

  .wp-compare-app-column {
    min-width: 130px;
    max-width: 130px;
    width: 130px;
    padding: 4px;
  }

  .wp-compare-app-header {
    min-width: 130px;
    max-width: 130px;
    width: 130px;
  }

  .wp-compare-app-header-content {
    padding: 4px;
    padding-top: 20px;
    min-height: 110px;
  }

  .wp-compare-table-app-icon,
  .wp-compare-table-app-icon-placeholder {
    width: 35px;
    height: 35px;
    margin-bottom: 8px;
  }

  .wp-compare-table-app-title {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .wp-compare-table-app-links {
    gap: 6px;
    margin-bottom: 8px;
  }

  .wp-compare-table-link svg {
    width: 24px;
    height: 24px;
  }

  .wp-compare-table-close {
    width: 20px;
    height: 20px;
    font-size: 16px;
    top: 3px;
    right: 3px;
  }

  .wp-compare-feature-label {
    font-size: 12px;
    font-weight: 500;
    line-height: normal;
  }

  .wp-compare-category-cell {
    font-size: 13px;
    white-space: nowrap;
  }

  .wp-compare-feature-context {
    font-size: 13px;
    max-width: 140px;
    line-height: normal;
  }

  .wp-compare-table-app-description {
    font-size: 12px;
  }
  .wp-compare-description-cell {
    vertical-align: top;
  }

  .wp-compare-description-label {
    font-size: 12px;
    vertical-align: top;
  }
  .feature-filter-wrapper {
    width: 100%;
  }
  .wp-compare-filter select {
    width: 100%;
  }
}
