/* Search and Category Results Page Styles */

.search-results-main {
  padding-top: 30px;
  padding-bottom: 60px;
  position: relative;
}

.search-page-loader {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 30;
}

.search-page-loader.hidden {
  display: none;
}

.search-page-loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #dcdcdc;
  border-top-color: #4a5db5;
  border-radius: 50%;
  animation: search-spin 0.8s linear infinite;
}

.search-page-loader-text {
  font-size: 14px;
  color: #555;
}

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

/* Filter Navigation Bar */
.filter-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none; /* Removed horizontal line */
  padding-bottom: 0px; /* Reduced padding */
  margin-bottom: 35px; /* Increased back from 25px */
  gap: 20px;
  flex-wrap: wrap;
}

.filter-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px; /* Restored to default */
  color: #333;
}

.filter-left b,
.filter-left strong {
  font-weight: bold;
  color: #000;
}

/* Category Dropdown Styling */
.category-select {
  padding: 6px 30px 6px 12px;
  border: 1px solid #ccc;
  font-size: 15px; /* Restored to default */
  outline: none;
  border-radius: 2px;
  background-color: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' 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 10px center;
}

.category-select:focus {
  border-color: #5a2d82;
}

/* Search Bar (Right Side) */
.search-filter-box {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 3px;
  overflow: hidden;
  max-width: 280px; /* Reduced from 350px */
  width: 100%;
}

.search-filter-input {
  flex: 1;
  border: none;
  padding: 8px 12px;
  font-size: 14px; /* Restored to default */
  outline: none;
}

.search-filter-btn {
  background-color: #5a2d82; /* Purple search button */
  color: white;
  border: none;
  padding: 0 20px;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px; /* Restored to default */
  transition: background 0.2s;
}

.search-filter-btn:hover {
  background-color: #4a256a;
}

/* Empty State Results Box */
.results-empty-container {
  border: 1px solid #e0e0e0;
  border-top: 1px solid #d0d0d0; /* Subtle top border adjustment */
  border-radius: 6px;
  padding: 35px 40px; /* Reduced vertical padding again */
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background-color: #f8fbff; /* Lite blue color */
  margin-bottom: 40px;
  font-family: var(--font-family); /* Applied Space Grotesk consistently */
}

.no-results-title {
  font-size: 16.5px; /* Reduced from 18px */
  letter-spacing: -0.4px;
  font-weight: normal; /* Removed bold */
  color: #444;
  margin-bottom: 5px; /* Reduced gap from 12px */
  display: block;
}

.no-results-subtext {
  font-size: 13.5px; /* Reduced from 15px */
  letter-spacing: -0.2px;
  color: #777;
  margin-bottom: 25px; /* Increased back from 15px */
  display: block;
}

/* Primary Post Ad Button */
.btn-post-ad-large {
  background-color: #007bff;
  color: white;
  text-decoration: none;
  padding: 6px 20px; /* Slimmer button */
  border-radius: 4px;
  font-weight: bold;
  font-size: 13.5px; /* Smaller font size */
  letter-spacing: -0.3px;
  display: inline-block;
  transition: background 0.2s;
}

.btn-post-ad-large:hover {
  background-color: #0069d9;
  text-decoration: none;
}

/* Responsive Overrides */
@media (max-width: 1010px) {
  .container {
    padding: 0 15px;
  }
}

@media (max-width: 768px) {
  .filter-nav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
    margin-bottom: 25px;
  }

  .filter-left {
    flex-wrap: wrap;
    font-size: 14px;
    justify-content: flex-start;
  }

  .category-select {
    width: 100%;
    margin-top: 5px;
  }

  .search-filter-box {
    max-width: 100%;
    margin-top: 5px;
  }

  .results-empty-container {
    padding: 30px 20px;
  }

  .no-results-title {
    font-size: 16px;
  }

  .no-results-subtext {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .filter-left {
    font-size: 13px;
    line-height: 1.4;
  }

  .filter-left span {
    width: 100%;
    display: block;
    margin-bottom: 5px;
  }

  .search-results-main {
    padding-top: 15px;
  }

  .btn-post-ad-large {
    width: 100%;
    text-align: center;
    padding: 10px 20px;
  }
}

/* Age Verification Modal */
.age-verification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7); /* Darker background */
  backdrop-filter: blur(5px); /* Stronger blur for better focus */
  -webkit-backdrop-filter: blur(5px); /* Safari support */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: var(--font-family);
}

.age-modal {
  background-color: white;
  width: 350px;
  border-radius: 8px;
  padding: 20px 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
}

.age-modal-title {
  font-size: 16px;
  font-weight: 900;
  color: #1c2331;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

.age-modal-subtitle {
  font-size: 11px;
  font-family: var(--font-family);
  color: #5b6574;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.age-modal-subtitle a {
  color: #1a56db;
  font-family: var(--font-family);
  text-decoration: none;
  font-weight: bold;
}

.age-modal-alert {
  background-color: #fff0f0;
  color: #c92a2a;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-family);
  margin-bottom: 12px;
  line-height: 1.4;
  border: 1px solid #ffe3e3;
}

.age-modal-btn {
  background-color: #2563ea;
  color: white;
  border: none;
  padding: 10px;
  width: 100%;
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font-family);
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.2s;
}

