@media print {
  /* Hide navigation and UI elements */
  .navbar, 
  .breadcrumb-container, 
  .export-btn, 
  .snake-btn, 
  .dark-mode-btn, 
  .copyToClipboard,
  .fc-button,
  footer {
    display: none !important;
  }
  
  /* Optimize layout for printing */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
  }
  
  main {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }
  
  /* Prevent page breaks inside important sections */
  .approach-section,
  .problem-section,
  pre,
  .think-line {
    page-break-inside: avoid;
  }
  
  /* Remove backgrounds and borders for print */
  .approach-section,
  .problem-section {
    background: white !important;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    padding: 15px;
  }
  
  .think-line {
    background: #f5f5f5 !important;
    border-left: 3px solid #2196f3 !important;
  }
  
  /* Make code blocks readable */
  pre {
    background: #f5f5f5 !important;
    border: 1px solid #ddd;
    padding: 10px;
    font-size: 10pt;
  }
  
  /* Links should show URL */
  .leetcode-link a:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }
  
  /* Remove shadows and effects */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  /* Hide flowchart images (optional) */
  .fc-image {
    max-height: 400px;
    page-break-before: auto;
  }
  
  /* Adjust headings */
  h1 {
    font-size: 24pt;
    margin-bottom: 10px;
  }
  
  h2 {
    font-size: 18pt;
    margin-top: 15px;
    margin-bottom: 10px;
  }
}