/* ====================================================
   enhancements.css — Junxi Yan personal homepage
   Layered on top of mainstar.css and main.css
   ==================================================== */

/* ── Language Toggle Button ── */
.lang-toggle {
  position: fixed;
  top: 1.2em;
  right: 1.4em;
  z-index: 9999;
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.45);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.20);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: "Open Sans", sans-serif;
  font-size: 0.78em;
  user-select: none;
}

.lang-toggle button {
  /* Reset mainstar.css global button overrides */
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none !important;
  border-radius: 0 !important;
  height: auto !important;
  line-height: normal !important;
  padding: 0.35em 0.85em !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
  font-family: "Open Sans", sans-serif !important;
  font-size: 1em !important;
  /* Toggle styles */
  background: none !important;
  background-color: transparent !important;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.75) !important;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  outline: none;
}

.lang-toggle button.active {
  background: rgba(255,255,255,0.25) !important;
  background-color: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}

.lang-toggle button:hover:not(.active) {
  background: rgba(255,255,255,0.12) !important;
  background-color: rgba(255,255,255,0.12) !important;
  color: #fff !important;
}

/* ── Scroll Reveal Animation ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for child items */
.reveal-stagger > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger > *:nth-child(5) { transition-delay: 0.45s; }

/* ── Publication Cards ── */
.pub-card {
  border-left: 3px solid #87CEFA;
  padding: 1.1em 1.5em;
  margin-bottom: 1.6em;
  background: rgba(135,206,250,0.04);
  border-radius: 0 8px 8px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
}

.pub-card:hover {
  transform: translateX(5px);
  box-shadow: -3px 0 14px rgba(135,206,250,0.25);
  background: rgba(135,206,250,0.08);
}

.pub-card .pub-title {
  font-family: "Roboto Slab", serif;
  font-size: 1.05em;
  font-weight: 700;
  color: #3d4449;
  margin: 0 0 0.35em 0;
  line-height: 1.4;
}

.pub-card .pub-title a {
  color: inherit;
  border-bottom: none;
  text-decoration: none;
  transition: color 0.2s;
}

.pub-card .pub-title a:hover {
  color: #87CEFA !important;
}

.pub-card .pub-venue {
  display: inline-block;
  margin-bottom: 0.6em;
}

.pub-card .pub-authors {
  font-size: 0.88em;
  color: #7f888f;
  margin: 0 0 0.6em 0;
  line-height: 1.55;
}

.pub-card .pub-authors strong {
  color: #3d4449;
}

.pub-card .pub-links {
  font-size: 0.85em;
  margin: 0.4em 0 0;
}

.pub-card .pub-links a {
  display: inline-block;
  margin-right: 0.8em;
  padding: 0.18em 0.7em;
  border: 1px solid #87CEFA;
  border-radius: 12px;
  color: #87CEFA !important;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pub-card .pub-links a:hover {
  background: #87CEFA;
  color: #fff !important;
}

/* ── Venue Badge ── */
.badge {
  display: inline-block;
  padding: 0.18em 0.65em;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: "Open Sans", sans-serif;
  margin-right: 0.5em;
  vertical-align: middle;
}

.badge-iclr    { background: #e8f4fd; color: #2980b9; border: 1px solid #aed6f1; }
.badge-emnlp   { background: #eaf6f0; color: #1e8449; border: 1px solid #a9dfbf; }
.badge-survey  { background: #fdf3e7; color: #d35400; border: 1px solid #f8c471; }
.badge-sigir   { background: #fef5e7; color: #b7770d; border: 1px solid #f9d27c; }
.badge-icml    { background: #f5eef8; color: #7d3c98; border: 1px solid #d2b4de; }
.badge-neurips { background: #eaf3fb; color: #1a5276; border: 1px solid #85c1e9; }
.badge-nature  { background: #e9f7ef; color: #1d6a3b; border: 1px solid #82e0aa; }

/* ── Research Interest Tags ── */
.interest-tags {
  margin: 0.8em 0 1.6em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
  padding: 0;
}

.interest-tags li {
  display: inline-block;
  padding: 0.28em 0.85em;
  background: rgba(135,206,250,0.10);
  border: 1px solid rgba(135,206,250,0.4);
  border-radius: 14px;
  font-size: 0.82em;
  color: #3d4449;
  font-family: "Open Sans", sans-serif;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  cursor: default;
}

.interest-tags li:hover {
  background: #87CEFA;
  border-color: #87CEFA;
  color: #fff;
}

/* ── Recent News Timeline ── */
.news-section {
  margin: 2em 0 2.5em;
}

.news-section h2 {
  font-size: 1.5em;
  margin-bottom: 1em;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.news-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.news-timeline::before {
  content: '';
  position: absolute;
  left: 0.55em;
  top: 0.3em;
  bottom: 0.3em;
  width: 2px;
  background: linear-gradient(to bottom, #87CEFA, rgba(135,206,250,0.15));
  border-radius: 1px;
}

.news-timeline li {
  position: relative;
  padding: 0 0 1.1em 2.2em;
  font-size: 0.92em;
  line-height: 1.6;
  color: #5a6370;
}

.news-timeline li::before {
  content: '';
  position: absolute;
  left: 0.25em;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #87CEFA;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #87CEFA;
  z-index: 1;
}

.news-timeline li:first-child::before {
  background: #2ecc71;
  box-shadow: 0 0 0 2px #2ecc71;
}

.news-date {
  display: inline-block;
  font-size: 0.82em;
  font-weight: 700;
  color: #87CEFA;
  margin-right: 0.6em;
  font-family: "Open Sans", sans-serif;
  letter-spacing: 0.02em;
}

.news-timeline li:first-child .news-date {
  color: #2ecc71;
}

.news-content {
  color: #3d4449;
}

.news-content a {
  color: #87CEFA;
  border-bottom: dotted 1px;
}

/* ── Section Divider ── */
.section-divider {
  border: none;
  border-top: 1.5px solid rgba(210,215,217,0.6);
  margin: 2em 0;
}

/* ── Subtle header accent ── */
#header .logo strong {
  position: relative;
}

#header .logo strong::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #87CEFA;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

#header .logo:hover strong::after {
  transform: scaleX(1);
}

/* ── Publications page intro text ── */
.pub-intro {
  color: #7f888f;
  font-size: 0.92em;
  margin-bottom: 2em;
  padding: 0.8em 1.2em;
  background: rgba(230,235,237,0.3);
  border-radius: 6px;
  border-left: 3px solid rgba(210,215,217,0.8);
}

/* ── Responsive adjustments ── */
@media screen and (max-width: 736px) {
  .lang-toggle {
    top: 0.8em;
    right: 0.8em;
    font-size: 0.72em;
  }

  .pub-card {
    padding: 0.9em 1.1em;
  }

  .interest-tags li {
    font-size: 0.78em;
    padding: 0.24em 0.7em;
  }
}

@media screen and (max-width: 480px) {
  .news-timeline::before {
    left: 0.45em;
  }

  .news-timeline li {
    padding-left: 1.8em;
  }
}
