.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 20px;
}

.tab-button {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6c757d;
}

.tab-button:hover {
  color: #495057;
  background-color: #f8f9fa;
}

.tab-button.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background-color: #f8f9fa;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Time Filter Controls */
.time-filter-controls {
  margin-bottom: 30px;
  padding: 20px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.filter-btn {
  padding: 10px 20px;
  border: 2px solid #e9ecef;
  background: #ffffff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6c757d;
}

.filter-btn:hover {
  border-color: #007bff;
  color: #007bff;
  background: #f8f9fa;
}

.filter-btn.active {
  background: #007bff;
  border-color: #007bff;
  color: #ffffff;
}

.filter-btn.active:hover {
  background: #0056b3;
  border-color: #0056b3;
}

/* Chart Sections */
.chart-section {
  margin-bottom: 40px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.chart-section h3 {
  margin: 0 0 20px 0;
  color: #495057;
  font-size: 1.3rem;
  font-weight: 600;
}

.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
}

.chart-container canvas {
  max-height: 400px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f5f5f5;
  font-weight: bold;
}

tr:hover {
  background-color: #f9f9f9;
}

input[type='checkbox'] {
  transform: scale(1.2);
  cursor: pointer;
}

.complete {
  color: green;
}

.incomplete {
  color: red;
}

.state-link {
  color: #000;
  text-decoration: none;
  font-weight: 500;
}

.state-link:hover {
  color: #333;
  text-decoration: underline;
  transition: color 0.2s ease;
}
input[type='checkbox'][disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}
tr:hover input[type='checkbox'][disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}
.status-cell {
  text-align: center;
  font-weight: bold;
}

/* Style for checkmark */
.status-cell:has(✓) {
  color: #2ecc71;
}

/* Style for X mark */
.status-cell:has(✗) {
  color: #e74c3c;
}

/* Error message styles */
.error-message {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid;
  background-color: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.error-auth {
  border-left-color: #dc3545;
  background-color: #f8d7da;
}

.error-permission {
  border-left-color: #fd7e14;
  background-color: #fff3cd;
}

.error-server {
  border-left-color: #6f42c1;
  background-color: #e2e3f1;
}

.error-network {
  border-left-color: #20c997;
  background-color: #d1ecf1;
}

.error-validation {
  border-left-color: #ffc107;
  background-color: #fff3cd;
}

.error-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.error-text {
  flex: 1;
  font-weight: 500;
  color: #495057;
}

.error-close {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: bold;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.error-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #495057;
}

/* Loading state styles */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Optional: add hover effect */
tr:hover .status-cell {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Market Data Controls */
.market-data-controls {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.market-data-controls h3 {
  margin: 0 0 15px 0;
  color: #495057;
  font-size: 1.2rem;
}

.control-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #0056b3;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: #545b62;
  transform: translateY(-1px);
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover:not(:disabled) {
  background: #138496;
  transform: translateY(-1px);
}

.status-message {
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  min-height: 20px;
  display: none;
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.status-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.status-message.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  display: block;
}

.status-message.loading {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
  display: block;
}

/* Market Data Display */
.market-data-cell {
  font-size: 12px;
  text-align: center;
}

.market-data-cell .price {
  font-weight: bold;
  color: #28a745;
}

.market-data-cell .change {
  font-size: 10px;
}

.market-data-cell .change.positive {
  color: #28a745;
}

.market-data-cell .change.negative {
  color: #dc3545;
}

.market-data-cell .market-type {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e9ecef;
  color: #495057;
  margin-top: 2px;
}

.market-data-cell .last-updated {
  font-size: 9px;
  color: #6c757d;
  margin-top: 2px;
}

/* Individual state update button */
.state-update-btn {
  padding: 4px 8px;
  font-size: 11px;
  background: #17a2b8;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}

.state-update-btn:hover {
  background: #138496;
}

.state-update-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

/* Scrollable Table Containers */
.table-container {
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-top: 15px;
}

.table-container table {
  margin-top: 0;
  position: relative;
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

/* Table Rows - Exactly Match Counties Styling */
.table-container table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

/* Alternating row colors for better readability */
.table-container table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.table-container table tr:hover {
  background-color: #f0f8ff;
}

/* Wholesaling Laws Table Specific Styling */
.table-container #wholesaling-laws-table {
  min-width: 1500px;
}

.table-container #wholesaling-laws-table td {
  padding: 8px;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  max-width: 300px;
  line-height: 1.4;
  height: auto;
  min-height: 2.8em; /* Allow for 2 lines */
  vertical-align: top;
}

/* Sticky State Column */
.table-container #wholesaling-laws-table td:first-child,
.table-container #wholesaling-laws-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 15;
  background-color: #f8f9fa;
  border-right: 2px solid #dee2e6;
  max-width: 100px;
  font-weight: 600;
  min-height: 2.8em; /* Ensure consistent height */
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.table-container #wholesaling-laws-table td:first-child {
  background-color: #ffffff;
}

.table-container #wholesaling-laws-table tr:nth-child(even) td:first-child {
  background-color: #f9f9f9;
}

/* State Market Data Table Specific Styling */
.table-container #state-market-table {
  min-width: 1200px;
}

.table-container #state-market-table td {
  padding: 8px;
  white-space: normal;
  line-height: 1.4;
  vertical-align: top;
}

/* States List Table Specific Styling */
.table-container #states-table {
  min-width: 800px;
}

.table-container #states-table td {
  padding: 10px 8px;
  white-space: normal;
  line-height: 1.4;
  vertical-align: top;
}

/* General Table Cell Multi-line Styling */
.table-container table td {
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.table-container table td.single-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Table Headers - Exactly Match Counties Styling */
.table-container table th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
  font-size: 15px;
  font-weight: bold;
  padding: 8px;
  border: 1px solid #ddd;
}

.table-container table th a,
.table-container table th .sort-link {
  color: #000;
  text-decoration: none;
  display: block;
  font-weight: bold;
}

.table-container table th a:hover,
.table-container table th .sort-link:hover {
  text-decoration: underline;
}

/* Custom Scrollbar Styling */
.table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Market Indicator Color Coding */
.dom-excellent, .moi-excellent {
  background-color: #d4edda !important;
  color: #155724 !important;
  font-weight: bold;
}

.dom-good, .moi-good {
  background-color: #fff3cd !important;
  color: #856404 !important;
  font-weight: bold;
}

.dom-fair, .moi-fair {
  background-color: #ffeaa7 !important;
  color: #856404 !important;
  font-weight: bold;
}

.dom-poor, .moi-poor {
  background-color: #f8d7da !important;
  color: #721c24 !important;
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
  .table-container {
    max-height: 60vh;
  }
  
  .table-container table thead th {
    font-size: 12px;
    padding: 8px 4px;
  }
  
  .table-container table td {
    font-size: 12px;
    padding: 6px 4px;
  }
}
