/* ABC Search Page — Redesigned
   Matches auth.css design system (Inter + Outfit, --primary #1477fe)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700&display=swap');

/* ── OJS Resets for Search ── */
.pkp_page_search .pkp_structure_head {
  display: none !important;
}

.pkp_page_search .pkp_structure_sidebar,
.abc-search-hero .pkp_page_search aside {
  display: none !important;
}

.pkp_page_search .pkp_breadcrumbs {
  display: none !important;
}

.pkp_page_search .pkp_structure_content,
.pkp_page_search .pkp_structure_main {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  float: none !important;
}

.pkp_page_search .pkp_structure_main::before,
.pkp_page_search .pkp_structure_main::after {
  display: none !important;
}

.pkp_page_search .pkp_structure_footer_wrapper,
.pkp_page_search .pkp_brand_footer,
.pkp_page_search .pkp_structure_footer {
  display: none !important;
}

body.pkp_page_search {
  background: #f8fafc;
  font-family: 'Inter', system-ui, sans-serif;
  color: #1e293b;
}

/* ══ Search Hero ══ */
.abc-search-hero {
  background: linear-gradient(135deg, #1477fe 0%, #1477fe 100%);
  padding: 52px 40px 48px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.abc-search-hero::before,
.abc-search-hero::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  pointer-events: none;
}

.abc-search-hero::before {
  width: 500px;
  height: 500px;
  top: -150px;
  right: -100px;
}

.abc-search-hero::after {
  width: 300px;
  height: 300px;
  bottom: -80px;
  left: -60px;
}

.abc-search-hero__inner {
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.abc-search-heading {
  margin-bottom: 28px;
}

.abc-search-heading h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 34px;
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.abc-search-heading h1 i {
  font-size: 28px;
  opacity: 0.85;
}

.abc-search-heading p {
  font-size: 16px;
  opacity: 0.85;
  margin: 0;
}

/* ── Search Bar ── */
.abc-search-bar-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.abc-search-bar-wrap>i {
  padding: 0 18px;
  color: #64748b;
  font-size: 16px;
  flex-shrink: 0;
}

.abc-search-bar-wrap input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 18px 0;
  color: #1e293b;
  font-family: 'Inter', sans-serif;
  background: transparent;
  min-width: 0;
}

.abc-search-bar-wrap input[type="text"]::placeholder {
  color: #94a3b8;
}

.abc-search-bar-wrap button[type="submit"] {
  background: linear-gradient(135deg, #1477fe 0%, #1477fe 100%);
  color: #fff;
  border: none;
  padding: 18px 30px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: filter 0.2s;
  flex-shrink: 0;
}

.abc-search-bar-wrap button[type="submit"]:hover {
  filter: brightness(1.1);
}

/* ── Advanced Filters ── */
.abc-search-advanced {
  margin-top: 16px;
}

.abc-search-advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 0;
  transition: opacity 0.2s;
  user-select: none;
}

.abc-search-advanced summary::-webkit-details-marker {
  display: none;
}

.abc-search-advanced[open] summary {
  opacity: 1;
}

.abc-search-advanced summary:hover {
  opacity: 1;
}

.abc-search-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.abc-filter-group .label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  opacity: 0.65;
  margin-bottom: 8px;
  color: #fff;
}

.abc-filter-group input[type="text"],
.abc-filter-group select {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}

.abc-filter-group input[type="text"] {
  width: 100%;
}

.abc-filter-group input[type="text"]:focus,
.abc-filter-group select:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.18);
}

.abc-filter-group input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.abc-filter-group select option {
  background: #7a0000;
  color: #fff;
}

/* OJS html_select_date_a11y generates fieldset + pkp_screen_reader labels + selects */
.abc-search-filters .pkp_screen_reader {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.abc-filter-group fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.abc-filter-group fieldset legend {
  display: none;
}

.abc-filter-group fieldset select {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

/* ══ Results Body ══ */
.abc-search-body {
  padding: 40px;
  min-height: 300px;
  background: #f8fafc;
}

.abc-search-container {
  max-width: 900px;
  margin: 0 auto;
}

/* ── Meta bar ── */
.abc-search-meta {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
  font-weight: 500;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.abc-search-meta strong {
  color: #1477fe;
  font-weight: 700;
}

.abc-search-meta em {
  color: #1e293b;
  font-style: normal;
  font-weight: 600;
}

/* ── Result Cards ── */
.abc-search-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.abc-search-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #1477fe;
  padding: 24px 28px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.abc-search-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

/* OJS article_summary.tpl overrides */
.abc-search-card .obj_article_summary {
  font-family: 'Inter', sans-serif;
}

.abc-search-card .obj_article_summary .title {
  margin-bottom: 8px;
}

.abc-search-card .obj_article_summary .title a {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  line-height: 1.5;
}

.abc-search-card .obj_article_summary .title a:hover {
  color: #1477fe;
}

.abc-search-card .obj_article_summary .authors {
  font-size: 13px;
  color: #64748b;
  margin: 6px 0;
}

.abc-search-card .obj_article_summary .published,
.abc-search-card .obj_article_summary .pages {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.abc-search-card .obj_article_summary .series,
.abc-search-card .obj_article_summary .context_title {
  font-size: 11px;
  font-weight: 700;
  color: #1477fe;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  display: block;
}

/* ── Empty / Error State ── */
.abc-search-empty {
  text-align: center;
  padding: 70px 20px;
  color: #64748b;
}

.abc-search-empty i {
  font-size: 52px;
  color: #e2e8f0;
  margin-bottom: 20px;
  display: block;
}

.abc-search-empty p {
  font-size: 16px;
  margin: 0;
}

/* ── Pagination ── */
.abc-search-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.abc-search-pagination .cmp_pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.abc-search-pagination .cmp_pagination a,
.abc-search-pagination .cmp_pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  padding: 0 10px;
  font-weight: 500;
  transition: all 0.15s;
  font-family: 'Inter', sans-serif;
}

.abc-search-pagination .cmp_pagination a:hover {
  background: #1477fe;
  color: #fff;
  border-color: #1477fe;
}

.abc-search-pagination .cmp_pagination .current_page {
  background: #1477fe;
  color: #fff;
  border-color: #1477fe;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .abc-search-hero {
    padding: 40px 20px;
  }

  .abc-search-heading h1 {
    font-size: 26px;
  }

  .abc-search-filters {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .abc-search-bar-wrap button[type="submit"] {
    padding: 18px 18px;
    font-size: 13px;
  }

  .abc-search-body {
    padding: 24px 16px;
  }

  .abc-search-card {
    padding: 18px 20px;
  }
}

@media (max-width: 480px) {
  .abc-search-heading h1 {
    font-size: 22px;
  }

  .abc-search-bar-wrap button[type="submit"] {
    padding: 18px 14px;
  }
}