/* ===============================================
   MINGU KANG ACADEMIC WEBSITE
   =============================================== */

:root {
  --primary: #374151;
  --primary-light: #6b7280;
  --primary-dark: #1f2937;
  --accent: #2563eb;
  --accent-secondary: #64748b;
  --bg-light: #f9fafb;
  --bg-card: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border: rgba(0,0,0,0.1);
}

/* Base overrides */
h4 { letter-spacing: .1rem; }
.container { max-width: 800px; }

/* ================ HEADER ================ */
.header {
  margin-top: 50px;
  margin-bottom: 50px;
  text-align: left;
}
.header .row {
  display: flex;
  align-items: center;
}
.profile-photo {
  width: 100%;
  max-width: 180px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.main-description {
  padding-left: 10px;
}
.main-description .name {
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1f2937;
  margin-bottom: 6px;
  line-height: 1.1;
}
.main-description .title {
  font-size: 16px;
  color: #4b5563;
  margin-bottom: 4px;
  font-weight: 400;
}
.main-description .email {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 14px;
}
.social-links {
  display: flex;
  gap: 8px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #4b5563;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 16px;
}
.social-link:hover {
  background: #2563eb;
  color: white;
  transform: translateY(-2px);
}

/* ================ Section Titles ================ */
.section-title {
  margin-bottom: 5px;
}
.title-decoration {
  display: none;
}
.section-subtitle {
  color: #4b5563;
  margin-bottom: 1rem;
  font-size: 15px;
}
.scholar-link {
  color: var(--accent);
  text-decoration: none;
  margin-left: 10px;
}
.scholar-link:hover { text-decoration: underline; }

/* ================ NEURAL MAP ================ */
#neural-map-container {
  position: relative;
  width: 100%;
  height: 420px;
  background: #f8fafc; /* Cleaner solid/subtle background */
  border: 1px solid #e2e8f0;
  border-radius: 12px; /* Softer corners */
  overflow: hidden;
  cursor: grab;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.02); /* Inner depth */
}
#neural-map-container:active { cursor: grabbing; }
#neural-map-container svg { display: block; }
.neural-map-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}
.neural-map-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px; /* Softer buttons */
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.neural-map-controls button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-1px);
}
#neural-tooltip {
  position: absolute;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  backdrop-filter: blur(4px);
}
.neural-node {
  cursor: pointer;
  transition: all 0.3s ease;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.15)); /* Nice depth */
}
.neural-node:hover {
  filter: drop-shadow(0 5px 12px rgba(0,0,0,0.25)) brightness(1.1);
}
.neural-node.active circle {
  stroke: var(--text-primary);
  stroke-width: 3;
}
.neural-link {
  stroke: #cbd5e1; /* Simpler solid color often looks cleaner than gradient */
  stroke-opacity: 0.4;
  transition: all 0.2s;
}
.neural-link.highlighted {
  stroke-opacity: 0.8;
  stroke: var(--text-primary);
  stroke-width: 2px;
}

/* ================ FILTER BAR ================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 6px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}
.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  border-radius: 16px;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.pill:hover {
  border-color: #2563eb;
  color: #2563eb;
}
.pill.active {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}
.pill.small { padding: 6px 12px; font-size: 11px; }
.pill-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.pill-dot.conference { background: var(--accent); }
.pill-dot.preprint { background: var(--accent-secondary); }
.filter-divider {
  width: 1px;
  height: 30px;
  background: var(--border);
}

/* Year slider */
.year-slider-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}
.year-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
}
.year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--primary);
}
.year-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-secondary);
}
#year-display { color: var(--accent); font-weight: 600; }

.active-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.active-filter-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary);
  border-radius: 12px;
  font-size: 11px;
  color: white;
}
.active-filter-tag button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

/* ================ PAPER CARDS ================ */
.paper-card {
  position: relative;
  padding: 18px;
  padding-left: 24px;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.2s ease;
  overflow: hidden;
}
.paper-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.paper-card:hover {
  border-color: var(--primary-light);
}
.paper-card:hover::before { opacity: 1; }

.paper-year-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  background: var(--bg-light);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.paper-type-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.paper-type-indicator.conference { background: var(--accent); }
.paper-type-indicator.preprint { background: var(--accent-secondary); }

.paper-content { position: relative; }
.paper-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  line-height: 1.4;
  padding-right: 50px;
}
.paper-authors {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
  line-height: 1.5;
}
.paper-authors b { color: #1f2937; font-weight: 600; }
.paper-venue {
  font-size: 15px;
  color: #2563eb;
  font-weight: 500;
  margin-bottom: 10px;
}
.paper-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.paper-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}
.keyword-chip {
  padding: 3px 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.keyword-chip:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}
