:root { 
  --bg-color: #2B2E34; 
  --card-bg: #4D5057; 
  --text-color: #F1F3F5; 
  --secondary-text: #C7CBD1; 
  --border-color: #666; 
  --accent-color: #4F8CFF; 
}
.light-theme { 
  --bg-color: #f5f5f5; 
  --card-bg: #ffffff; 
  --text-color: #222222;
  --secondary-text: #666666; 
  --border-color: #ccc; 
  --accent-color: #4F8CFF; 
}
.sepia-theme { 
  --bg-color: #F4ECD8; 
  --card-bg: #E8DFC8; 
  --text-color: #3E372C; 
  --secondary-text: #6B5E4B;
  --border-color: #C8BDA8; 
  --accent-color: #9C6B30; 
} 
.slate-theme { 
  --bg-color: #25282D; 
  --card-bg: #32363C; 
  --text-color: #E2E5E9; 
  --secondary-text: #9AA0A6; 
  --border-color: #454A52; 
  --accent-color: #8FA3BF; 
} 
.forest-theme { 
  --bg-color: #1F2A24; 
  --card-bg: #2B3A31; 
  --text-color: #E6F2EA; 
  --secondary-text: #A5B8AC; 
  --border-color: #3F5247; 
  --accent-color: #4CAF7D; 
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', system-ui, sans-serif;
}
button {
    all: unset;
}
i {
  color: var(--text-color);
  font-size: 1.5em;
}

.navbar {
  z-index: 999;
  background: var(--card-bg);
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 7px;
  box-shadow: 5px 10px 15px rgba(0, 0, 0, 0.1);
  border-radius: 30px;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
}

.navbar__item {
  width: 30px;
  height: 30px;
  cursor: pointer;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  position: relative;
  color: var(--text-color);
}

.navbar__item::before,
.navbar__item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform: scale(0.8);
  opacity: 0;
  transition: all .55s cubic-bezier(0.71, 0.03, 0.23, 0.95);
}

.navbar__item::after {
  box-shadow: 0 7px 15px currentColor;
}

.navbar__item:hover::before,
.navbar__item:hover::after {
  transform: translateY(60px) scale(1.1);
}

.navbar__item:hover::before {
  opacity: 1;
}

.navbar__item:hover::after {
  opacity: 0.4;
}

.navbar__icon {
  transition: all .5s cubic-bezier(0.71, 0.03, 0.23, 0.95);
  transition-delay: 0.1s;
  z-index: 2;
}

.navbar__item:hover .navbar__icon {
  transform: translateY(58px) scale(1.25);
  color: var(--bg-color);
}

.hero {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
}
.header {
  font-size: 2.55rem;
  margin-top: 168px;
  font-weight: 700;
  color: var(--text-color);
  text-align: center;
}

.flow-up {
    animation: 1.5s fadeInUp;
}
.flow-in {
    animation: 1.5s fadeIn;
}

@keyframes fadeInUp {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0%);
    opacity: 1;
  }
}
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.searchparent {
    margin: auto;
  display: grid;
  place-items: center;
  gap: 0px;
}

.swipeparent {
  padding-top: 100px;
    margin: auto;
  display: grid;
  place-items: center;
  gap: 0px;
}

/* CONTAINER */
#search {
    grid-column: span 6;
  display: flex;
  align-items: center;
  width: 700px;
  height: 50px;
  padding: 5px;
  border-radius: 50px;
  background-color: var(--card-bg);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

  #yearfilter {
    grid-column: span 6;
    margin-top: 24px;
  display: grid;
  gap: 12px;
  text-align: center;
}

.inputwrap {
  flex: 1;
  display: flex;
  padding-left: 10px;
  transition: flex .45s cubic-bezier(0.71, 0.03, 0.23, 0.95),
              opacity .2s ease;
}

/* INPUT */
#searchinput {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-family: system-ui, sans-serif;
}

#searchinput:focus {
  outline: none;
}

/* BUTTON */
#searchbutton {
  flex: 0 0 55px;
  margin-right: 10px;
  text-align: center;
  height: 40px;
  border-radius: 40px;
  border: none;
  background-color: var(--accent-color);
  color: white;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  align-self: right;
  transition: flex 1s ease-in;
}

.btn-content {
  font-size: 1.25em;
}

#search.loading .inputwrap {
  flex: 0;
  opacity: 0;
}

#search.loading #searchbutton {
  flex: 0 0 50px;
}

#searchbutton.loading .btn-content {
  opacity: 0;
}

