body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f6f8;
  color: #333;
}

.body-no-scroll {
  overflow: hidden;
} 

body::-webkit-scrollbar {
  display: none;
}

main {
  width: 95%;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

h1 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 1.875rem;
  color: #1d3557;
}

form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5625rem;
}

form label {
  display: none;
}

input[type="text"] {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  line-height: 1.5rem;
  border: 0.1rem solid #cacaca;
  border-radius: 0.625rem;
  background: #fff;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #457b9d;
}

button {
  color: #2980b9;
  background: #e9f2ff;
  border: none;
  border-radius: 0.625rem;
  font-weight: 600;

  padding: 0.625rem 1.125rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: rgb(0 114 175);
  color: white;
}

#results {
  margin-top: 0.7rem;
}

#search-form{
  margin: 0;
  padding: 0;
  align-items: flex-start;
}

#search-form input[type="text"],
#search-form textarea {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  line-height: 1.5rem;
  border: 0.1rem solid #cacaca;
  border-radius: 0.625rem;
  background: #fff;
  transition: border-color 0.2s;
  font-family: inherit;
}

#search-form button {
height: 4.3rem;
}

#search-form input[type="text"]:focus,
#search-form textarea:focus {
  outline: none;
  border-color: #457b9d;
}

#search-form textarea {
  min-height: 3.1rem;
  max-height: 10rem;
  resize: vertical;
  overflow: auto;
  white-space: pre-wrap;
}


.search-controls{
  display: grid;
  padding: 0;
  grid-template-columns: 1fr 1fr;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.top-k-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-k-control label {
  font-weight: 600;
  font-size: 0.9rem;
}

.top-k-control select {
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

.search-mode-control label {
   font-weight: 600;
   font-size: 0.9rem;
}



.result-item {
  background: #ffffff;
  padding: 1.125rem 1.375rem;
  margin-bottom: 1.125rem;
  border-radius: 0.625rem;
  border: 1px solid #e3e6e9;
  box-shadow: 0 0.0625rem 0.125rem rgba(0,0,0,0.05);
}

.result-item:hover {
  box-shadow:
    0 0.35rem 0.7rem rgba(0, 0, 0, 0.10),
    0 0.15rem 0.3rem rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.result-item.selected {
  box-shadow:
    0 0.35rem 0.7rem rgba(0, 0, 0, 0.10),
    0 0.15rem 0.3rem rgba(0, 0, 0, 0.06);
}

.result-item.blurred {
  opacity: 0.5;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;

}

.result-score {
  font-size: 0.85rem;
  color: #6c757d;
  margin-bottom: 0.375rem;
}

.result-pills{
  display: flex;
  flex-direction: row;
  margin-bottom: 0.375rem;
  font-size: 0.85rem;
}

.result-pill {
  background-color: #e7f3ff;
  color: #0b61a4;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  margin-right: 0.5rem;
}

.verified-pill {
  background-color: whitesmoke;
  color: #0b61a4;
  position: relative;
  cursor: pointer;
}

.verified-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%);
  z-index: 50;

  display: none;
  min-width: 140px;
  max-width: 220px;
  max-height: 180px;
  overflow-y: auto;

  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;

  background: whitesmoke;
  color: #0b61a4;
  font-size: 0.78rem;
  line-height: 1.15;

  box-shadow:
    0 0.3rem 0.6rem rgba(0, 0, 0, 0.10),
    0 0.1rem 0.2rem rgba(0, 0, 0, 0.06);
  }


.verified-info-icon {
  font-size: 0.9em;
  line-height: 1;
}

.verified-pill:hover .verified-info-icon {
  opacity: 1;
}

.verified-pill:hover .verified-tooltip {
  display: block;
}

.verified-tooltip-item {
  padding: 0.15rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.verified-tooltip-item + .verified-tooltip-item {
  margin-top: 0.15rem;
  padding-top: 0.15rem;
}

.result-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d3557;
  margin-bottom: 0.375rem;
}

.result-authors {
  font-size: 0.95rem;
  margin-bottom: 0.375rem;
}

.result-author.verified {
  color: rgb(0, 114, 175);
  font-weight: 500;
}

.item-hr{
  border: none;
  border-top: 1px solid #e3e6e9;
  margin: 0.75rem 0;
}

.result-abstract {
  font-size: 0.95rem;
  line-height: 1.45;
  color: #333;
  white-space: pre-wrap;
  margin-bottom: 0.375rem;
}

.result-source {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 0.375rem;
}

.result-source-icon {
  margin-right: 0.15rem;
  color:  rgba(0, 114, 175, 0.925);
  opacity: 0.85;
}

.result-doi{
  font-size: 0.95rem;
  font-weight: 550;
}
.result-doi-link {
  text-decoration: underline;
  font-weight: normal;
  cursor: pointer;
  color: rgb(0, 114, 175);
}


#results p {
  padding: 0.625rem 0.875rem;
  background: #ffffff;
  border: 1px solid #e3e6e9;
  border-radius: 0.375rem;
  color: #444;
}

.main-box {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
}

.search-box,
.similarity-box {
  flex: 1;
}

.similarity-box {
  position: sticky;
  top: 1.25rem;
}

.similarity-box p {
  display: none;
  padding: 0;
  margin: 0;
  font-size: 1rem;
  margin-left: 1rem;
  font-weight: 550;
  border-bottom: 1px solid #e3e6e9;
  padding-bottom: 0.5rem;
}