.paper-actions {
  display: flex;
  gap: 8px;
}
.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.paper-card.filtered-out { display: none !important; }

/* ================ STRUCTURED CONTENT SECTIONS ================ */
.news-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.news-list li {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  line-height: 1.5;
}
.news-date {
  flex: 0 0 72px;
  font-weight: 600;
  color: var(--accent);
}
.experience-card {
  margin-bottom: 34px;
}
.experience-card .figure img {
  display: block;
  margin: auto;
  padding-bottom: 3%;
  max-width: 180px;
}
.right-meta {
  float: right;
  color: var(--text-secondary);
  font-weight: 500;
}
.entry-card {
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
}
.entry-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}
.entry-card p {
  margin-bottom: 6px;
}
.entry-meta {
  color: var(--text-secondary);
  font-size: 13px;
  font-style: italic;
}
.compact-filter {
  display: inline-flex;
  margin-bottom: 18px;
}
.content-pane {
  display: none;
}
.content-pane.active {
  display: block;
}

/* ================ BIBTEX TOAST ================ */
.bibtex-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  z-index: 1000;
  transform: translateY(150%);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
.bibtex-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}
.toast-dots {
  display: flex;
  gap: 6px;
}
.toast-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.toast-dots span:nth-child(1) { background: #ef4444; }
.toast-dots span:nth-child(2) { background: #f59e0b; }
.toast-dots span:nth-child(3) { background: #22c55e; }
.toast-title {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: var(--text-secondary);
}
.toast-content {
  padding: 15px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-light);
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  white-space: pre-wrap;
}
.toast-actions {
  display: flex;
  gap: 10px;
  padding: 10px 15px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.toast-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 4px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.toast-btn:hover { background: var(--primary-dark); }
.toast-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  flex: 0;
  width: 36px;
}
.toast-btn.secondary:hover {
  background: var(--bg-light);
}

/* ================ SHARED ELEMENTS ================ */
.paper { margin-bottom: 20px; }
.paper .title { }
.paper p { margin-bottom: 2px; }
.paper-buttons { margin-top: 5px; }
.paper .button {
  display: inline-block;
  height: 25px;
  padding: 0 25px;
  font-weight: 100;
  line-height: 25px;
  text-transform: none;
}
.docs-section {
  border-top: 1px solid #eee;
  padding: 4rem 0;
  margin-bottom: 0;
}
.footer {
  text-align: center;
  color: rgba(0, 0, 0, 0.4);
  border-top: 1px solid #eee;
  padding: 15px 0 40px 0;
  margin-bottom: 0;
}

/* Navbar */
.navbar { display: none; }
.title-subtitle h3 { margin-bottom: 0px; }
.title-subtitle h5 { color: rgba(0, 0, 0, 0.60); }
.image { text-align: center; }

@media (min-width: 550px) {
  .header { margin-top: 5rem; }
}

@media (min-width: 750px) {
  .navbar + .docs-section { border-top-width: 0; }
  .navbar, .navbar-spacer {
    display: block;
    width: 100%;
    height: 6.5rem;
    background: #fff;
    z-index: 99;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
  }
  .navbar-spacer { display: none; }
  .navbar > .container { width: 100%; }
  .navbar-list { list-style: none; margin-bottom: 0; }
  .navbar-item { position: relative; float: left; margin-bottom: 0; }
  .navbar-link {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2rem;
    margin-right: 22px;
    text-decoration: none;
    line-height: 6.5rem;
    color: #222;
  }
  .navbar-link.active { color: #33C3F0; }
  .has-docked-nav .navbar { position: fixed; top: 0; left: 0; }
  .has-docked-nav .navbar-spacer { display: block; }
  .has-docked-nav .navbar > .container { width: 80%; }
}

.figure { display: flex; justify-content: center; align-items: center; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .compact-filter { display: flex; }
  .filter-divider { width: 100%; height: 1px; }
  .year-slider-container { width: 100%; }
  .bibtex-toast { width: calc(100vw - 20px); right: 10px; bottom: 10px; }
  #neural-map-container { height: 450px; }
  .neural-map-controls { bottom: 10px; right: 10px; }
  .news-list li { display: block; }
  .news-date { display: block; margin-bottom: 2px; }
  .right-meta { float: none; display: block; margin-top: 2px; }
}
