/* Avida Specifications Plugin Styles */

/* Main container styles */
.avida-comparison-tabs,
.avida-specifications-tabs {
  font-family: Arial, sans-serif;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

/* Tab navigation styles */
.avida-tabs-heading {
  display: flex;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Tab button styles */
.avida-tab-button {
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  margin-right: 5px;
  margin-bottom: 5px;
  transition: all 0.3s;
  font-family: "Inter", Sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  background: transparent;
  color: #333;
}

.avida-tab-button:hover:not(.avida-tab-active) {
  background: #10245a;
  color: #ffffff;
}

.avida-tab-button.avida-tab-active {
  color: #cc0033;
}
.avida-tab-button.avida-tab-active:focus {
    color: #cc0033;
    background-color: transparent!important;
}
.avida-tab-button.avida-tab-active:hover {
    color: #cc0033;
    background-color: transparent!important;
}

/* Tab text styles */
.avida-tab-text {
  font-family: "Inter", Sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: #10245a;
  transition: color 0.3s;
}

.avida-tab-button:hover .avida-tab-text {
  color: #ffffff;
}

.avida-tab-button.avida-tab-active .avida-tab-text {
  color: #cc0033;
}

/* Tab content styles */
.avida-tab-content {
  display: none;
}

.avida-tab-content.avida-tab-active {
  display: block;
}

/* Table styles */
.avida-specs-table {
  width: 80%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-left: auto;
  margin-right: auto;
  table-layout: fixed;
}

.avida-comparison-layout,
.avida-comparison-tabs-mobile {
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Comparison Layout Styles */
.avida-comparison-layout {
  max-width: 1200px;
  margin: 0 auto;
}

.avida-comparison-selection {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.avida-comparison-results {
  margin-top: 30px;
}

.avida-comparison-results h4 {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  border-left: 4px solid #0073aa;
}

/* Responsive grid for comparison selection */
@media (max-width: 768px) {
  .avida-comparison-selection .avida-column-1,
  .avida-comparison-selection .avida-column-2 {
    grid-template-columns: 1fr;
  }
}

/* Table header styles */
.avida-table-header {
  padding: 12px;
  background-color: #10245a;
  font-weight: bold;
  color: white;
  text-align: center;
  border-bottom: 1px solid #ddd;
  font-size: 15px;
  line-height: 1.2;
  white-space: normal;
  word-wrap: break-word;
}

.avida-table-header:first-child {
  text-align: left;
}

/* Remove the problematic rule that sets headers to right-align */
/* .avida-table-header:not(:first-child) {
  text-align: right;
} */

/* Table row styles */
.avida-table-row {
  border-bottom: 1px solid #ddd;
}

/* Table label styles */
.avida-table-label {
  padding: 12px;
  font-weight: bold;
  background-color: #f8f9fa;
  color: #333;
  font-size: 15px;
  text-align: left;
  word-wrap: break-word;
  white-space: normal;
  max-width: 200px;
}

/* Table cell styles */
.avida-table-cell {
  padding: 12px;
  font-size: 15px;
  text-align: center;
  word-wrap: break-word;
  white-space: normal;
  max-width: 200px;
}

/* Tabs content container */
.avida-tabs-content {
  position: relative;
  text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .avida-tabs-heading {
    flex-direction: column;
    align-items: center;
  }

  .avida-tab-button {
    margin-right: 0;
    margin-bottom: 10px;
    width: 100%;
    text-align: left;
  }

  .avida-specs-table {
    font-size: 14px;
  }

  .avida-table-header,
  .avida-table-label,
  .avida-table-cell {
    padding: 8px;
    font-size: 14px;
  }
}

/* Print styles */
@media print {
  .avida-tab-button {
    display: none;
  }

  .avida-tab-content {
    display: block !important;
    page-break-inside: avoid;
  }

  .avida-specs-table {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Mobile-responsive comparison table styles */
.avida-comparison-tabs-mobile {
  margin-top: 20px;
}

.avida-table-container {
  position: relative;
  margin: 20px 0;
}

.avida-table-scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.avida-table-scroll-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.avida-specs-table-mobile {
  width: 100%;
  min-width: 520px; /* Slightly smaller for tighter mobile fit */
  border-collapse: collapse;
  margin: 0;
}

.avida-specs-table-mobile th,
.avida-specs-table-mobile td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  white-space: normal;
  word-wrap: break-word; /* legacy */
  overflow-wrap: anywhere; /* better wrap for long model names */
  word-break: break-word;
  min-width: 120px;
  max-width: 200px;
  vertical-align: middle;
}

.avida-specs-table-mobile th:first-child,
.avida-specs-table-mobile td:first-child {
  position: sticky;
  left: 0;
  background: #f8f9fa;
  z-index: 3;
  min-width: 120px;
  max-width: 150px;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  text-align: left;
}
.avida-specs-table-mobile th:first-child,
.avida-specs-table-mobile td:first-child {
  padding: 10px 8px;
}

/* Constrain non-first columns a bit more on mobile to avoid overflow
   for long model names like Silverton */
.avida-specs-table-mobile th:not(:first-child),
.avida-specs-table-mobile td:not(:first-child) {
  min-width: 90px;
  max-width: 120px;
}

.avida-specs-table-mobile th {
  background: #10245a;
  color: white;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: center;
  line-height: 1.2;
  white-space: normal;
  word-wrap: break-word;
}

.avida-specs-table-mobile th:first-child {
  background: #10245a;
  color: white;
  text-align: left;
}

/* Touch/swipe indicators */
.avida-table-scroll-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.avida-table-scroll-wrapper.has-more::after {
  opacity: 1;
}

/* Smooth scrolling for better mobile experience */
.avida-table-scroll-wrapper {
  scroll-behavior: smooth;
}

/* Loading state */
.avida-table-loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* Error state */
.avida-table-error {
  text-align: center;
  padding: 40px;
  color: #dc3545;
}

/* Mobile dropdown styles */
.avida-mobile-dropdown {
  display: none;
  margin: 20px 0;
  text-align: center;
  padding: 0 20px;
}

.avida-category-dropdown {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: 2px solid #10245a;
  border-radius: 0;
  background-color: #fff;
  color: #10245a;
  font-family: "Inter", Sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%2310245a' d='M6 8L0 2h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 50px;
  box-shadow: 0 2px 8px rgba(16, 36, 90, 0.1);
  transition: all 0.3s ease;
  margin: 0 auto;
  max-width: 300px;
}

.avida-category-dropdown:focus {
  outline: none;
  border-color: #cc0033;
  box-shadow: 0 0 0 3px rgba(204, 0, 51, 0.2);
  transform: translateY(-1px);
}

.avida-category-dropdown:hover {
  border-color: #cc0033;
  box-shadow: 0 4px 12px rgba(16, 36, 90, 0.15);
  transform: translateY(-1px);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  /* Hide desktop tabs on mobile */
  .avida-desktop-tabs,
  .avida-tabs-heading:not(.avida-mobile-dropdown) {
    display: none !important;
  }

  /* Show mobile dropdown on mobile */
  .avida-mobile-dropdown {
    display: block !important;
  }

  /* Hide all tab buttons on mobile */
  .avida-tab-button {
    display: none !important;
  }

  /* Adjust table container for mobile */
  .avida-table-container {
    margin: 0 -15px;
  }

  /* Improve mobile table scrolling */
  .avida-table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Desktop styles */
@media (min-width: 769px) {
  /* Show desktop tabs on desktop */
  .avida-desktop-tabs {
    display: flex !important;
  }

  /* Hide mobile dropdown on desktop */
  .avida-mobile-dropdown {
    display: none !important;
  }
}