#similar-items {
  overflow-y: auto;
  max-height: 80vh;
  padding: 2rem 1rem;
}

#similar-items::-webkit-scrollbar {
  width: 6px;
}
#similar-items::-webkit-scrollbar-thumb {
  border-radius: 3px;
}

.form-buttons {
  display: none;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-buttons-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d3557;
  align-self: center;
}

.feedback-btn {
  background: none;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.good-btn {
  color: #007a33;
}

.bad-btn {
  color: #7a0000;
}

.feedback-btn:hover {
  background: none;
  border: none;
  color: black;
  transform: scale(1.1);
}

.feedback-btn.good-btn.active {
  background: rgba(0, 122, 51, 0.15);
}

.feedback-btn.bad-btn.active {
  background: rgba(122, 0, 0, 0.15);
}


.result-feedback {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.thumb-btn {
  background: rgba(0, 122, 51, 0.06);
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  color: #007a33;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.not-relevant-btn {
  color: #7a0000;
  background: rgba(122, 0, 0, 0.06);
}

.thumb-btn:hover {
  background: rgba(0, 122, 51, 0.12);
  border-color: #007a33;
  box-shadow: 0 2px 6px rgba(0, 122, 51, 0.25);
  transform: translateY(-1px);
  color: #007a33;
}

.not-relevant-btn:hover {
  background: rgba(122, 0, 0, 0.12);
  border-color: #7a0000;
  box-shadow: 0 2px 6px rgba(122, 0, 0, 0.25);
  transform: translateY(-1px);
  color: #7a0000;
}

.thumb-btn.active {
  background: rgba(0, 122, 51, 0.25);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
}

.not-relevant-btn.active {
  background: rgba(122, 0, 0, 0.25);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
}


.thumb-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 51, 0.4);
  color: #007a33;
}

.filters-container {
  background: #ffffff;
  border: 1px solid #e3e6e9;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.filters-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.filters-header span {
  font-weight: 700;
  color: #1d3557;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#clear-filters-btn {
  margin-left: auto;
  background: transparent;
  color: #666;
  font-size: 0.8rem;
  padding: 4px 8px;
  border: 1px solid #ccc;
  right: 0;
}

#clear-filters-btn:hover {
  background: #fff0f0;
  color: #d00000;
  border-color: #ffcccc;
}

.filters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-left: 1rem;
}


.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #457b9d;
}

.filter-group label i {
  font-size: 0.75rem;
  opacity: 0.8;
}

.filter-group input, 
.filter-group select {
  padding: 0.3rem 0.6rem;
  margin-bottom: 1rem;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background-color: #f9fbff;
}

.small-input{
  max-width: 5rem;
}

.filter-group input:focus, 
.filter-group select:focus {
  outline: none;
  border-color: #457b9d;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.1);
}

.filter-group input::placeholder {
  color: #adb5bd;
  font-size: 0.85rem;
}

.tell-us-why {
  display: none;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #7a0000;
  cursor: pointer;
}

.global-tell {
  margin-top: 0;
}

.tell-us-why.visible {
  display: inline-flex;
  align-items: center;
}

.tell-us-why:hover {
  color: #a30000;
  background: none;
  transform: scale(1.05);
}

.result-feedback-tellus {
  display: block;
}

.why-panel {
  display: none;
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(122, 0, 0, 0.18);
  background: rgba(122, 0, 0, 0.04);
}

.why-panel.open {
  display: flex;
  flex-direction: column;
}

.why-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.why-close {
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
  font-size: 1rem;
  font-weight: 700;
  color: #7a0000;
  cursor: pointer;
}

.why-close:hover {
  color: #a30000;
  background: none;
  transform: scale(1.05);
}


.why-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #7a0000;
  margin-bottom: 0.5rem;
}

.why-option {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  margin: 0.25rem 0;
  cursor: pointer;
}

.why-option input {
  cursor: pointer;
}

#global-feedback {
  margin: 1rem 0;
}
.global-tell {
  display: none;
  margin-left: 0.5rem;
}

.global-tell.visible {
  display: inline-flex;
  align-items: center;
}

.global-why {
  margin-top: 0.5rem;
}

.why-other-text {
  display: none;
  margin-top: 0.4rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #dce1e7;
  border-radius: 8px;
  background-color: #f9fbff;
  outline: none;
}

.why-other-text.visible {
  display: block;
}

.instructions-help {
  background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
  border: 1px solid #d1d9e6;
  border-radius: 15px;
  padding: 2rem;
  color: #555;
  font-size: 1rem;
  margin: 0 1rem;
  position: relative;
  overflow: hidden;
}

.instructions-help strong {
  color: #457b9d;
  font-weight: 550;
}

.instructions-title{
  color: #1d3557;
  font-size: 1rem;
  font-weight: 550;
  margin-bottom: 0.5rem;
}

.filter-group select {
  cursor: pointer;
  padding: 0.5rem;
  color: rgb(53, 52, 52);
}

.small-input input, .small-input select {
  width: 4.5rem;
}

#filter-year-from, #filter-year-to {
  padding: 0.56rem;
}

.full-width {
  flex: 1;
  width: 25rem;
}

.half-width {
  width: 8rem;
}