/* =====================================================
   1. THEME SYSTEM (Gruvbox Dark + Light)
   ===================================================== */

:root {
  /* DARK (default) */
    --bg: #2a2a2a;
    --bg-secondary: #1d2021;

    --text: #e5e7eb;
    --text-soft: #d5c4a1;
    --text-muted: #928374;

    --accent-blue: #458588;
    --accent-blue-hover: #83a598;
    --accent-yellow: #fabd2f;
    --accent-purple: #b16286;
    --accent-green: #8ec07c;
    --accent-red: #fb4934;

    --border: #3c3836;
}

body.light-mode {
  /* LIGHT (Gruvbox light) */
  --bg: #fbf1c7;
  --bg-secondary: #f2e5bc;

  --text: #3c3836;
  --text-soft: #504945;
  --text-muted: #7c6f64;

  --accent-blue: #076678;
  --accent-blue-hover: #458588;
  --accent-yellow: #b57614;
  --accent-purple: #8f3f71;
  --accent-green: #79740e;
  --accent-red: #9d0006;

  --border: #d5c4a1;
}


/* =====================================================
   2. BASE
   ===================================================== */

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background-color 0.7s ease, color 0.7s ease;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}

a:hover {
  color: var(--accent-blue-hover);
}


/* =====================================================
   3. NAVBAR
   ===================================================== */

.top-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
}

.nav-left {
  display: flex;
  gap: 28px;
}

.nav-right {
  display: flex;
  align-items: center;
}

.top-nav a {
  color: var(--text-muted);
  font-size: 15px;
}

.top-nav a.active {
  color: var(--accent-blue);
}


/* =====================================================
   4. LAYOUT (Homepage grid)
   ===================================================== */

.container {
  max-width: 1100px;
  margin: 120px auto 80px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 60px;
}

.main h1 {
  font-size: 60px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.main h1 span {
  color: var(--accent-yellow);
}

.subtitle {
  color: var(--text-muted);
  font-size: 20px;
  margin-bottom: 10px;
}


/* =====================================================
   5. CONTENT SECTIONS
   ===================================================== */

.section {
  margin-top: 45px;
  padding-left: 14px;
}

.section h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text);
}
.section h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text);
}

.section p {
  color: var(--text-soft);
  font-size: 15px;
  text-align: justify;
}

.research-list {
  margin-top: 10px;
  padding-left: 18px;
}

.research-list li {
  margin-bottom: 10px;
  color: var(--text-soft);
}

.research-list strong {
  color: var(--accent-blue-hover);
}


/* =====================================================
   6. SIDEBAR (Profile + Contact)
   ===================================================== */

.sidebar {
  text-align: left;
}

.profile-img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 25px;
}

.contact-card {
  padding: 18px 20px;
  background-color: var(--bg-secondary);
  border-left: 3px solid var(--accent-purple);
  border-radius: 6px;
  transition: background-color 0.5s ease, border-color 0.5s ease;
}

.contact-title {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.contact-item {
  margin-bottom: 12px;
}

.contact-item i {
  width: 18px;
  margin-right: 6px;
  color: var(--text-muted);
}

.contact-item a {
  color: var(--accent-blue);
  font-size: 14px;
}

.contact-item a:hover {
  color: var(--accent-blue-hover);
}

.address {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 15px;
}


/* =====================================================
   7. THEME TOGGLE (Slider + Icons)
   ===================================================== */

.theme-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Icons */
.toggle-icon {
  font-size: 13px;
  transition: all 0.25s ease;
}

.moon {
  color: #ebdbb2;
}

.sun {
  color: #7c6f64;
}

body.light-mode .moon {
  opacity: 0.4;
}

body.light-mode .sun {
  opacity: 1;
  color: var(--accent-yellow);
}

/* Slider */
.theme-switch {
  position: relative;
  width: 42px;
  height: 22px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background-color: var(--border);
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.4s ease;
}

/* Knob */
.slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background-color: var(--text);
  border-radius: 50%;
  transition: transform 0.4s ease, background-color 0.4s ease;
}

