/* ========================================================
   CSS DESIGN SYSTEM FOR PROFESSIONAL CV
   ======================================================== */

:root {
  --primary: #1e3a8a;          /* Deep navy */
  --primary-light: #3b82f6;    /* Vibrant accent blue */
  --primary-dark: #0f172a;     /* Dark slate */
  --secondary: #64748b;        /* Slate gray */
  --text-main: #1e293b;        /* Charcoal text */
  --text-muted: #64748b;       /* Muted gray */
  --bg-page: #f1f5f9;          /* Page backdrop */
  --bg-card: #ffffff;          /* Card white */
  --sidebar-bg: #0f172a;       /* Dark sidebar background */
  --sidebar-text: #e2e8f0;      /* Sidebar text color */
  --sidebar-muted: #94a3b8;     /* Sidebar light gray */
  --border-color: #e2e8f0;
  --accent-pill: #eff6ff;
  --accent-pill-text: #1d4ed8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s ease-in-out;
}

/* Reset cơ bản */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  padding: 30px 15px;
}

/* Khung bọc toàn bộ trang */
.cv-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

/* Thanh Action Bar (nút In / Xuất PDF) */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.action-hint {
  color: #10b981;
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.btn-print:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.45);
}

/* Layout CV: 2 Cột chuẩn quốc tế */
.cv-container {
  display: grid;
  grid-template-columns: 310px 1fr;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 1100px;
}

/* ========================================================
   CỘT TRÁI (SIDEBAR)
   ======================================================== */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 36px 26px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-card {
  text-align: center;
  margin-bottom: 32px;
}

.avatar-box {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-name {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.sidebar-role {
  color: var(--primary-light);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Phần đề mục sidebar */
.sidebar-section {
  margin-bottom: 30px;
}

.sidebar-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #ffffff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title i {
  color: var(--primary-light);
  font-size: 14px;
}

/* Danh sách liên hệ */
.contact-list {
  list-style: none;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.contact-list li i {
  font-size: 14px;
  color: var(--primary-light);
  margin-top: 3px;
  width: 16px;
  text-align: center;
}

.contact-list span {
  display: block;
  font-size: 11px;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-list strong,
.contact-list a {
  color: #f8fafc;
  font-weight: 500;
  text-decoration: none;
  word-break: break-all;
}

.contact-list a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* Progress bar kỹ năng */
.skill-group {
  margin-bottom: 14px;
}

.skill-name {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 10px;
  transition: width 0.8s ease-in-out;
}

/* Danh sách badge / pills */
.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge i {
  color: var(--primary-light);
  font-size: 11px;
}

/* ========================================================
   CỘT PHẢI (MAIN CONTENT)
   ======================================================== */
.main-content {
  padding: 40px 45px;
  background: #ffffff;
}

.main-header {
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.candidate-name {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.candidate-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.intro-box {
  margin-top: 14px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.65;
}

/* Block tiêu đề chính */
.content-block {
  margin-bottom: 30px;
}

.content-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.title-icon {
  width: 32px;
  height: 32px;
  background: #eff6ff;
  color: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* Dòng thời gian Timeline (Kinh nghiệm, Học vấn) */
.timeline {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid #e2e8f0;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary-light);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.job-role {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
}

.company-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 2px;
}

.timeline-time {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 12px;
}

.job-desc {
  font-size: 13.5px;
  color: #475569;
  margin-bottom: 8px;
}

.job-achievements {
  list-style-type: none;
  padding-left: 0;
}

.job-achievements li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  color: #334155;
  margin-bottom: 5px;
}

.job-achievements li::before {
  content: "•";
  position: absolute;
  left: 2px;
  top: -1px;
  color: var(--primary-light);
  font-size: 16px;
  font-weight: bold;
}

/* Dự án nổi bật (Project Grid) */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.project-card {
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.project-card-header h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--primary-dark);
}

.project-link {
  color: var(--primary-light);
  font-size: 13px;
  transition: var(--transition);
}

.project-link:hover {
  color: #1d4ed8;
}

.project-summary {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.5;
}

.project-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-techs span {
  font-size: 11px;
  background: var(--accent-pill);
  color: var(--accent-pill-text);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

/* Danh sách giải thưởng / chứng chỉ */
.award-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.award-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
}

.award-item i {
  color: #f59e0b;
  font-size: 16px;
}

.award-item strong {
  color: var(--text-main);
  margin-right: 6px;
}

.award-item span {
  color: var(--text-muted);
}

/* ========================================================
   RESPONSIVE DESIGN CHO THIẾT BỊ DI ĐỘNG & TABLET
   ======================================================== */
@media (max-width: 820px) {
  body {
    padding: 12px 8px;
  }

  .cv-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 28px 20px;
  }

  .main-content {
    padding: 28px 20px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   CHẾ ĐỘ IN ẤN & XUẤT FILE PDF (@media print)
   ======================================================== */
@media print {
  body {
    background: transparent;
    padding: 0;
  }

  .cv-wrapper {
    max-width: 100%;
    margin: 0;
  }

  .action-bar {
    display: none !important;
  }

  .cv-container {
    box-shadow: none;
    border-radius: 0;
    min-height: auto;
  }

  .project-card:hover {
    transform: none;
    box-shadow: none;
  }

  @page {
    margin: 10mm;
    size: A4;
  }
}
