/* ==================== Print Stylesheet ==================== */
/* Optimizes the portfolio for printing */

@media print {
  /* ==================== Hide Non-Essential Elements ==================== */
  nav,
  footer,
  .navbar,
  .header,
  .cta-button,
  .settings-panel,
  .sidebar,
  .mobile-sidebar,
  .search-container,
  .theme-toggle,
  .install-button,
  .preloader,
  .skeleton-container,
  .night-light-overlay,
  .notice-banner,
  button,
  .ripple-effect,
  .social-icons a,
  #installPrompt,
  .search-modal,
  .settings-btn,
  .sidebar-toggle {
    display: none !important;
  }

  /* ==================== Page Setup ==================== */
  @page {
    margin: 2cm;
    size: A4 portrait;
  }

  /* ==================== Body & Background ==================== */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
    margin: 0;
    padding: 0;
  }

  * {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* ==================== Typography ==================== */
  h1, h2, h3, h4, h5, h6 {
    color: black !important;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  h1 {
    font-size: 24pt;
    margin-bottom: 12pt;
  }

  h2 {
    font-size: 18pt;
    margin-top: 12pt;
    margin-bottom: 8pt;
  }

  h3 {
    font-size: 14pt;
    margin-top: 10pt;
    margin-bottom: 6pt;
  }

  p {
    orphans: 3;
    widows: 3;
    margin-bottom: 8pt;
  }

  /* ==================== Links ==================== */
  a {
    color: black !important;
    text-decoration: underline;
  }

  /* Show URLs after links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }

  /* Don't show URLs for anchor links */
  a[href^="#"]::after {
    content: "";
  }

  /* ==================== Sections & Layout ==================== */
  .section,
  .card,
  .project-card,
  .skill-item,
  .education-item,
  .contact-info {
    page-break-inside: avoid;
    margin-bottom: 16pt;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ==================== Images ==================== */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  /* Profile photo */
  .profile-photo,
  .my-photo {
    width: 150px !important;
    height: 150px !important;
    border-radius: 50%;
    margin: 0 auto 16pt;
    display: block;
  }

  /* ==================== Lists ==================== */
  ul, ol {
    margin-left: 20pt;
  }

  li {
    margin-bottom: 4pt;
  }

  /* ==================== Tables ==================== */
  table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16pt;
  }

  th, td {
    border: 1px solid #ddd;
    padding: 8pt;
    text-align: left;
  }

  th {
    background-color: #f5f5f5 !important;
    font-weight: bold;
  }

  /* ==================== Contact Form (Hide) ==================== */
  form,
  .contact-form,
  input,
  textarea,
  select {
    display: none !important;
  }

  /* Show contact information */
  .contact-info {
    display: block !important;
  }

  .info-item {
    margin-bottom: 12pt;
  }

  /* ==================== Skills & Progress Bars ==================== */
  .skill-bar,
  .progress {
    height: 8pt !important;
    background: #e0e0e0 !important;
    border: 1px solid #ccc !important;
  }

  .skill-bar::after,
  .progress::after {
    content: attr(data-value) "%";
    margin-left: 8pt;
  }

  /* ==================== Projects ==================== */
  .project-card {
    border: 1px solid #ddd !important;
    padding: 12pt;
    margin-bottom: 16pt;
  }

  .project-title {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 8pt;
  }

  /* ==================== Page Breaks ==================== */
  .page-break {
    page-break-before: always;
  }

  .no-break {
    page-break-inside: avoid;
  }

  /* ==================== Header for Each Page ==================== */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 20pt;
    padding-bottom: 10pt;
    border-bottom: 2px solid #333;
  }

  /* ==================== Footer for Each Page ==================== */
  .print-footer {
    display: block !important;
    text-align: center;
    margin-top: 20pt;
    padding-top: 10pt;
    border-top: 1px solid #ccc;
    font-size: 10pt;
    color: #666;
  }

  /* ==================== Utilities ==================== */
  .print-only {
    display: block !important;
  }

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

  /* Remove animations */
  * {
    animation: none !important;
    transition: none !important;
  }

  /* ==================== QR Code / Contact Info ==================== */
  .print-contact {
    display: block !important;
    margin-top: 20pt;
    padding: 12pt;
    border: 1px solid #ddd;
    background: #f9f9f9 !important;
  }

  .print-contact h3 {
    margin-top: 0;
  }

  /* ==================== Accessibility ==================== */
  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /* ==================== Optimize Text ==================== */
  body {
    font-family: "Times New Roman", Times, serif;
  }

  code, pre {
    font-family: "Courier New", Courier, monospace;
    background: #f5f5f5 !important;
    border: 1px solid #ddd;
    padding: 4pt;
  }

  /* ==================== Ensure Readability ==================== */
  .text-primary,
  .text-secondary,
  .accent {
    color: black !important;
  }

  /* Remove gradients */
  .gradient-text,
  h1.gradient-text {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: black !important;
    background-clip: unset !important;
  }
}