#searchbutton.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-top: 3px solid transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

#search.active #searchinput {
  flex: 0;
}

/* CONTAINER */
#yearfilter {
    margin-top: 24px;
  grid-column: 3 / span 1;
  display: grid;
  gap: 12px;
  text-align: center;
}

#yearfilter {
  margin-top: 24px;
  grid-column: 3 / span 1;
  display: grid;
  gap: 12px;
  text-align: center;
  justify-items: center; /* important */
}

.year-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 260px;
  padding: 16px;
  border-radius: 20px;
  background-color: var(--card-bg);
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}
.year-inputs span {
  color: var(--secondary-text);
}

/* INPUTS */
.year-inputs input {
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--bg-color);
  color: var(--text-color);
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
}

.year-inputs input:focus {
  outline: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.scope-filter {
  margin-top: 24px;
  display: grid;
  gap: 10px;
  justify-items: center;
  font-family: 'Inter', system-ui, sans-serif;
}

.scope-label {
  font-size: 0.9rem;
  color: var(--secondary-text);
}

.scope-options {
  display: flex;
  background: var(--card-bg);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

.scope-options input {
  display: none;
}

.scope-options label {
  position: relative;
  cursor: pointer;
}

.scope-options span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--text-color);
  border-radius: 999px;
  transition: 
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.2s ease;
}

.scope-options label:hover span {
  background-color: rgba(79, 140, 255, 0.15);
}

/* Checked state */
.scope-options input:checked + span {
  background-color: var(--accent-color);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(79, 140, 255, 0.45);
  transform: scale(1.05);
}

.scope-hint {
  font-size: 0.75rem;
  color: #9AA0A6;
}

#resultparent {
  display: grid;
  margin: 24px auto;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  grid-auto-rows: 200px;
  max-width: 750px; 
  gap: 32px;
}

.result {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
    cursor: pointer;
  transition: all 0.3s ease;

  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

}

/* backdrop */
.result.expanded::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

/* expanded card styling */
.result.expanded {
  position: fixed;
  inset: 0;
  z-index: 1000;

  background: #3F4248;
  padding: 3rem 4rem;
  overflow-y: auto;

  display: flex;
  justify-content: center;
}
.close {
  position: absolute;
  opacity: 0;
}

