/* Print-specific styles for PDF generation */
body.print-mode {
  background-color: var(--color-bg) !important;
  color: var(--color-text) !important;
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

/* Force light theme for printing */
body.print-mode {
  --color-bg: #ffffff;
  --color-bg-secondary: #f6f8fa;
  --color-text: #24292e;
  --color-text-secondary: #586069;
  --color-border: #e1e4e8;
  --color-accent: #0366d6;
  --color-accent-darker: #044289;
}

/* Hide elements that are not needed in print */
body.print-mode #header,
body.print-mode .theme-toggle,
body.print-mode .mobile-menu-toggle,
body.print-mode #footer,
body.print-mode .tab-container .tab-nav {
  display: none !important;
}

/* Show all tabs content in print mode */
body.print-mode .tab-container .tab-content {
  display: block !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
}

/* Add spacing between sections */
body.print-mode section {
  padding: 15px 0 !important;
  page-break-inside: avoid;
}

/* Adjust profile section layout */
body.print-mode .profile-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: 20px;
}

body.print-mode .profile-image {
  width: 120px;
  height: 120px;
  margin-right: 20px;
}

body.print-mode .profile-info {
  flex: 1;
}

/* Adjust projects grid for print */
body.print-mode .projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

body.print-mode .project-card {
  margin-bottom: 15px;
  page-break-inside: avoid;
}

/* Optimize repository card for print */
body.print-mode .repo-card {
  padding: 10px;
  margin-bottom: 10px;
}

body.print-mode .repo-card .repo-header {
  font-size: 14px;
  margin-bottom: 5px;
}

body.print-mode .repo-card .repo-description {
  font-size: 12px;
  margin-bottom: 5px;
}

/* Adjust timeline for print */
body.print-mode .timeline-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
}

body.print-mode .timeline-date {
  font-weight: bold;
  margin-bottom: 5px;
}

/* Adjust skills display for print */
body.print-mode .skills-container {
  columns: 2;
}

body.print-mode .skill-category {
  break-inside: avoid;
  margin-bottom: 15px;
}

/* Force page breaks where appropriate */
body.print-mode h2 {
  page-break-before: always;
  margin-top: 20px;
}

body.print-mode .profile-section {
  page-break-before: avoid;
  page-break-after: avoid;
}

/* First section should not have a page break */
body.print-mode section:first-of-type h2 {
  page-break-before: avoid;
}

/* Make links visible in print with their URLs */
body.print-mode a[href]:after {
  content: " (" attr(href) ")";
  font-size: 10px;
  color: var(--color-text-secondary);
}

/* Don't show URL for profile links or image links */
body.print-mode .profile-links a[href]:after,
body.print-mode a[href^="#"]:after,
body.print-mode a:has(img)[href]:after {
  content: "";
}

/* Ensure all content is visible */
body.print-mode * {
  overflow: visible !important;
}

/* Adjust container width for print */
body.print-mode .container {
  max-width: 100% !important;
  padding: 0 10px !important;
}

/* Badge styling for print */
body.print-mode .experience-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 8px;
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  border-radius: var(--border-radius);
  font-size: 12px;
  font-weight: normal;
}
