/* グローバルスタイル */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f9f9f9;
}

h1 {
    text-align: center;
    color: #333;
}

form {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

input[type="text"], input[type="date"], input[type="number"], input[type="email"] {
    width: calc(100% - 22px);
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

#shiftTable {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}

th, td {
    border: 1px solid black;
    padding: 8px;
    text-align: center;
    height: auto;
}

th {
    background-color: #f2f2f2;
    color: #333;
    position: sticky;
    top: 0;
}

/* シフトパターンに応じた色分け */
.color-kouban {
    background-color: #00FFFF !important;
    -webkit-print-color-adjust: exact;
}

.color-heiban {
    background-color: #FFA3B2 !important;
    -webkit-print-color-adjust: exact;
}

.color-haya {
    background-color: #FFA3B2 !important;
    position: relative;
    -webkit-print-color-adjust: exact;
}
.color-haya::after {
    content: '〇';
    color: black;
    font-size: 24px;
    font-weight: bold;
    font-family: "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", "MS P明朝", "MS PMincho", serif;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.color-kouyou {
    background-color: #ffffff !important;
    position: relative;
    -webkit-print-color-adjust: exact;
}
.color-kouyou::after {
    content: '〇';
    color: blue;
    font-size: 24px;
    font-weight: bold;
    font-family: "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", "MS P明朝", "MS PMincho", serif;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.color-white {
    background-color: #ffffff !important;
    -webkit-print-color-adjust: exact;
}

/* シフトの文字列を非表示にする */
td.color-kouban, td.color-heiban, td.color-haya, td.color-kouyou {
    color: transparent;
}

/* 曜日の色分け */
.saturday {
    color: blue;
}

.sunday {
    color: red;
}

/* 氏名コンテナのレイアウト */
.name-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.name-item {
    width: calc(25% - 10px);
    margin: 5px;
    box-sizing: border-box;
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
    body {
        margin: 10px;
    }

    form {
        padding: 15px;
    }

    th, td {
        padding: 4px;
    }

    button {
        width: 100%;
        padding: 12px;
    }
}

/* 印刷時に縮小表示 */
@media print {
  body.print-large table {
    font-size: 14px;
  }

  body.print-medium table {
    font-size: 11px;
  }

  body.print-small table {
    font-size: 9px;
  }

  table {
    width: 100%;
    border-collapse: collapse;
  }

  th, td {
    border: 1px solid #000;
    padding: 3px;
    text-align: center;
  }

  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  /* 非表示要素 */
  .btn,
  #toggleEditMode,
  form,
  .modal {
    display: none !important;
  }
}
@media print and (max-width: 768px) {
    body {
        zoom: 0.4;
    }

    h3, table {
        page-break-inside: avoid;
    }

    h3 {
        page-break-before: auto;
    }

    .shift-month {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* 氏名の文字サイズを大きくする */
td.name-cell {
    font-size: 24px;
    font-weight: bold;
    font-family: "ヒラギノ明朝 ProN W3", "Hiragino Mincho ProN", "MS P明朝", "MS PMincho", serif;
}

/* 月の位置調整 */
.shift-month {
    text-align: center;
    font-weight: bold;
    font-size: 20px;
}