/* Active state */
input:checked + .slider {
  background-color: var(--accent-yellow);
}

input:checked + .slider::before {
  transform: translateX(20px);
}


/* =====================================================
   8. HOVER EFFECTS (Gruvbox subtle glow)
   ===================================================== */

.theme-toggle-wrapper:hover .toggle-icon {
  transform: translateY(-1px);
}

body:not(.light-mode) .theme-toggle-wrapper:hover .moon {
  text-shadow: 0 0 6px rgba(235, 219, 178, 0.35);
}

body.light-mode .theme-toggle-wrapper:hover .sun {
  text-shadow: 0 0 6px rgba(181, 118, 20, 0.35);
}


/* =====================================================
   9. RESPONSIVE
   ===================================================== */

@media (max-width: 800px) {
  .container {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   10. PUBLICATIONS PAGE
   ===================================================== */
/* =====================================================
   PUBLICATIONS LAYOUT (separate from homepage)
   ===================================================== */

.publications-container {
  max-width: 900px;              /* narrower = better readability */
  margin: 120px auto 80px auto;
  padding: 0 20px;
}
/* Page title (override homepage style slightly) */
h1 {
  font-size: 40px;
  color: var(--accent-yellow);
}

/* Section headers (Journal / Conference) */
.section-title {
  margin-top: 32px;
  font-size: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
}

/* Individual publication block */
.pub {
  margin-top: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-left: 16px;
  transition: transform 0.2s ease;
}

/* Left accent bar */
.pub::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 3px;
  height: 70%;
  background: var(--accent-red);
  opacity: 0.6;
}

/* Hover effect */
.pub:hover {
  transform: translateX(6px);
}

/* Title */
.pub-title {
  font-size: 18px;
  margin-bottom: 5px;
  line-height: 1.4;
}

/* Authors */
.pub-authors {
  color: var(--text-muted);
  font-size: 14px;
}

.pub-authors strong {
  color: var(--text);
}

/* Journal info */
.pub-journal {
  color: var(--text-muted);
  font-size: 14px;
  margin: 5px 0 10px;
}

/* Buttons (DOI / arXiv / Link) */
.btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 5px;
  margin-right: 8px;
  display: inline-block;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

/* Button colors (using theme variables) */
.btn-doi {
  background: var(--accent-green);
  color: var(--bg);
}

.btn-arxiv {
  background: var(--accent-blue);
  color: var(--bg);
}

.btn-link {
  background: var(--accent-purple);
  color: var(--bg);
}

/* Year grouping */
.year-block {
  margin-top: 50px;
}

.year-header {
  display: flex;
  justify-content: flex-end;
}

.year-title {
  font-size: 30px;
  color: var(--text-muted);
  opacity: 0.9;
}

/* =====================================================
   11. TALKS PAGE
   ===================================================== */

/* Container (same philosophy as publications) */
.talks-container {
  max-width: 900px;
  margin: 120px auto 80px auto;
  padding: 0 20px;
}

/* Subtitle */
.talks-container .subtitle {
    font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* Timeline wrapper */
.timeline {
  margin-top: 10px;
}

/* Individual talk block */
.talk {
  position: relative;
  padding-left: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-top: 20px;
}

/* Left accent bar (same visual language as publications) */
.talk::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 3px;
  height: 70%;
  background: var(--accent-red);
  border-radius: 2px;
  opacity: 0.6;
}

/* Title */
.talk-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* Meta info */
.talk-meta {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Location */
.talk-location {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Button (reuse global .btn, just adjust spacing) */
.talk .btn {
   background: var(--accent-blue);
  color: var(--bg);
}

/* Year grouping */
.year-block {
  margin-top: 50px;
}

.year-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.year-title {
  font-size: 24px;
  color: var(--text-muted);
  opacity: 0.8;
}

/* =========================================
   TEACHING PAGE (SIMPLE SINGLE COLUMN)
   ========================================= */

body.teaching-page .container {
  max-width: 820px;
  margin: 120px auto 80px auto;
  padding: 0 20px;

  display: block;   /* force single column */
}

/* Title */
body.teaching-page h1 {
  font-size: 42px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* Subtitle */
body.teaching-page .subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 40px;
}

/* Section */
body.teaching-page .section {
  margin-top: 30px;
}

/* Entry (publication-style but simpler) */
body.teaching-page .entry {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);

  position: relative;
  padding-left: 14px;

  transition: transform 0.2s ease;
}

/* Accent bar */
body.teaching-page .entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 3px;
  height: 65%;
  background: var(--accent-purple);
  opacity: 0.6;
  border-radius: 2px;
}

/* Hover */
body.teaching-page .entry:hover {
  transform: translateX(4px);
}

/* Institution */
body.teaching-page .institution {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* Year */
body.teaching-page .year {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Courses */
body.teaching-page .course {
  font-size: 14px;
  color: var(--text-soft);
  margin-left: 10px;
  margin-bottom: 3px;
}

/* =====================================================
   CV PAGE (FULL CONTENT, DENSE LAYOUT)
   ===================================================== */

body.cv-page .container {
  max-width: 1100px;
  margin: 100px auto 60px auto;
  padding: 0 20px;
  display: block;
}

/* HEADER */
.cv-header {
  margin-bottom: 25px;
}

.cv-name {
  font-size: 40px;
  font-weight: 600;
}

.cv-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cv-contact {
  font-size: 12.5px;
  color: var(--text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

/* SECTION */
.cv-section {
  margin-top: 25px;
}

.cv-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-yellow);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 12px;
}

/* TWO COLUMN DENSE BLOCK */
.cv-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

/* ITEMS */
.cv-item {
  font-size: 13.5px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.cv-item strong {
  color: var(--text);
}

/* PUBLICATIONS */
.cv-pub {
  font-size: 13px;
  margin-bottom: 6px;
  line-height: 1.4;
}

/* COMPACT LIST */
.cv-list {
  column-count: 2;
  column-gap: 30px;
}

.cv-list .cv-item {
  break-inside: avoid;
}

/* SMALL TEXT */
.cv-small {
  font-size: 12px;
  color: var(--text-muted);
}

/* RESPONSIVE */
@media (max-width: 800px) {
  .cv-columns,
  .cv-list {
    column-count: 1;
    grid-template-columns: 1fr;
  }
}
/* =========================================
   RESEARCH METRICS BLOCK
   ========================================= */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.metric-card {
  background: var(--bg-secondary);
  padding: 18px;
  border-radius: 6px;
  border-left: 3px solid var(--accent-green);
  text-align: center;
}

.metric-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent-yellow);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
/* NAV LINKS */
.top-nav a {
  color: var(--text-muted);
  font-size: 15px;
  position: relative;
  transition: color 0.25s ease;
}

/* HOVER EFFECT */
.top-nav a:hover {
  color: var(--text);
}

/* ACTIVE LINK */
.top-nav a.active {
  color: var(--accent-blue);
}

/* UNDERLINE ANIMATION (clean, modern) */
.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--accent-blue);
  transition: width 0.25s ease;
}

/* SHOW underline on hover */
.top-nav a:hover::after {
  width: 100%;
}

/* KEEP underline for active page */
.top-nav a.active::after {
  width: 100%;
}

/* CV DOWNLOAD BUTTON */
.cv-download {
  margin-top: 15px;
}

.btn-download {
  background: var(--accent-blue);
  color: var(--bg);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-download i {
  margin-right: 6px;
}

/* Hover = consistent with your design language */
.btn-download:hover {
  transform: translateY(-1px);
  background: var(--accent-blue-hover);
}