/* ========================================================
   CV ĐƯỜNG TĂNG - RESPONSIVE STYLESHEET
   Thiết kế phong cách Á Đông truyền thống kết hợp hiện đại
   ======================================================== */

:root {
  --primary-red: #c93f38;
  --primary-dark-red: #a82e28;
  --accent-peach: #f6c4be;
  --bg-card-warm: #fef5ee;
  --bg-page: #f2ece7;
  --bg-sheet: #ffffff;
  --text-main: #2b2b2b;
  --text-muted: #5a5a5a;
  --text-quote: #3e3e3e;
  --border-light: #edd8cc;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.55;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================================
   FLOATING ACTION BAR (SCREEN ONLY)
   ======================================================== */
.action-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 63, 56, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 10px 16px;
  margin-bottom: 24px;
}

.action-bar-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.badge-tagline {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-red);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #27ae60;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(39, 174, 96, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  background-color: var(--primary-red);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(201, 63, 56, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark-red);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-red);
  border: 1px solid var(--primary-red);
}

.btn-outline:hover {
  background-color: #fdf2f1;
}

.btn-merit {
  background-color: #f7ede2;
  color: #843b17;
  border: 1px solid #e2be9b;
}

.btn-merit:hover {
  background-color: #fae4cf;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-label-short {
  display: none;
}

@media screen and (max-width: 520px) {
  .btn-label-long {
    display: none;
  }
  .btn-label-short {
    display: inline;
  }
}

/* Toast Message */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgba(30, 30, 30, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Floating Merit text animation */
.floating-merit {
  position: fixed;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: #d35400;
  text-shadow: 0 2px 8px rgba(255, 215, 0, 0.8);
  pointer-events: none;
  z-index: 10000;
  animation: floatUp 1.2s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.7); }
  20% { opacity: 1; transform: translateY(-15px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-70px) scale(1); }
}

/* ========================================================
   CV DOCUMENT CONTAINER & SHEET
   ======================================================== */
.cv-page-container {
  display: flex;
  justify-content: center;
  padding: 0 16px 40px;
}

.cv-sheet {
  position: relative;
  background-color: var(--bg-sheet);
  width: 100%;
  max-width: 880px;
  min-height: 1200px;
  padding: 34px 44px 34px 44px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  border-radius: 4px;
  overflow: hidden;
}

/* Hanging Lanterns Top Right */
.top-decoration {
  position: absolute;
  top: 0;
  right: 0;
  width: 110px;
  pointer-events: none;
  z-index: 10;
}

.lantern-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================================
   TOP HEADER CONTACT BAR
   ======================================================== */
.cv-header {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 24px;
  padding-right: 80px; /* Nhường chỗ cho đèn lồng góc */
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-red);
}

.contact-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #fbeee9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary-red);
  transition: transform 0.2s ease;
}

.contact-item:hover .contact-icon {
  transform: scale(1.12);
  background-color: #f7ded6;
}

.contact-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.email-link {
  color: var(--primary-red);
  text-decoration: none;
  font-weight: 600;
}

.email-link:hover {
  text-decoration: underline;
}

/* ========================================================
   HERO SECTION (AVATAR & INTRO)
   ======================================================== */
.hero-section {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 6px 0 26px;
}

.avatar-wrapper {
  flex-shrink: 0;
  width: 215px;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.avatar-wrapper:hover {
  transform: scale(1.02);
}

.avatar-frame {
  width: 100%;
  display: block;
}

.avatar-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.06));
}

.hero-intro {
  flex: 1;
}

.candidate-name {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 900;
  color: var(--primary-red);
  letter-spacing: 2px;
  line-height: 1.05;
  margin-bottom: 12px;
}

.alias-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  background-color: var(--primary-red);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 4.5px 12px;
  border-radius: 14px;
  display: inline-block;
  white-space: nowrap;
}

.candidate-summary {
  font-size: 13.5px;
  color: var(--text-quote);
  line-height: 1.6;
}

.candidate-summary p + p {
  margin-top: 4px;
}

/* ========================================================
   MAIN BODY 2-COLUMN GRID
   ======================================================== */
.cv-body-grid {
  display: grid;
  grid-template-columns: 37% 63%;
  gap: 24px;
  align-items: start;
}

.cv-col {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Section Headings */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-red);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.cloud-decor {
  width: 32px;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  vertical-align: middle;
}

/* Styled Lists */
.styled-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.styled-list > li {
  position: relative;
  padding-left: 16px;
  line-height: 1.45;
  font-size: 13px;
}

.styled-list > li::before {
  content: '•';
  position: absolute;
  left: 3px;
  top: 0;
  color: var(--text-main);
  font-size: 15px;
  font-weight: bold;
}

/* ========================================================
   LEFT COLUMN SPECIFICS
   ======================================================== */
/* Education Box */
.edu-card {
  background-color: var(--bg-card-warm);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: inset 0 0 0 1px rgba(230, 200, 185, 0.4);
}

.edu-card .styled-list > li {
  font-size: 12.8px;
}

/* Skills */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skill-label {
  font-size: 12.8px;
  font-weight: 500;
  color: var(--text-main);
}

.progress-bar {
  width: 100%;
  height: 7px;
  background-color: #f7ebe6;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.fill-red {
  background-color: var(--primary-red);
}

