/* ---- Theme Variables ---- */

:root {
  --bg:             #f2f2f5;
  --surface:        #ffffff;
  --surface-2:      #f8f8fb;
  --border:         #e2e0ea;
  --text-1:         #1a1820;
  --text-2:         #2e2c3a;
  --text-3:         #565468;
  --accent:         #800020;
  --accent-hover:   #9a0028;
  --accent-text:    #ffffff;
  --navbar-bg:      #ffffff;
  --navbar-border:  #e8e6f0;
  --footer-bg:      #1a1820;
  --shadow:         rgba(0, 0, 0, 0.06);
  --shadow-hover:   rgba(0, 0, 0, 0.13);
}

[data-theme="dark"] {
  --bg:             #161618;
  --surface:        #2c2c3a;
  --surface-2:      #343446;
  --border:         #42425a;
  --text-1:         #ededf0;
  --text-2:         #c4c2ce;
  --text-3:         #9896a6;
  --accent:         #b04040;
  --accent-hover:   #c04a4a;
  --accent-text:    #ffffff;
  --navbar-bg:      #101014;
  --navbar-border:  #1e1e28;
  --footer-bg:      #101014;
  --shadow:         rgba(0, 0, 0, 0.35);
  --shadow-hover:   rgba(0, 0, 0, 0.55);
}

/* ---- Base ---- */

html {
  font-size: 16px;
  font-size: clamp(14px, 1.2vw, 16px);
}

html, body {
  height: 100%;
  word-break: break-word;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: #f2f2f5;
  background-color: var(--bg);
  color: #1a1820;
  color: var(--text-1);
  transition: background-color 0.3s, color 0.3s;
}

.container-fluid {
  padding: 50px 5%;
  text-align: left;
  position: relative;
}

/* ---- Footer ---- */

.footer-div {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
}

.footer {
  height: 40px;
  background-color: #1a1820;
  background-color: var(--footer-bg);
  text-align: center;
  transition: background-color 0.3s;
}

[data-theme="dark"] .footer {
  border-top: 1px solid #42425a;
  border-top: 1px solid var(--border);
}

.footer p {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

/* ---- Navbar ---- */

.navbar {
  background-color: #ffffff !important;
  background-color: var(--navbar-bg) !important;
  border-bottom: 1px solid #e8e6f0;
  border-bottom: 1px solid var(--navbar-border);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 6px var(--shadow);
  transition: background-color 0.3s;
}

.navbar .navbar-nav .nav-link {
  color: #2e2c3a;
  color: var(--text-2);
  font-size: 1.15em;
  font-weight: 500;
  transition: color 0.2s;
}

.navbar-brand {
  color: #1a1820 !important;
  color: var(--text-1) !important;
  font-size: 1.4em;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.navbar .navbar-nav .nav-link:hover {
  color: #800020;
  color: var(--accent);
}

.navbar-toggler {
  border-color: #e2e0ea;
  border-color: var(--border);
}

[data-theme="dark"] .navbar-toggler-icon {
  filter: invert(1);
}

[data-theme="dark"] iframe {
  filter: invert(90%) hue-rotate(180deg);
}

.pp {
  width: 100px;
  border-radius: 100%;
  margin-right: 15px;
}

.sm-icons {
  flex-direction: row;
}

.navbar .navbar-nav .nav-link.active {
  font-weight: 600;
  color: #1a1820 !important;
  color: var(--text-1) !important;
  border-bottom: 3px solid #800020;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 2px;
}

/* ---- Theme Toggle (fixed) ---- */

.theme-toggle-btn {
  position: fixed;
  bottom: 60px;
  right: 24px;
  z-index: 999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid #e2e0ea;
  border: 1px solid var(--border);
  background-color: #ffffff;
  background-color: var(--surface);
  color: #2e2c3a;
  color: var(--text-2);
  font-size: 1.3em;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 10px var(--shadow);
  transition: color 0.2s, background-color 0.3s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  color: #800020;
  color: var(--accent);
  border-color: #800020;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
  box-shadow: 0 4px 16px var(--shadow-hover);
}

/* ---- Home ---- */

.header-div {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 5px;
  padding: 0;
  margin: 0;
  font-size: 1.1em;
  font-weight: 700;
  color: #1a1820;
  color: var(--text-1);
  background: transparent;
  letter-spacing: -0.2px;
}

.header-div::before,
.header-div::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #e2e0ea;
  background: var(--border);
}

.header-div .header-icon {
  color: #800020;
  color: var(--accent);
}

.header-div-publications {
  background: transparent;
}

.main-container {
  width: 100%;
  padding: 0 5%;
}

.content-div {
  padding: 18px 28px;
  margin: 20px 0 24px 0;
  font-size: 0.95em;
  display: inline-block;
  width: 100%;
  border-radius: 12px;
  background-color: #ffffff;
  background-color: var(--surface);
  border: 1px solid #e2e0ea;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px var(--shadow);
  text-align: center;
  font-weight: 400;
  color: #2e2c3a;
  color: var(--text-2);
  transition: background-color 0.3s;
}

.teaching-university {
  display: flex;
  align-items: center;
  gap: 16px;
}

.teaching-logo {
  height: 52px;
  width: 52px;
  object-fit: contain;
}

.teaching-uni-name {
  font-size: 1em;
  font-weight: 600;
  color: #1a1820;
  color: var(--text-1);
}

.teaching-uni-name a {
  color: #1a1820;
  color: var(--text-1);
  text-decoration: none;
}

.teaching-uni-name a:hover {
  color: #800020;
  color: var(--accent);
}

.teaching-role {
  font-size: 0.85em;
  color: #565468;
  color: var(--text-3);
}

.teaching-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.teaching-course {
  color: #2e2c3a;
  color: var(--text-2);
}

.teaching-code {
  font-size: 0.85em;
  color: #565468;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
  margin-left: 12px;
}

.teaching-semesters {
  font-size: 0.8em;
  color: #565468;
  color: var(--text-3);
}

.content-div-logos {
  padding-bottom: 0;
  position: relative;
}

.affiliation-logo {
  position: absolute;
  top: calc(50% - 21px);
  left: 14px;
  transform: translateY(-50%);
  width: 90px;
  height: 90px;
  object-fit: contain;
  opacity: 0.8;
}

.desktop-only {
  display: block;
}

.affiliation-advisor {
  margin: 14px -28px 0 -28px;
  padding: 10px 28px;
  border-top: 1px solid #e2e0ea;
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  color: #2e2c3a;
  color: var(--text-2);
  text-align: center;
}

.position-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 16px -28px 0 -28px;
  padding: 16px 28px;
  border-top: 1px solid #e2e0ea;
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  opacity: 0;
  border-top-width: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, border-top-width 0.3s ease;
}

