/* =============================
   CSS Variables & Reset
   ============================= */
:root {
  --bg-primary: #f0f4f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-navbar: #1a56db;
  --bg-hero: #0d1b3e;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-navbar: #ffffff;
  --accent-blue: #1a56db;
  --accent-cyan: #06b6d4;
  --accent-light: #3b82f6;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  --font: 'Be Vietnam Pro', 'Inter', sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-navbar: #0f2057;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* =============================
   NAVBAR
   ============================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-navbar);
  padding: 0 16px;
  height: 56px;
  box-shadow: 0 2px 12px rgba(26, 86, 219, 0.35);
  transition: background var(--transition);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.navbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  letter-spacing: 0.05em;
  padding-right: 12px;
  border-right: 1px solid rgba(255,255,255,0.2);
  user-select: none;
}
.logo-uet {
  height: 34px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);  /* đổi thành màu trắng trên nền navbar xanh */
  transition: filter var(--transition), opacity var(--transition);
  flex-shrink: 0;
}
.logo:hover .logo-uet { opacity: 0.85; }
.logo-avatar-small { font-size: 18px; opacity: 0.8; }

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 56px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  line-height: 1.3;
}
.nav-tab .tab-multi { text-align: left; line-height: 1.25; }
.nav-tab .tab-icon { font-size: 16px; }

.nav-tab:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-tab.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-bottom-color: #60a5fa;
  font-weight: 700;
}

/* Student info */
.student-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 13px;
  color: #fff;
}
.student-name { font-weight: 700; }
.student-divider { opacity: 0.5; }
.student-msv { opacity: 0.85; font-size: 12px; }

/* Music Player */
.music-player {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  padding: 4px 10px;
}

.music-disc {
  width: 26px; height: 26px;
  border-radius: 50%;
  animation: spinDisc 3s linear infinite paused;
}
.music-disc-fallback {
  font-size: 20px;
  line-height: 1;
  transition: transform var(--transition);
}
.music-player.playing .music-disc-fallback {
  animation: spinDisc 3s linear infinite;
}
@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.music-controls { display: flex; gap: 2px; }
.music-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.85);
  font-size: 14px; cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
}
.music-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.music-btn.play-btn { font-size: 16px; }

/* Guide Button */
.guide-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  color: #fff;
  font-family: var(--font);
  font-size: 12.5px; font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.guide-btn:hover { background: rgba(255,255,255,0.22); }

/* Theme Toggle */
.theme-toggle {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  color: #fff;
  font-family: var(--font);
  font-size: 12.5px; font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.theme-toggle:hover { background: rgba(255,255,255,0.22); }
.theme-icon { font-size: 15px; }

/* =============================
   HERO SECTION
   ============================= */
.hero {
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-hero);
}

.hero-bg {
  position: absolute; inset: 0;
  z-index: 0;
}

#heroCanvas {
  width: 100%; height: 100%;
  display: block;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    rgba(13,27,62,0.92) 0%,
    rgba(13,27,62,0.7) 60%,
    rgba(13,27,62,0.4) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative; z-index: 2;
  padding: 32px 40px;
  max-width: 900px;
}

.hero-subtitle {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 14px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px;
}
.hero-sep { opacity: 0.4; }
.hero-dot { opacity: 0.5; }

/* =============================
   MAIN CONTENT
   ============================= */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* Content Sections */
.content-section {
  display: none;
  animation: fadeInUp 0.35s ease forwards;
}
.content-section.active { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================
   CARD
   ============================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}
.card-icon {
  font-size: 22px;
  background: #eff6ff;
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
[data-theme="dark"] .card-icon { background: #1e3a5f; }

.card-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

/* =============================
   INTRO SECTION
   ============================= */
.intro-body {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.intro-avatar-wrap {
  flex-shrink: 0;
}

.intro-avatar {
  width: 150px; height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent-blue);
  box-shadow: 0 0 0 6px rgba(26,86,219,0.12);
  background: #e0e7ff;
}

.intro-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a56db 0%, #06b6d4 100%);
}
.avatar-placeholder-icon { font-size: 60px; opacity: 0.6; }

.intro-text {
  flex: 1;
}
.intro-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 14px;
}
.intro-text strong { color: var(--text-primary); }

.intro-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 18px;
}
.tag {
  background: #eff6ff;
  color: var(--accent-blue);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-full);
  padding: 4px 13px;
  font-size: 13px; font-weight: 600;
  transition: background var(--transition);
}
[data-theme="dark"] .tag {
  background: #1e3a5f; border-color: #2563eb;
  color: #93c5fd;
}
.tag:hover { background: #dbeafe; }

/* =============================
   INFO GRID
   ============================= */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.info-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 4px;
  transition: background var(--transition);
}
.info-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.info-value {
  font-size: 14.5px; font-weight: 600;
  color: var(--text-primary);
}

/* =============================
   GOALS
   ============================= */
.goals-list { display: flex; flex-direction: column; gap: 14px; }

.goal-item {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 18px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition), transform var(--transition);
}
.goal-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.goal-num {
  font-size: 26px; font-weight: 800;
  color: var(--accent-blue); opacity: 0.3;
  line-height: 1; flex-shrink: 0;
  min-width: 40px;
}
.goal-content h3 {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 6px;
}
.goal-content p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.65;
}

