* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

/* App Layout - Sidebar + Content */
.app-layout {
  display: flex;
  min-height: calc(100vh - 76px); /* Subtract header height */
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: white;
  padding: 1.5rem;
  border-right: 1px solid #eee;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.content {
  flex: 1;
  padding: 1.5rem;
  min-width: 0; /* Allow content to shrink below its min-content */
  overflow-x: auto;
}

/* Filters */
.filters {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filters-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1b5e20;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e8f5e9;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
}

.filter-group select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
}

.filter-group select:hover {
  border-color: #2e7d32;
}

.filter-group select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

/* Date range picker */
.date-range-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-range-picker input[type="date"] {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  width: 100%;
}

.date-range-picker input[type="date"]:hover {
  border-color: #2e7d32;
}

.date-range-picker input[type="date"]:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.date-separator {
  color: #666;
  font-size: 0.875rem;
  text-align: center;
}

/* Nights multi-select */
.nights-selector {
  display: flex;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2e7d32;
  cursor: pointer;
}

/* Comparison Table Section */
.comparison-section {
  margin-bottom: 2rem;
}

.comparison-section h2 {
  margin-bottom: 1rem;
  color: #1b5e20;
}

.table-container {
  overflow-x: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

#comparison-table th,
#comparison-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid #eee;
}

#comparison-table th {
  background: #f9f9f9;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

#comparison-table th:first-child,
#comparison-table td:first-child {
  text-align: left;
  font-weight: 500;
}

#comparison-table tbody tr:hover {
  background: #f5f5f5;
}

/* Price cells */
.price-cell {
  display: inline-block;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
}

.price-cheapest {
  background-color: #c8e6c9;
  color: #1b5e20;
}

.price-mid {
  background-color: #fff9c4;
  color: #f57f17;
}

.price-expensive {
  background-color: #ffcdd2;
  color: #c62828;
}

.price-unavailable {
  color: #999;
  font-style: italic;
}

.price-per-night {
  display: block;
  font-size: 0.75rem;
  font-weight: normal;
  color: #666;
}

.price-source {
  display: block;
  font-size: 0.7rem;
  font-weight: normal;
  color: #999;
  margin-top: 2px;
}

/* Best Deals Section */
.best-deals-section {
  margin-bottom: 2rem;
}

.best-deals-section h2 {
  margin-bottom: 1rem;
  color: #1b5e20;
}

#best-deals-list {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1rem 1rem 1rem 2rem;
  list-style-position: inside;
}

#best-deals-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

#best-deals-list li:last-child {
  border-bottom: none;
}

.deal-park {
  font-weight: 600;
  color: #1b5e20;
}

.deal-lodge {
  color: #666;
}

.deal-price {
  font-weight: 600;
  color: #2e7d32;
}

.deal-dates {
  font-size: 0.875rem;
  color: #999;
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#last-updated {
  font-size: 0.875rem;
  color: #666;
}

#scrape-btn {
  padding: 0.5rem 1rem;
  background: #2e7d32;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

#scrape-btn:hover {
  background: #1b5e20;
}

#scrape-btn:disabled {
  background: #999;
  cursor: not-allowed;
}

/* Utility classes */
.hidden {
  display: none !important;
}

#no-data-message,
#no-deals-message {
  padding: 2rem;
  text-align: center;
  color: #666;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
    min-height: auto;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .filters {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .filter-group {
    min-width: 180px;
    flex: 1;
  }

  .date-range-picker {
    flex-direction: row;
    align-items: center;
  }

  .date-range-picker input[type="date"] {
    width: auto;
    flex: 1;
  }
}

@media (max-width: 600px) {
  .filters {
    flex-direction: column;
  }

  .filter-group {
    width: 100%;
  }

  .date-range-picker {
    flex-direction: column;
    align-items: stretch;
  }

  .date-range-picker input[type="date"] {
    width: 100%;
  }

  .nights-selector {
    gap: 1rem;
  }

  footer {
    flex-direction: column;
    gap: 1rem;
  }

  header h1 {
    font-size: 1.25rem;
  }
}
