/* Print-specific Styles */
@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        background: white;
        color: black;
        font-family: Arial, sans-serif;
    }

    .app-container {
        min-height: auto;
    }

    header {
        background: transparent;
        border: none;
        padding: 20px 0;
        text-align: center;
    }

    header h1 {
        font-size: 2em;
        margin: 15px 0;
    }

    .holiday-icon {
        display: none;
    }

    .subtitle {
        display: none;
    }

    /* Hide all interactive elements */
    .top-controls,
    .language-selector,
    .lang-btn,
    .language-menu,
    .search-container,
    .search-box,
    .search-input,
    .search-clear,
    .search-btn,
    .search-suggestions,
    .advanced-search-panel,
    .search-results-summary,
    .year-navigation,
    footer,
    #toast-container,
    .close-btn,
    .holiday-details-panel,
    .modal-overlay,
    .modal {
        display: none !important;
    }

    main {
        padding: 20px;
        max-width: 100%;
    }

    .calendar-wrapper {
        background: transparent;
        border: none;
        padding: 0;
        page-break-after: always;
    }

    .calendar {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
        page-break-inside: avoid;
    }

    .calendar-header {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
        margin-bottom: 10px;
        page-break-inside: avoid;
    }

    .weekday {
        text-align: center;
        font-weight: bold;
        padding: 10px;
        background: #f0f0f0;
        border: 1px solid #ddd;
        border-radius: 5px;
        page-break-inside: avoid;
    }

    .calendar-day {
        aspect-ratio: auto;
        min-height: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        background: white;
        border: 1px solid #999;
        border-radius: 5px;
        padding: 5px;
        page-break-inside: avoid;
    }

    .calendar-day:hover {
        transform: none;
        box-shadow: none;
    }

    .calendar-day.other-month {
        opacity: 0.5;
        background: #f9f9f9;
    }

    .calendar-day.today {
        background: #ffffcc;
        border: 2px solid #999;
    }

    .day-number {
        font-size: 1.1em;
        font-weight: bold;
        margin-bottom: 3px;
    }

    .day-holidays {
        font-size: 0.7em;
        text-align: center;
        overflow: visible;
        display: block;
        -webkit-line-clamp: unset;
    }

    .holiday-badge {
        display: inline-block;
        padding: 2px 5px;
        background: #ffffcc;
        border: 1px solid #999;
        border-radius: 3px;
        font-size: 0.65em;
        margin: 2px 1px;
        color: #000;
    }

    .search-match,
    .search-no-match,
    .search-indicator {
        display: none;
    }

    /* Print header styles */
    h1 {
        color: #000;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
    }

    /* Page break rules */
    .holiday-stats {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    /* Ensure calendar fits on page */
    @page {
        size: A4 landscape;
        margin: 1cm;
    }

    /* Two calendars per page for year view */
    @media print and (orientation: landscape) {
        .calendar-wrapper {
            width: 48%;
            display: inline-block;
            margin-right: 2%;
            vertical-align: top;
        }

        .calendar-wrapper:nth-child(even) {
            margin-right: 0;
        }
    }
}

/* Print preview mode specific styles */
@media print and (color) {
    .calendar-day.today {
        background: #e6f2ff;
        border: 2px solid #0066cc;
    }

    .weekday {
        background: #e6e6e6;
    }

    .holiday-badge {
        background: #fff9e6;
        border-color: #999;
    }
}

/* Black and white print optimization */
@media print and (prefers-color-scheme: dark) {
    body {
        background: white;
        color: black;
    }

    .calendar-day {
        background: white;
        color: black;
        border-color: #000;
    }

    .calendar-day.today {
        background: #f0f0f0;
    }
}
