/* Updated CSS for Modern Tab-Based CV Layout */

:root {
  --primary-color: #007bff;
  --text-color: #333;
  --bg-color: #ffffff;
  --light-bg: #f9f9f9;
  --active-tab-bg: #007bff;
  --active-tab-text: #fff;
  --inactive-tab-bg: #eaeaea;
  --inactive-tab-text: #444;
}

/* Base Reset and Typography */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #fff;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  line-height: 1.6;
  text-align: justify;
}

h1, h2 {
  font-weight: 700;
  color: var(--text-color);
  margin-top: 0;
}

h1 {
  font-size: 2em;
}

h2 {
  font-size: 1.6em;
  margin-bottom: 0.5em;
  position: relative;
  display: inline-block;
}

h2::after {
  content: "";
  position: absolute;
  bottom: -0.25em;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
}

/* Navigation Tabs */
nav {
  background: #fff;
  border-bottom: 1px solid #ddd;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.nav-container {
  max-width: 1000px;
  margin: auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 60px;
  justify-content: space-between;
}

.logo {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li {
  margin-left: 20px;
}

.nav-links a {
  text-decoration: none;
  font-weight: 600;
  padding: 10px 15px;
  border-radius: 5px;
  background: var(--inactive-tab-bg);
  color: var(--inactive-tab-text);
  transition: background 0.3s ease, color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--active-tab-bg);
  color: var(--active-tab-text);
}

.cv-link a {
  background: var(--primary-color);
  color: #fff !important;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: 600;
}

.cv-link a:hover {
  background: #0069d9;
}

.container {
  max-width: 1000px;
  margin: auto;
}

.alt-section {
  background: var(--light-bg);
}

.tight-section {
  padding-top: 30px;
  padding-bottom: 30px;
}

/* Responsive Navigation */
#menu-toggle {
  display: none;
}

.hamburger {
  display: none;
  font-size: 1.5em;
  cursor: pointer;
}

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

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    display: none;
    width: 100%;
    background: #fff;
    position: absolute;
    top: 60px;
    left: 0;
  }

  #menu-toggle:checked ~ .nav-links {
    display: flex;
  }

  .nav-links li {
    width: 100%;
    margin: 0;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 20px;
    border-radius: 0;
  }
}

/* Profile Image */
.profile-pic {
  width: 280px; /* Tăng kích thước */
  border-radius: 50%;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.intro-text {
  flex: 1;
}

.tagline {
  font-weight: 600;
  color: var(--primary-color);  /* Thêm dòng này */
  margin-top: -10px;
}

.btn {
  background: var(--primary-color);
  color: #fff;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  display: inline-block;
  margin-top: 1em;
}

.btn:hover {
  background: #0069d9;
}

.awards-list,
.projects-list {
  list-style: none;
  padding-left: 0;
}

.awards-list > li,
.projects-list > li {
  margin-bottom: 1em;
}

.awards-list ul,
.projects-list ul {
  margin-left: 1.2em;
  list-style: circle;
}

#contact p {
  margin: 0.5em 0;
}

/* Add padding to main content to avoid overlap with fixed navbar */
.tab-content {
  padding-top: 50px; /* Pushes content down by 80px */
}

/* === DARK MODE === */
body.dark-mode {
  --bg-color: #121212;
  --text-color: #ffffff;
  --inactive-tab-bg: #2c2c2c;
  --inactive-tab-text: #dddddd;
  --active-tab-bg: #007bff;
  --active-tab-text: #ffffff;
}

body.dark-mode nav {
  background: var(--bg-color);
  border-bottom: 1px solid #444;
}

body.dark-mode .alt-section {
  background: var(--light-bg);
}

body.dark-mode .btn {
  background: #0d6efd;
}

body.dark-mode .btn:hover {
  background: #0a58ca;
}

#dark-mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 15px;
  padding: 5px;
  transition: transform 0.3s ease;
}

#dark-mode-toggle img {
  filter: brightness(0) invert(1); /* Đảm bảo hiển thị tốt ở dark mode */
  transition: transform 0.3s ease, filter 0.3s ease;
}

body:not(.dark-mode) #dark-mode-toggle img {
  filter: none;
}

#dark-mode-toggle:hover img {
  transform: scale(1.2);
}

.theme-toggle {
  display: flex;
  align-items: center;
  margin-left: 10px;
}

.theme-toggle button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  transition: transform 0.2s ease;
}

.theme-toggle button:hover {
  transform: scale(1.1);
}

.theme-toggle img {
  width: 24px;
  height: 24px;
}

