/* ============================================
   DBT Skills - Print Stylesheet
   ============================================ */

@media print {
    /* ============================================
       General Print Styles
       ============================================ */
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-family: Georgia, serif;
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    /* ============================================
       Page Setup
       ============================================ */
    @page {
        margin: 1in;
        size: letter portrait;
    }
    
    /* ============================================
       Hide Non-Printable Elements
       ============================================ */
    .no-print,
    .skip-link,
    .header,
    nav,
    .main-nav,
    .navigation,
    .mobile-menu-toggle,
    .crisis-button,
    .crisis-overlay,
    button,
    .btn,
    .button,
    .footer,
    .tab-button,
    .mood-tabs,
    .exercise-actions,
    .journal-actions,
    .form-group button,
    input[type="button"],
    input[type="submit"],
    .interactive-element,
    .emotion-tag,
    .chart-wrapper {
        display: none !important;
    }
    
    /* ============================================
       Show Print-Only Elements
       ============================================ */
    .print-only {
        display: block !important;
    }
    
    /* ============================================
       Typography for Print
       ============================================ */
    h1, h2, h3, h4, h5, h6 {
        font-family: Georgia, serif;
        font-weight: bold;
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    h1 {
        font-size: 24pt;
        margin-bottom: 12pt;
    }
    
    h2 {
        font-size: 20pt;
        margin-bottom: 10pt;
    }
    
    h3 {
        font-size: 16pt;
        margin-bottom: 8pt;
    }
    
    h4 {
        font-size: 14pt;
        margin-bottom: 6pt;
    }
    
    p {
        margin-bottom: 8pt;
        orphans: 3;
        widows: 3;
    }
    
    /* ============================================
       Links
       ============================================ */
    a {
        color: #000;
        text-decoration: underline;
    }
    
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        font-style: italic;
    }
    
    a[href^="#"]:after {
        content: "";
    }
    
    /* ============================================
       Page Breaks
       ============================================ */
    .section,
    .exercise-detail,
    .skill-area-card,
    .learn-step {
        page-break-after: always;
    }
    
    .step-item,
    .exercise-card,
    .journal-entry-card {
        page-break-inside: avoid;
    }
    
    /* ============================================
       Layout Adjustments
       ============================================ */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .main-content {
        padding: 0;
    }
    
    .section {
        display: block !important;
        margin-bottom: 24pt;
    }
    
    /* ============================================
       Exercise Worksheet Format
       ============================================ */
    .exercise-detail-header {
        border: 2px solid #000;
        padding: 12pt;
        margin-bottom: 12pt;
    }
    
    .exercise-detail-title {
        font-size: 20pt;
        font-weight: bold;
        margin-bottom: 6pt;
    }
    
    .exercise-detail-meta {
        font-size: 10pt;
        margin-bottom: 8pt;
    }
    
    .exercise-badge {
        border: 1px solid #000;
        padding: 2pt 6pt;
        margin-right: 6pt;
        display: inline-block;
    }
    
    .exercise-section {
        margin-bottom: 12pt;
        border: 1px solid #ccc;
        padding: 12pt;
    }
    
    .exercise-section-title {
        font-size: 16pt;
        font-weight: bold;
        border-bottom: 2px solid #000;
        padding-bottom: 4pt;
        margin-bottom: 8pt;
    }
    
    /* ============================================
       Steps List for Print
       ============================================ */
    .steps-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .step-item {
        margin-bottom: 8pt;
        padding: 6pt;
        border: 1px solid #ccc;
    }
    
    .step-checkbox {
        display: inline-block;
        width: 12pt;
        height: 12pt;
        border: 2px solid #000;
        margin-right: 6pt;
        vertical-align: middle;
    }
    
    .step-number {
        font-weight: bold;
    }
    
    .step-text {
        display: inline;
    }
    
    /* ============================================
       Reflection Section
       ============================================ */
    .reflection-prompt {
        border-left: 4px solid #000;
        padding: 8pt;
        margin-bottom: 8pt;
        font-style: italic;
    }
    
    .notes-textarea {
        border: 1px solid #000;
        padding: 6pt;
        min-height: 100pt;
        width: 100%;
    }
    
    /* Add lines for writing */
    .notes-textarea:after {
        content: "";
        display: block;
        height: 100pt;
        background-image: repeating-linear-gradient(
            transparent,
            transparent 20pt,
            #ccc 20pt,
            #ccc 21pt
        );
    }
    
    /* ============================================
       Mood Tracker Print Format
       ============================================ */
    .mood-form {
        border: 2px solid #000;
        padding: 12pt;
    }
    
    .form-label {
        font-weight: bold;
        margin-bottom: 4pt;
    }
    
    .form-input,
    .form-textarea {
        border: 1px solid #000;
        padding: 4pt;
        width: 100%;
        margin-bottom: 8pt;
    }
    
    /* ============================================
       Cards and Grids
       ============================================ */
    .card,
    .feature-card,
    .skill-area-card,
    .exercise-card {
        border: 1px solid #000;
        padding: 12pt;
        margin-bottom: 12pt;
        page-break-inside: avoid;
    }
    
    .skill-areas-grid,
    .feature-grid,
    .exercises-list {
        display: block;
    }
    
    /* ============================================
       Progress Bars (Show as Text)
       ============================================ */
    .progress-bar {
        display: none;
    }
    
    .progress-label:after {
        content: " - " attr(data-progress) "%";
        font-weight: bold;
    }
    
    /* ============================================
       Statistics
       ============================================ */
    .stat-card,
    .progress-stat-card {
        border: 1px solid #000;
        padding: 8pt;
        margin-bottom: 8pt;
        text-align: center;
    }
    
    .stat-value,
    .progress-stat-value {
        font-size: 18pt;
        font-weight: bold;
    }
    
    .stat-label,
    .progress-stat-label {
        font-size: 10pt;
    }
    
    /* ============================================
       Journal Entries
       ============================================ */
    .journal-entry-card {
        border: 1px solid #000;
        padding: 12pt;
        margin-bottom: 12pt;
        page-break-inside: avoid;
    }
    
    .journal-entry-title {
        font-size: 14pt;
        font-weight: bold;
        margin-bottom: 4pt;
    }
    
    .journal-entry-date {
        font-size: 10pt;
        font-style: italic;
        margin-bottom: 8pt;
    }
    
    .journal-entry-content {
        line-height: 1.5;
    }
    
    /* ============================================
       Disclaimers and Notices
       ============================================ */
    .disclaimer-box,
    .privacy-notice {
        border: 2px solid #000;
        padding: 12pt;
        margin-bottom: 12pt;
        page-break-inside: avoid;
    }
    
    .disclaimer-title {
        font-weight: bold;
        font-size: 14pt;
        margin-bottom: 6pt;
    }
    
    /* ============================================
       Emergency Resources (Always Print)
       ============================================ */
    .emergency-contact {
        border: 1px solid #000;
        padding: 8pt;
        margin-bottom: 8pt;
        page-break-inside: avoid;
    }
    
    .emergency-name {
        font-weight: bold;
        font-size: 12pt;
    }
    
    .emergency-number {
        font-size: 14pt;
        font-weight: bold;
        margin: 4pt 0;
    }
    
    /* ============================================
       Print Header (Add to each page)
       ============================================ */
    .section:before {
        content: "DBT Skills Application - Worksheet";
        display: block;
        font-size: 10pt;
        text-align: right;
        margin-bottom: 12pt;
        padding-bottom: 4pt;
        border-bottom: 1px solid #000;
    }
    
    /* ============================================
       Utility Classes
       ============================================ */
    .page-break-before {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .no-page-break {
        page-break-inside: avoid;
    }
    
    /* ============================================
       Images (if any)
       ============================================ */
    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    /* Print diagrams and flowcharts */
    .skill-diagram,
    .crisis-flowchart {
        display: block !important;
        max-width: 100%;
        margin: 12pt auto;
        page-break-inside: avoid;
    }
    
    .diagram-container,
    .crisis-flowchart-container {
        display: block !important;
        border: 1px solid #ccc;
        padding: 12pt;
        margin: 12pt 0;
        page-break-inside: avoid;
        background: transparent !important;
    }
    
    /* Hide decorative icons in print */
    .feature-icon-img,
    .crisis-icon-img {
        display: none !important;
    }
    
    /* Show skill area icons in print for reference */
    .skill-icon-img {
        display: inline-block !important;
        width: 24pt;
        height: 24pt;
        vertical-align: middle;
        margin-right: 6pt;
    }
    
    /* ============================================
       Tables (if any)
       ============================================ */
    table {
        border-collapse: collapse;
        width: 100%;
        margin-bottom: 12pt;
    }
    
    th, td {
        border: 1px solid #000;
        padding: 6pt;
        text-align: left;
    }
    
    th {
        font-weight: bold;
        background-color: #f0f0f0 !important;
    }
    
    /* ============================================
       Lists
       ============================================ */
    ul, ol {
        margin-bottom: 8pt;
        padding-left: 20pt;
    }
    
    li {
        margin-bottom: 4pt;
    }
    
    /* ============================================
       Blockquotes
       ============================================ */
    blockquote {
        border-left: 4px solid #000;
        padding-left: 12pt;
        margin: 8pt 0;
        font-style: italic;
    }
}