.result.expanded .close{
  opacity: 100%;
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  color: white;

  font-size: 1.75rem;
  background: rgba(0,0,0,0.08);
  border: none;
  border-radius: 999px;
  width: 42px;
  height: 42px;

  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.close:hover {
  background: rgba(0,0,0,0.15);
}


.result.expanded .close {
  display: flex;
}


/* Hover lift */
.result:hover {
  transform: translateY(-6px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.result.expanded:hover{transform: translateY(0px);}

.result h2 {
  padding-bottom: 2px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
  margin: 0 0 0.25rem;

  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;

  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.result h3 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #9AA0A6;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


.result .abstract {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--secondary-text);

  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.abstract {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--secondary-text);
}

.result.expanded .abstract {
  overflow:unset;
}

.result .links {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.result .links a {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;

  color: var(--accent-color);
  background: rgba(79, 140, 255, 0.12);

  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease;
}

.result .links a:hover {
  background: var(--accent-color);
  color: #ffffff;
  transform: translateY(-2px);
}

.swipe-container {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  display: grid;
}

.swipe-card {
  width: 670px;
  height: 400px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
      transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    opacity 0.2s ease;
}

.swipe-card.is-saving {
  transform: rotate(1deg) translateX(8px);
  box-shadow:
    0 24px 48px rgba(0,0,0,0.35),
    0 0 40px rgba(63, 163, 77, 0.6);
}

.swipe-card.is-discarding {
  transform: rotate(-1deg) translateX(-8px);
  box-shadow:
    0 24px 48px rgba(0,0,0,0.35),
    0 0 40px rgba(178, 58, 58, 0.6);
}

.swipe-card.exit-right {
  transform: translateX(120%) rotate(6deg);
  opacity: 0;
}

.swipe-card.exit-left {
  transform: translateX(-120%) rotate(-6deg);
  opacity: 0;
}

.swipe-title {
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swipe-meta {
  color:var(--accent-color);
}

.swipe-abstract {
  margin-top: 0.75rem;
  color: var(--secondary-text);
  font-size: 0.95rem;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swipe-actions {
  margin-top: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 350px);
  grid-template-rows: 100px;
}

.save {
  text-align: center;
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);

  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;

}

.save:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px var(--accent-color);
}

.discard { 
  background: var(--card-bg);
  border-radius: 16px;
  text-align: center;
  color: var(--text-color);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.discard:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px var(--accent-color);

}

.saved-table {
  justify-self: center;
  width: 720px;
  margin-top: 24px;
  border-collapse: collapse;
  color: var(--text-color);
  font-family: "Segoe UI", sans-serif;
  background: #2F3136; /* match dark theme */
  border-radius: 12px;
  overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    margin-bottom: 40px;

}

.saved-table thead {
  background-color: var(--card-bg);
}

.saved-table th,
.saved-table td {
  padding: 12px 16px;
  text-align: left;
}

.saved-table th {
  font-weight: 600;
  color: var(--secondary-text);
  font-size: 0.95rem;
}

.saved-table td {
  font-size: 0.9rem;
  border-bottom: 1px solid var(--bg-color);
}

.saved-table tr:last-child td {
  border-bottom: none;
}

.saved-table a {
  color: var(--accent-color);
  text-decoration: none;
  margin-right: 8px;
  font-weight: 500;
}

#saved-body tr{
  background-color: var(--card-bg);
}

.saved-table a:hover {
  text-decoration: underline;
}

.saved-table tbody tr {
  transition: all ease 0.3s;
  animation: rowIn 0.25s ease-out;
}
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.saved-table tbody tr:hover {
  background-color: var(--bg-color);
}

.settings-container {
  max-width: 700px;
  margin: 40px auto;
  padding: 30px;
  padding-top: 75px;
  background-color: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  color: var(--text-color);
  font-family: system-ui, sans-serif;
}

/* HEADINGS */
.settings-container h1 {
  font-size: 28px;
  margin-bottom: 20px;
  text-align: center;
}

.settings-group h2 {
  font-size: 20px;
  margin-top: 25px;
  margin-bottom: 15px;
  border-bottom: 1px solid #666;
  padding-bottom: 6px;
}

.setting {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

/* LABELS */
.setting label {
  font-size: 14px;
  margin-bottom: 6px;
  color: #ccc;
}

/* INPUTS / SELECTS */
.setting input[type="number"],
.setting select {
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  outline: none;
  transition: all 0.2s ease;
}

.setting input[type="number"]:focus,
.setting select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 5px rgba(79,140,255,0.5);
}

/* CHECKBOX */
.setting input[type="checkbox"] {
  accent-color: var(--accent-color); /* modern blue check */
  margin-right: 8px;
}

/* HOVER / INTERACTION FEEDBACK */
.setting input[type="number"]:hover,
.setting select:hover {
  border-color: var(--accent-color);
}

.setting .hint {
  font-size: 12px;
  color: var(--secondary-text);
  margin-top: 4px;
}

@media (max-width: 600px) {
  .settings-container {
    padding: 20px;
  }

  .setting input[type="number"],
  .setting select {
    font-size: 13px;
  }
}

.about-page {
  max-width: 800px;
  margin: 60px auto;
  margin-top: 0;
  padding: 0 20px;
  padding-top: 75px;
  color: var(--text-color);
}

.about-hero {
  text-align: center;
  margin-bottom: 60px;
}

.about-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--accent-color);
}

.about-hero p {
  font-size: 1.1rem;
  color: var(--secondary-text);
}

.about-section {
  background: var(--card-bg);
  padding: 30px 35px;
  margin-bottom: 40px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.about-section h2 {
  margin-bottom: 15px;
  font-size: 1.4rem;
  color: var(--accent-color);
}

.about-section p {
  line-height: 1.6;
  margin-bottom: 15px;
  color: var(--secondary-text);
}

.about-section ul {
  padding-left: 20px;
  margin-top: 10px;
}

.about-section li {
  margin-bottom: 8px;
  color: var(--secondary-text);
}

/* LINKS */
.about-section a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.about-section a:hover {
  text-decoration: underline;
}

.about-section:last-of-type {
  border-left: 4px solid var(--accent-color);
}

  @media (max-width: 768px) {
  .searchparent, .swipeparent {
    display: block;
  }

  .swipe-container {
    margin: 16px auto 0;
    max-width: 450px;
    display: grid;
    place-items: center;
  }

  .swipe-card {
    width: 100%;
    max-width: 450px;
  }

  .swipe-actions {
    width: 100%;
    max-width: 450px;
    grid-template-columns: 1fr 1fr;
  }

  .saved-table {
    width: 100%;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 900px) { 
  #search,
  #yearfilter,
  .scope-filter {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
  }
}