/* General Body Styles */
body {
  font-family: 'RuskinFont', serif;
  background-color: #f2f5f8; /* Cooler, very light gray-blue background */
  margin: 0;
  padding: 2rem 0;
  color: #3f3f3f;
  line-height: 1.5;
}

/* Search Container */
.search-container {
  max-width: 700px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.04); /* Slightly lighter shadow */
  border: 1px solid #e0e4e8; /* Cooler, very light gray-blue border */
}

/* Headings */
h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: #2a3541;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2a3541;
  border-bottom: 1px dashed #d5d9de; /* Cooler dotted border */
  padding-bottom: 0.4rem;
}

/* Form Layout */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

/* Labels */
label {
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Input Fields & Selects */
input[type='text'],
select {
  font-family: 'RuskinFont', serif;
  padding: 0.6rem 0.8rem;
  box-sizing: border-box;
  font-size: 0.95rem;
  border: 1px solid #cdd4da; /* Cooler, slightly darker border */
  border-radius: 0.5rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  width: 100%;
  background-color: #ffffff;
}

input[type='text']:focus,
select:focus {
  outline: none;
  border-color: #6a8ba8; /* A slightly deeper, muted blue for focus */
  box-shadow: 0 0 0 2px rgba(106, 139, 168, 0.2);
}

/* Toggle Advanced Button */
.toggle-advanced-btn {
  font-family: 'RuskinFont', serif;
  background: none;
  border: none;
  color: #3498db; /* Muted blue (retained from previous) */
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  padding: 0.3rem 0;
  margin-top: -0.3rem;
  transition: color 0.2s ease;
}

.toggle-advanced-btn:hover {
  color: #4a6a84;
}

/* Advanced Search Section */
.advanced-search {
  display: none;
  padding: 1.2rem 0 0.4rem;
  border-top: 1px dashed #d5d9de; /* Cooler dotted border */
  margin-top: 1rem;
}

.add-field-btn {
  font-family: 'RuskinFont', serif;
  background-color: #eaf1f3; /* Very subtle cool-toned background */
  color: #4caf50;
  border: 1px solid #c3d9e0; /* Cooler border */
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.03);
  margin-bottom: 1rem;
}

.add-field-btn:hover {
  background-color: #dae8ed;
  color: #388e3c;
  border-color: #a7b7bc;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* Advanced Field Layout */
.advanced-field {
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.field-content {
  flex: 1;
}

/* Remove Field Button */
.remove-field-btn {
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.8rem;
  height: 1.8rem;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 1.8rem;
  line-height: 1;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.05);
}

.remove-field-btn:hover:not(:disabled) {
  background-color: #c0392b;
  transform: scale(1.08);
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.1);
}

.remove-field-btn:disabled {
  background-color: #d5d5d5;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Field Selector */
.field-selector {
  margin-top: 0.8rem;
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  background-color: #fcfdfe; /* Very light, cool background */
  border: 1px solid #e0e4e8; /* Cooler border */
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.field-selector label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: 0.8rem;
}

.field-selector select {
  width: auto;
  min-width: 140px;
  flex-grow: 1;
  margin-right: 0.4rem;
}

.field-selector button {
  padding: 0.5rem 1rem !important;
  border-radius: 0.4rem !important;
  font-weight: 600;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
  box-shadow: 0 0.08rem 0.2rem rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
}

.field-selector button:first-of-type {
  background-color: #5d7e9b !important;
}

.field-selector button:first-of-type:hover {
  background-color: #4a6a84 !important;
  transform: translateY(-1px);
}

.field-selector button:last-of-type {
  background-color: #a5b4c1 !important;
}

.field-selector button:last-of-type:hover {
  background-color: #8c9fae !important;
  transform: translateY(-1px);
}

/* Submit Button */
button[type='submit'] {
  background-color: #3498db;
  color: #fff;
  border: none;
  padding: 0.8rem;
  border-radius: 0.6rem;
  font-size: 1rem;
  font-family: 'RuskinFont', serif;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 0.2rem 0.6rem rgba(0, 0, 0, 0.08);
}

button[type='submit']:hover {
  background-color: #4a6a84;
  transform: translateY(-1px);
  box_shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.12);
}

/* Results Section */
.results {
  max-width: 700px;
  margin: 1.5rem auto;
  padding: 1.8rem;
  background-color: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.04);
  border: 1px solid #e0e4e8;
}

.result-item {
  margin-bottom: 1.4rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px dashed #d5d9de;
}

.result-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.result-title a {
  font-size: 1.15rem;
  font-weight: 700;
  color: #5d7e9b;
  text-decoration: none;
  transition:
    color 0.2s ease,
    text-decoration 0.2s ease;
}

.result-title a:hover {
  color: #4a6a84;
  text-decoration: underline;
}

.result-snippet {
  font-size: 0.9rem;
  color: #4f4f4f;
  margin: 0.4rem 0;
}

.result-link {
  font-size: 0.75rem;
  color: #888;
  word-break: break-all;
}

.hidden-element {
  display: none;
}

/* Pagination Styles */
.pagination-info {
  text-align: center;
  margin: 1.2rem 0;
  font-size: 0.85rem;
  color: #666;
  padding: 0.8rem;
  background-color: #fbfdfe; /* Very subtle cool background */
  border-radius: 0.6rem;
  box-shadow: inset 0 0 0.3rem rgba(0, 0, 0, 0.02);
  border: 1px solid #e8edf2; /* Very light cool border */
}

.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed #d5d9de;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pagination-btn {
  background-color: #5d7e9b;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-family: 'RuskinFont', serif;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.08);
}

.pagination-btn:hover:not(:disabled) {
  background-color: #4a6a84;
  transform: translateY(-1px);
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.12);
}

.pagination-btn:disabled {
  background-color: #d5d5d5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.page-info {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  white-space: nowrap;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #666;
}

.page-size-control select {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid #cdd4da; /* Cooler border */
  border-radius: 0.4rem;
  font-family: 'RuskinFont', serif;
  background-color: #ffffff;
}

/* Media Queries for Responsiveness */
@media (max-width: 600px) {
  .search-container,
  .results {
    padding: 1.2rem;
    margin: 1.2rem auto;
    border-radius: 0.8rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0.6rem;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 0.8rem;
  }

  .page-size-control,
  .pagination-nav {
    width: 100%;
    justify-content: center;
  }

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

  .field-selector label,
  .field-selector select,
  .field-selector button {
    width: 100%;
    margin-right: 0 !important;
  }
}

/* Suggestion Box */
.suggestion-box {
  position: absolute;
  background: white;
  border: 1px solid #cdd4da; /* Cooler subtle border */
  border-radius: 0.6rem;
  max-height: 10rem;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.06); /* Slightly lighter shadow */
  font-family: 'RuskinFont', serif;
  width: calc(100% - 2px);
  margin-top: 0.2rem;
}

.suggestion-box li {
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #3f3f3f;
}

.suggestion-box li:hover {
  background-color: #eef5fb; /* Very subtle cool blue on hover */
  color: #4a6a84;
}