.content-div-logos:hover .position-logos {
  max-height: 120px;
  padding-top: 16px;
  padding-bottom: 16px;
  opacity: 1;
  border-top-width: 1px;
}

.position-logo {
  height: 90px;
  width: 90px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.position-logo-dlr {
  width: auto;
  height: 76px;
  padding: 6px 16px;
  border-radius: 100px;
  background-color: #ffffff;
}

.position-logo:hover {
  opacity: 1;
}

.content-div a {
  color: #800020;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.content-div a:hover {
  color: #9a0028;
  color: var(--accent-hover);
  text-decoration: underline;
}

.content-row-publication {
  padding: 0;
  margin: 20px 0;
  width: 100%;
}

.header-icon {
  margin-right: 10px;
}

/* ---- Publication ---- */

.col-publication {
  margin-bottom: 24px;
}

.pub-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 64px 64px 32px 32px;
  overflow: hidden;
  background-color: #ffffff;
  background-color: var(--surface);
  border: 1px solid #e2e0ea;
  border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 10px var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.3s;
}

.pub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.13);
  box-shadow: 0 14px 32px var(--shadow-hover);
}

.pub-card-default      { --pub-accent: #6b6880; --pub-shadow: rgba(180, 170, 220, 0.25); }
.pub-card-iccv         { --pub-accent: #8B0000; --pub-shadow: rgba(255, 60, 60, 0.28); }
.pub-card-ijcai        { --pub-accent: #0a5c2e; --pub-shadow: rgba(50, 210, 110, 0.25); }
.pub-card-ijcv         { --pub-accent: #1a1a6e; --pub-shadow: rgba(80, 100, 255, 0.28); }
.pub-card-neurips      { --pub-accent: #5c0a6e; --pub-shadow: rgba(200, 60, 240, 0.28); }
.pub-card-eurographics { --pub-accent: #4a0082; --pub-shadow: rgba(160, 60, 255, 0.28); }

.pub-card-banner {
  height: 50px;
  flex-shrink: 0;
  background-color: #6b6880;
  background-color: var(--pub-accent);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 45%, rgba(0,0,0,0.22) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pub-venue-name {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.92em;
  font-weight: 800;
  letter-spacing: 1px;
}

.pub-venue-year {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9em;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.pub-card-media {
  flex-shrink: 0;
  background: #ffffff;
  border-bottom: 1px solid #e2e0ea;
  border-bottom: 1px solid var(--border);
}

.pub-teaser-media {
  width: 100%;
  height: 155px;
  object-fit: contain;
  display: block;
  padding: 10px 14px;
}

.pub-card-body {
  flex: 1;
  padding: 12px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.pub-title {
  font-size: 0.97em;
  font-weight: 700;
  color: #1a1820;
  color: var(--text-1);
  margin-top: 2px;
  margin-bottom: 0;
  line-height: 1.35;
}

.pub-desc {
  font-size: 0.82em;
  color: #2e2c3a;
  color: var(--text-2);
  margin-top: auto;
  margin-bottom: auto;
  line-height: 1.45;
}

.pub-authors-sep {
  width: 100%;
  border-top: 1px solid #e2e0ea;
  border-top: 1px solid var(--border);
}

.pub-authors {
  font-size: 0.79em;
  color: #565468;
  color: var(--text-3);
  margin: 0;
  line-height: 1.5;
}

.author-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.author-link:hover {
  color: #800020;
  color: var(--accent);
  text-decoration: none;
}

.pub-card-footer {
  flex-shrink: 0;
  background-color: #6b6880;
  background-color: var(--pub-accent);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 45%, rgba(0,0,0,0.18) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  padding: 0.75em 1em;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.82em;
  font-size: clamp(0.65em, 0.9vw, 0.82em);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s;
}

.pub-link:hover {
  color: #ffffff;
  text-decoration: none;
}

.pub-link-sep {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.9em;
  user-select: none;
}

[data-theme="dark"] .pub-card {
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .pub-card:hover {
  box-shadow: 0 0 20px var(--pub-shadow, rgba(0,0,0,0.55));
}


/* ---- Gallery ---- */

.carousel-style {
  margin-top: 25px;
  margin-bottom: 24px;
  margin-left: 5%;
  margin-right: 5%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e0ea;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px var(--shadow);
}

.carousel-img {
  border-radius: 0;
}

.gallery-flag-img {
  height: 40px;
  width: 40px;
  object-fit: cover;
  border-radius: 100%;
  border: 1px solid #e2e0ea;
  border: 1px solid var(--border);
}

/* ---- Contact ---- */

.contact-row {
  align-items: center;
}

.contact-map-col {
  padding-top: 0;
}

.contact-map-col iframe {
  margin-top: 20px;
}

.contact-map-col iframe {
  height: calc(100vh - 316px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px var(--shadow);
  border-radius: 16px;
  border: 1px solid #e2e0ea !important;
  border: 1px solid var(--border) !important;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.contact-icon {
  font-size: 1.3em;
  color: #800020;
  color: var(--accent);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.78em;
  color: #565468;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.contact-value {
  color: #1a1820;
  color: var(--text-1);
  font-weight: 500;
}

.content-div .contact-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid #e2e0ea;
  border: 1px solid var(--border);
  color: #2e2c3a;
  color: var(--text-2);
  font-size: 1.35em;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.content-div .contact-social-link:hover {
  color: #800020;
  color: var(--accent);
  border-color: #800020;
  border-color: var(--accent);
  text-decoration: none;
}

.contact-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---- CV ---- */

.cv-pdf {
  height: calc(100% - 175px);
  width: 100%;
}

.mobile-only {
  display: none;
}

/* ---- Responsive ---- */

@media only screen and (max-width: 990px) {
  .mobile-only {
    display: block;
  }

  .position-logos {
    display: none;
  }

  .content-div-logos {
    padding-bottom: 18px;
  }

  .desktop-only {
    display: none;
  }

  .navbar .navbar-nav .nav-link.active {
    display: inline-block;
  }

  .sm-icons .nav-item {
    padding-right: 1em;
  }

  .pp {
    width: 70px;
    border-radius: 100%;
    margin-right: 15px;
  }

  .navbar-brand {
    font-size: 1.05em;
  }

  .header-div {
    font-size: 0.95em;
  }

  .content-div {
    font-size: 0.9em;
  }

  .header-div-news {
    margin: 30px 0 0 0;
  }

  .cv-pdf {
    height: calc(100% - 145px);
  }

  .contact-map-col iframe {
    height: 350px;
  }

  .pub-link {
    font-size: 0.9em;
  }

  .content-div .contact-social-link {
    width: 38px;
    height: 38px;
    font-size: 0.95em;
  }

  .contact-social {
    gap: 6px;
  }

  .container-fluid {
    padding-top: 24px;
  }

}
