/* Base styles and variables */
:root {
  --background-color: #f8f9fa;
  --card-background: #ffffff;
  --text-color: #2c3e50;
  --text-secondary: #6c757d;
  --primary-color: #3498db;
  --primary-hover: #2980b9;
  --input-border: #e0e0e0;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --success-color: #27ae60;
  --error-color: #e74c3c;
  --warning-color: #f39c12;
}

/* Global styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main container */
.container {
  background: var(--card-background);
  padding: 2rem;
  width: 100%;
  max-width: 800px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* Remove the hover animation */
.container:hover {
  transform: none;
}

/* Header styles */
h1 {
  color: var(--text-color);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.2rem;
  font-weight: 600;
}

/* Filters container styles */
.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  flex-wrap: nowrap;
}

/* Search box styles */
.search-box {
  flex: 1;
  min-width: 150px;
  max-width: 300px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 0.8rem 0.6rem 2.2rem;
  border: 2px solid var(--input-border);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  background-color: white;
  color: var(--text-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.6rem center;
  background-size: 1rem;
}

.search-box input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-box input::placeholder {
  color: #999;
  font-size: 0.95rem;
}

/* Entries selector styles */
.entries-selector {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  background-color: white;
  padding: 0.6rem 1rem;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.entries-selector label {
  font-weight: 500;
  color: var(--text-color);
}

.entries-selector select {
  padding: 0.4rem 1.8rem 0.4rem 0.8rem;
  font-size: 0.9rem;
  border: 2px solid var(--input-border);
  border-radius: var(--border-radius);
  background-color: white;
  color: var(--text-color);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
}

.entries-selector select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.entries-selector span {
  color: #666;
  font-size: 0.95rem;
}

/* Fuel card styles */
.fuel {
  background: var(--card-background);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary-color);
  transition: box-shadow 0.2s ease;
}

.fuel:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fuel .town {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.fuel .price {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.3rem;
  background-color: rgba(52, 152, 219, 0.1);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
}

.fuel .date-range {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Fuel prices container */
#prices {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 3px solid var(--input-border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error state */
.error {
  text-align: center;
  padding: 2rem;
  background-color: rgba(231, 76, 60, 0.1);
  border-radius: var(--border-radius);
  color: var(--error-color);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.error::before {
  content: "⚠️";
  font-size: 1.5rem;
}

/* No results state */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.no-results::before {
  content: "🔍";
  font-size: 2rem;
}

/* Pagination container styles */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Update pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination-btn {
  padding: 0.6rem 1.2rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--primary-hover);
}

.pagination-btn:disabled {
  background-color: var(--input-border);
  cursor: not-allowed;
}

#pageInfo {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Footer styles */
footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.data-source {
  font-size: 0.85rem;
}

.data-source a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.data-source a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

#last-updated {
  font-weight: 500;
  color: var(--secondary-color);
}

/* Responsive design */
@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .fuel {
    font-size: 1rem;
    padding: 1rem;
  }

  .pagination-container {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }

  .entries-selector {
    width: 100%;
    justify-content: flex-start;
  }

  .pagination {
    margin-top: 1rem;
  }

  .pagination-btn {
    padding: 0.6rem 1.2rem;
  }
}

@media (max-width: 768px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 0.8rem;
  }

  .search-box {
    width: 100%;
    max-width: none;
    flex: none;
  }

  .entries-selector {
    width: 100%;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
  }

  .fuel {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
  }

  .fuel .price {
    width: 100%;
    text-align: center;
  }
}