.section-divider {
  height: 1px;
  margin: 2rem 0;
  background-color: #ccc; /* Màu sáng mặc định */
  transition: background-color 0.3s;
}

body.dark-mode .section-divider {
  background-color: rgba(255, 255, 255, 0.1); /* Màu mờ cho dark mode */
}

/* Section Divider (ngăn cách giữa các mục) */
/* === Section Divider === */
.section-divider {
  height: 1px;
  border: none;
  margin: 2.5rem 0; /* Khoảng cách trên và dưới */
  background-color: #e0e0e0; /* Màu xám rất nhạt cho chế độ sáng */
  transition: background-color 0.3s ease;
}

body.dark-mode .section-divider {
  background-color: #444; /* Màu xám sáng, tạo line trắng mỏng trong chế độ tối */
}

.footer-icons {
  background: #111;
  color: #ddd;
  text-align: center;
  padding: 30px 20px;
}

.icon-links {
  margin-bottom: 15px;
}

.icon-links a {
  display: inline-block;
  margin: 0 10px;
  font-size: 28px;
  color: #fff;
  transition: transform 0.3s, color 0.3s;
}

.icon-links a:hover {
  color: #007bff;
  transform: scale(1.2);
}

.footer-note {
  font-size: 0.9em;
  color: #bbb;
  margin-top: 10px;
}

.footer-icons .copyright {
  margin-top: 10px;
  font-size: 0.8em;
  color: #999;
}

/* Styling for Publication Title */
.pub-title {
  font-weight: 700; /* In đậm tiêu đề */
  color: var(--primary-color); /* Dùng màu xanh chủ đạo của trang */
  text-decoration: none; /* Bỏ gạch chân mặc định của link */
  transition: color 0.3s;
}

.pub-title:hover {
  text-decoration: underline; /* Thêm gạch chân khi di chuột qua */
}

.publication {
    padding-bottom: 25px; /* Khoảng cách bên dưới nội dung */
    margin-bottom: 25px; /* Khoảng cách trước đường kẻ của mục tiếp theo */
}

/* Loại bỏ đường kẻ và khoảng cách cho bài báo cuối cùng */
.publication:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.pub-content {
    flex: 1;
}

/* Styling for the abstract box */
.pub-abstract {
  display: none; 
  margin-top: 15px;
  padding: 15px;
  border: 1px dashed #ccc; /* Viền nhạt cho light mode */
  background-color: var(--light-bg); /* Nền sáng cho light mode */
  color: var(--text-color); /* Chữ tối cho light mode */
  border-radius: 5px;
  line-height: 1.6;
  text-align: justify;
  transition: background-color 0.3s, border-color 0.3s; /* Hiệu ứng chuyển mượt mà */
}

/* Kiểu riêng cho abstract trong dark mode */
body.dark-mode .pub-abstract {
  background-color: #222; /* Nền tối cho dark mode */
  border-color: #555; /* Viền xám tối cho dark mode */
}

/* Lớp này được JavaScript thêm vào để hiện box */
.pub-abstract.show {
  display: block;
}

/* Styling cho nhóm theo năm */
.year-group {
    position: relative;
    padding-top: 50px; /* Tạo khoảng trống phía trên cho đường kẻ */
    margin-top: 40px;
    border-top: 1px solid #555; /* Đường kẻ ngang phía trên mỗi nhóm */
}

/* Ẩn đường kẻ của nhóm đầu tiên */
.year-group:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 50px;
}

/* Styling cho số năm */
.year-heading {
    position: absolute;
    top: -0.7em; /* Đưa số năm lên nằm đè trên đường kẻ */
    right: 0;
    color: #888; /* Màu xám mờ */
    font-size: 1.8em; /* Kích thước chữ */
    font-weight: bold;
    background-color: var(--light-bg); /* Màu nền giống section để che đường kẻ */
    padding: 0 10px; /* Tạo khoảng cách hai bên chữ */
}

/* 2. Loại bỏ khoảng cách thừa của bài báo cuối cùng trong mỗi nhóm năm */
.year-group .publication:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Layout and Sections */
section {
  padding: 40px 20px;
  background: transparent;
  margin: 20;
}

.section-divider {
  height: 1px;
  background-color: rgba(255,255,255,0.1);
  margin: 0;
  background-color: var(--bg-color);
  transition: background-color 0.3s ease;
}

body.dark-mode {
  --bg-color: #121212;
  --text-color: #ffffff;
  --inactive-tab-bg: #2c2c2c;
  --inactive-tab-text: #dddddd;
  --active-tab-bg: #007bff;
  --active-tab-text: #ffffff;
  --light-bg: #1e1e1e;
}