/* =============================
   PROJECTS GRID
   ============================= */
.coming-soon-text {
  font-size: 14px; color: var(--text-muted);
  font-style: italic; margin-bottom: 20px;
  padding: 12px 16px;
  background: #fef9c3;
  border-left: 3px solid #facc15;
  border-radius: var(--radius-sm);
}
[data-theme="dark"] .coming-soon-text {
  background: #1c1a05; border-color: #a16207; color: #ca8a04;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.project-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.placeholder-card { opacity: 0.6; pointer-events: none; }

.project-card-header {
  display: flex; justify-content: space-between; align-items: center;
}
.project-icon { font-size: 24px; }
.project-tag {
  background: #eff6ff; color: var(--accent-blue);
  border-radius: var(--radius-full);
  padding: 2px 10px; font-size: 12px; font-weight: 600;
}
[data-theme="dark"] .project-tag { background: #1e3a5f; color: #93c5fd; }

.project-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}
.project-desc {
  font-size: 13.5px; color: var(--text-secondary); line-height: 1.6;
  flex: 1;
}
.project-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
}
.project-date { font-size: 12px; color: var(--text-muted); }
.project-btn {
  background: var(--accent-blue); color: #fff;
  border: none; border-radius: var(--radius-full);
  padding: 5px 14px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  transition: background var(--transition), opacity var(--transition);
}
.project-btn:hover:not(:disabled) { background: #1d4ed8; }
.project-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* =============================
   CONCLUSION
   ============================= */
.conclusion-body p {
  font-size: 15px; color: var(--text-secondary);
  line-height: 1.8; margin-bottom: 14px;
}
.conclusion-quote {
  border-left: 4px solid var(--accent-blue);
  padding: 14px 20px;
  background: #eff6ff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px; font-style: italic;
  color: var(--accent-blue); font-weight: 600;
  margin-top: 10px;
}
[data-theme="dark"] .conclusion-quote {
  background: #1e3a5f; color: #93c5fd;
}

/* =============================
   MODAL
   ============================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: min(480px, 92vw);
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 18px;
  cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.modal-close:hover { background: var(--bg-primary); color: var(--text-primary); }

.modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.guide-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}
.guide-icon { font-size: 22px; flex-shrink: 0; }
.guide-item strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.guide-item p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; }
.guide-item code {
  background: #e2e8f0; color: #1e293b;
  padding: 1px 5px; border-radius: 4px; font-size: 12.5px;
}
[data-theme="dark"] .guide-item code { background: #334155; color: #e2e8f0; }

/* =============================
   FOOTER
   ============================= */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

/* =============================
   SCROLLBAR
   ============================= */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 4px; opacity: 0.5; }

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 10px;
    gap: 8px;
  }
  .navbar-center { order: 3; width: 100%; justify-content: center; }
  .navbar-right { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .guide-btn, .theme-label { display: none; }

  .intro-body { flex-direction: column; align-items: center; }
  .intro-avatar { width: 120px; height: 120px; }
  .intro-text { text-align: center; }
  .intro-tags { justify-content: center; }

  .hero-content { padding: 24px 18px; }
  .card { padding: 20px 16px; }
}

/* =============================
   DOCUMENT VIEWER MODAL
   ============================= */
.doc-modal {
  width: min(860px, 96vw) !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.doc-viewer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--bg-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  min-height: 300px;
  position: relative;
}

/* Loading spinner */
.doc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.doc-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Rendered Word content */
.doc-content {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text-primary);
}
.doc-content h1 { font-size: 22px; font-weight: 800; margin: 20px 0 12px; color: var(--accent-blue); }
.doc-content h2 { font-size: 18px; font-weight: 700; margin: 18px 0 10px; color: var(--text-primary); border-bottom: 2px solid var(--border-color); padding-bottom: 6px; }
.doc-content h3 { font-size: 16px; font-weight: 600; margin: 14px 0 8px; color: var(--text-primary); }
.doc-content p  { margin-bottom: 10px; }
.doc-content ul, .doc-content ol { padding-left: 24px; margin-bottom: 10px; }
.doc-content li { margin-bottom: 4px; }
.doc-content table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 13.5px; }
.doc-content th { background: var(--accent-blue); color: #fff; padding: 8px 12px; text-align: left; }
.doc-content td { padding: 7px 12px; border: 1px solid var(--border-color); }
.doc-content tr:nth-child(even) td { background: var(--bg-secondary); }
.doc-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 8px 0; }
.doc-content strong, .doc-content b { font-weight: 700; }
.doc-content em, .doc-content i { font-style: italic; }

/* Error state */
.doc-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}
.doc-error span { font-size: 40px; display: block; margin-bottom: 12px; }
.doc-error a { color: var(--accent-blue); font-weight: 600; }

/* Download button in modal header */
.doc-download-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 12.5px; font-weight: 600;
  text-decoration: none;
  font-family: var(--font);
  transition: background var(--transition);
  white-space: nowrap;
}
.doc-download-btn:hover { background: rgba(255,255,255,0.25); }