.age-modal-btn:hover {
  background-color: #1d4ed8;
}

.age-modal-exit {
  color: #6b7280;
  text-decoration: none;
  font-size: 12px;
  display: inline-block;
  margin-bottom: 12px;
}

.age-modal-exit:hover {
  text-decoration: underline;
}

.age-modal-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin-bottom: 10px;
}

.age-modal-footer {
  font-size: 10px;
  color: #6b7280;
  font-style: italic;
  margin: 0;
  line-height: 1.2;
}

/* Mock Search Results List Styling */
.results-date-header {
  font-weight: bold;
  font-size: 18px;
  color: #000;
  margin-top: 5px;
  margin-bottom: 12px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.date-section-separator {
  height: 20px;
  border-bottom: 1px solid #ddd;
  margin-bottom: 5px; /* Reduced gap to bottom header */
}

.results-layout-list {
  display: flex;
  flex-direction: column;
}

.result-item {
  display: flex;
  padding: 6px 15px; /* Further reduced vertical padding */
  border-bottom: 1px solid #f0f0f0;
  background-color: #fff;
  position: relative;
  cursor: pointer; /* Entire row clickable */
  /* transition: background-color 0.15s ease-in-out; */ /* Removed transition for instant hover */
}

/* Generic hover for regular posts */
.result-item:hover {
  background-color: #ffffcc !important; /* Yellowish hover background */
}

/* Specific hover for sponsored posts */
.result-item.highlight-border:hover {
  background-color: #eeeeee !important; /* Raw gray hover background */
}

.result-item:nth-child(even) {
  background-color: #fbfbfc; /* Even lighter gray background */
}

/* Highlight border and shadow for sponsored items */
.result-item.highlight-border {
  border-left: 3px solid #e74c3c; /* Thinner left vertical border */
  padding-left: 10px;
  border-bottom: 1px solid #ddd;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05); /* Subtler shadow */
  z-index: 2;
}

.result-img-box {
  width: 100px;
  height: 75px;
  background-color: #f2f2f2; /* Light gray instead of black */
  border-radius: 4px; /* Small rounded corner */
  flex-shrink: 0;
  margin-right: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.result-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-placeholder-text {
  font-size: 11px;
  color: #999;
  font-weight: bold;
  text-align: center;
  line-height: 1.2;
}

.result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.result-meta-top {
  font-size: 14px; /* Increased size */
  color: #777;
  margin-bottom: 0px; /* Minimized gap */
}

.sponsored-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 2px 0 4px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #fff3d9;
  border: 1px solid #f5ce82;
  color: #8a5200;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.result-title {
  font-size: 17px; /* Increased size */
  color: #0000ee; /* Strong Blue color */
  text-decoration: none;
  font-weight: normal;
  margin-bottom: 1px; /* Minimized gap */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-title:hover {
  text-decoration: none; /* No hover underline as requested */
}

.result-desc {
  font-size: 15px; /* Increased size */
  color: #333;
  line-height: 1.4;
  margin-bottom: 2px; /* Minimized gap */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-meta-bottom {
  font-size: 14px; /* Increased size */
  color: #666;
  display: flex;
  align-items: center;
  gap: 12px; /* Increased gap between age and image stats */
}

.result-meta-images {
  display: flex;
  align-items: center;
  gap: 4px; /* Small gap between icon and count as requested earlier */
}

.result-icon-img {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: center; /* Aligned middle (centered) */
  align-items: center;
  margin-top: 30px;
  gap: 8px;
}

.page-btn {
  padding: 10px 10px; /* Taller and less width as requested */
  min-width: 32px;
  border: none;
  background-color: #f2f2f2;
  color: #333; /* Removed blue color for inactive */
  cursor: pointer;
  font-size: 15px;
  border-radius: 4px;
  font-weight: normal; /* Removed bold for inactive */
  display: flex;
  justify-content: center;
  align-items: center;
}

.page-btn:hover {
  background-color: #e5e5e5;
}

.page-btn.active {
  background-color: #007bff;
  color: #fff;
  font-weight: bold; /* Keep bold for active */
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Back to Top Button */
.back-to-top-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background-color: #fff;
  border: 1px solid #1a56db; /* Blue border */
  color: #1a56db; /* Blue text */
  padding: 10px 12px; /* Increased height */
  font-size: 14px;
  border-radius: 3px; /* Reduced border-radius */
  cursor: pointer;
  z-index: 1000;
  display: none; /* Hidden by default, JS shows it on scroll */
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
}

.back-to-top-btn:hover {
  background-color: #f0f4ff;
  transform: translateY(-2px);
}

/* Only show on bigger devices (min-width: 1024px) */
@media (max-width: 1023px) {
  .back-to-top-btn {
    display: none !important;
  }
}