.fill-peach {
  background-color: var(--accent-peach);
}

/* Achievements & Hobbies */
.section-achievements .styled-list > li,
.section-hobbies .styled-list > li {
  font-size: 12.8px;
}

/* Author Credit */
.author-credit {
  margin-top: 10px;
}

.credit-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #666;
}

.credit-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.credit-info strong {
  font-size: 11.5px;
  color: #333;
}

.credit-info a {
  color: #666;
  text-decoration: none;
  font-size: 10.5px;
}

.credit-info a:hover {
  color: #0077b5;
  text-decoration: underline;
}

/* ========================================================
   RIGHT COLUMN: TIMELINE EXPERIENCE
   ======================================================== */
.timeline-container {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-left: 20px;
}

/* The continuous red timeline vertical line */
.timeline-container::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 12px;
  left: 6px;
  width: 2.5px;
  background-color: var(--primary-red);
}

.timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
}

/* Circular dot marker */
.timeline-marker {
  position: absolute;
  left: -20px;
  top: 3px;
  width: 14.5px;
  height: 14.5px;
  border-radius: 50%;
  background-color: var(--primary-red);
  box-shadow: 0 0 0 3px #ffffff;
  z-index: 2;
}

.timeline-content {
  flex: 1;
}

.company-name {
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.role-title {
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-red);
  margin-top: 3px;
  margin-bottom: 7px;
}

.role-desc {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.timeline-content .styled-list > li {
  font-size: 12.8px;
  margin-bottom: 3px;
}

/* Sub-bullets for 3 freelancers */
.sub-list {
  list-style: none;
  margin-top: 3px;
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-list > li {
  font-size: 12.2px;
  color: var(--text-muted);
}

.leave-reason {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.45;
}

.leave-reason em {
  font-style: italic;
  font-weight: 600;
  color: #4a4a4a;
}

/* Bottom Silhouette Banner */
.bottom-banner-wrapper {
  margin-top: 10px;
  position: relative;
  width: 100%;
}

.bottom-banner-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================================
   RESPONSIVE MEDIA QUERIES
   ======================================================== */

/* Tablet & Smaller Laptops */
@media screen and (max-width: 860px) {
  .cv-page-container {
    padding: 0 10px 30px;
  }

  .cv-sheet {
    padding: 24px 24px 20px;
  }

  .cv-header {
    padding-right: 50px;
    gap: 12px;
  }

  .top-decoration {
    width: 85px;
  }

  .candidate-name {
    font-size: 38px;
  }

  .avatar-wrapper {
    width: 170px;
  }

  .cv-body-grid {
    grid-template-columns: 40% 60%;
    gap: 20px;
  }
}

/* Mobile Screens (Stacked Layout) */
@media screen and (max-width: 680px) {
  .action-bar {
    padding: 8px 10px;
    margin-bottom: 12px;
  }

  .action-bar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .badge-tagline {
    justify-content: center;
    font-size: 11.5px;
  }

  .action-buttons {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }

  .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 4px;
    font-size: 11px;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
  }

  .btn .icon {
    font-size: 13px;
  }

  .cv-page-container {
    padding: 0 4px 24px;
  }

  .cv-sheet {
    padding: 24px 16px 20px;
    border-radius: 6px;
  }

  .top-decoration {
    width: 60px;
  }

  .cv-header {
    grid-template-columns: 1fr;
    padding-right: 50px;
    gap: 8px;
    padding-bottom: 16px;
  }

  .contact-item {
    font-size: 11.5px;
  }

  .hero-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding-bottom: 18px;
  }

  .avatar-wrapper {
    width: 160px;
  }

  .candidate-name {
    font-size: 32px;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }

  .alias-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 310px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 12px;
  }

  .badge {
    font-size: 9.5px;
    padding: 3.5px 9px;
  }

  .candidate-summary {
    font-size: 12.5px;
    line-height: 1.5;
  }

  /* Single Column Stack */
  .cv-body-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .cv-col.right-col {
    order: 1; /* Hiển thị Kinh nghiệm lên trước trên mobile để nhà tuyển dụng dễ đọc */
  }

  .cv-col.left-col {
    order: 2;
  }

  .timeline-container {
    padding-left: 18px;
    gap: 16px;
  }

  .timeline-marker {
    left: -18px;
    width: 13px;
    height: 13px;
  }

  .bottom-banner-wrapper {
    margin-top: 14px;
  }
}

/* ========================================================
   PRINT STYLES (@media print)
   Khổ giấy chuẩn A4 (210mm x 297mm), 1 trang duy nhất
   ======================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 10mm 6mm 10mm;
  }

  html, body {
    background: #ffffff !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .no-print {
    display: none !important;
  }

  .cv-page-container {
    padding: 0 !important;
    display: block !important;
  }

  .cv-sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: auto !important;
  }

  .candidate-name {
    font-size: 42px !important;
  }

  .avatar-wrapper {
    width: 185px !important;
  }

  .cv-body-grid {
    grid-template-columns: 37% 63% !important;
    gap: 20px !important;
  }

  .top-decoration {
    width: 95px !important;
  }

  /* Tránh ngắt trang ngoài ý muốn */
  .timeline-item, .cv-section, .edu-card {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
