/* 印刷用CSS - A4サイズ最適化 */

@media print {
    /* ページ設定 */
    @page {
        size: A4 landscape; /* 横向き */
        margin: 10mm;
    }

    /* 基本設定 */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body {
        margin: 0;
        padding: 0;
        background: white;
        font-size: 10pt;
    }

    /* 非表示要素 */
    .app-header,
    .tab-navigation,
    .form-section,
    .control-buttons,
    .btn,
    button,
    nav,
    .modal,
    .tab-button {
        display: none !important;
    }

    /* コンテンツエリア */
    .app-container {
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
        margin: 0;
    }

    .main-layout {
        display: block;
    }

    .content-area {
        padding: 0;
        margin: 0;
    }

    .tab-content {
        display: none !important;
    }

    /* スケジュールタブのみ表示 */
    #schedule-tab {
        display: block !important;
    }

    /* スケジュール表 */
    .schedule-container {
        page-break-inside: avoid;
        overflow: visible;
        max-height: none;
        border: none;
    }

    .schedule-table {
        width: 100%;
        font-size: 9pt;
        border-collapse: collapse;
        page-break-inside: auto;
    }

    .schedule-table thead {
        display: table-header-group;
    }

    .schedule-table tbody {
        display: table-row-group;
    }

    .schedule-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .schedule-table th,
    .schedule-table td {
        border: 1px solid #333 !important;
        padding: 4px 6px !important;
        font-size: 9pt;
        line-height: 1.3;
    }

    /* ヘッダー行 */
    .schedule-table thead th {
        background: #e9ecef !important;
        font-weight: bold;
        border: 1px solid #333 !important;
    }

    /* 日付ヘッダー */
    .date-header {
        font-size: 8pt;
        padding: 3px !important;
    }

    /* スタッフ名列 */
    .staff-name-cell {
        background: #f8f9fa !important;
        font-weight: bold;
        white-space: nowrap;
        min-width: 80px;
    }

    /* シフトセル */
    .shift-cell {
        text-align: center;
        font-size: 9pt;
        min-width: 30px;
    }

    /* 色の調整（印刷用） */
    .shift-cell.color-1 {
        background: white !important;
        border: 1px solid #ccc !important;
    }

    .shift-cell.color-2 {
        background: #e3f2fd !important;
    }

    .shift-cell.color-3 {
        background: #ffebee !important;
    }

    .shift-cell.color-4 {
        background: #e8f5e9 !important;
    }

    .shift-cell.color-5 {
        background: #f5f5f5 !important;
    }

    /* 休日セル */
    .holiday-cell {
        background: #fff3cd !important;
    }

    /* タイトル表示 */
    #scheduleDisplay::before {
        content: "スケジュール表";
        display: block;
        font-size: 16pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 10px;
        padding-bottom: 5px;
        border-bottom: 2px solid #333;
    }

    /* ページ番号 */
    @page {
        @bottom-right {
            content: counter(page) " / " counter(pages);
        }
    }
}
