@charset "utf-8";

/* =======================================================
   ベース設定
======================================================= */
body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: #f4f7f6;
    padding-bottom: 120px; /* フッター固定バーに隠れないよう余裕を持たせる */
}

.header-title {
    background-color: #ffffff;
    padding: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

/* =======================================================
   カード・コンテナ関連
======================================================= */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    margin-bottom: 30px;
}
.card-header-custom {
    background-color: #e9ecef;
    border-bottom: 2px solid #dee2e6;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0 !important;
}
.question-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.sub-question {
    font-weight: bold;
    color: #0d6efd;
    margin-bottom: 10px;
}

/* =======================================================
   フォーム・入力部品関連
======================================================= */
.required-mark {
    color: #dc3545;
    font-size: 0.9em;
    margin-left: 4px;
    font-weight: bold;
}
.form-label {
    font-weight: 500;
    color: #495057;
}
/* テキストボックス・セレクトボックスの枠線を少し濃くする */
.form-control,
.form-select,
.input-group-text {
    border-color: #6c757d;
}
.form-control:focus,
.form-select:focus {
    border-color: #495057;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25);
}
.number-input {
    text-align: right;
    min-width: 100px;
}
/* type="number"の矢印消し */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ラジオボタン・チェックボックスの視認性向上 */
.form-check {
    margin-bottom: 8px;
}
.form-check-input {
    border-color: #6c757d;
    border-width: 2px;
    width: 1.25em;
    height: 1.25em;
    cursor: pointer;
}
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.form-check-label {
    cursor: pointer;
    padding-top: 2px;
}
.table-survey .form-check-input {
    width: 1.5em;
    height: 1.5em;
}

/* =======================================================
   テーブル関連（スクロール・ヘッダー固定）
======================================================= */
/* テーブルの罫線を少し濃くする（table-bordered等のセル境界線） */
.table {
    --bs-border-color: #6c757d;
}
/* table-light/table-primary等の色付きセルは専用の薄い枠線色を持っているため、そちらも上書きする */
.table-light,
.table-primary,
.table-secondary,
.table-success,
.table-info,
.table-warning,
.table-danger {
    --bs-table-border-color: #6c757d;
}
.table-container,
.matrix-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    max-height: 65vh;
    overflow-x: scroll;
    overflow-y: scroll;
    margin-bottom: 30px;
    border: 1px solid #6c757d;
}
/* スクロールバーのデザイン */
.table-container::-webkit-scrollbar,
.matrix-container::-webkit-scrollbar {
    width: 14px;
    height: 14px;
    -webkit-appearance: none;
}
.table-container::-webkit-scrollbar-track,
.matrix-container::-webkit-scrollbar-track {
    background-color: #f1f3f5;
    border-radius: 8px;
}
.table-container::-webkit-scrollbar-thumb,
.matrix-container::-webkit-scrollbar-thumb {
    background-color: #adb5bd;
    border-radius: 8px;
    border: 2px solid #f1f3f5;
}
.table-container::-webkit-scrollbar-thumb:hover,
.matrix-container::-webkit-scrollbar-thumb:hover {
    background-color: #6c757d;
}

/* ヘッダーの固定 */
.table-custom thead th,
.table-matrix thead th {
    position: sticky;
    top: 0;
    background-color: #e9ecef;
    z-index: 10;
    vertical-align: middle;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #6c757d;
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1);
    white-space: nowrap;
}
.table-custom thead tr:nth-child(2) th,
.table-matrix thead tr:nth-child(2) th {
    top: 45px;
}
.table-custom td,
.table-matrix td {
    vertical-align: middle;
    padding: 0.5rem;
    white-space: nowrap;
}
.table-custom tr.lightgray {
    background-color: #fcfcfc;
}
.table-custom tr:hover {
    background-color: #f1f8ff !important;
}

/* 確認画面用リストテーブル（広がりすぎ防止） */
.table-info-list th {
    background-color: #f8f9fa;
    width: 200px; /* ここで幅を固定して間延びを防ぎます */
    vertical-align: middle;
    white-space: nowrap;
    border-color: #6c757d;
}
.table-info-list td {
    vertical-align: middle;
    border-color: #6c757d;
}

/* アンケート用テーブル */
.table-survey th {
    background-color: #f8f9fa;
    vertical-align: middle;
    text-align: center;
    font-weight: 500;
}
.table-survey td {
    vertical-align: middle;
}
.table-survey .text-start {
    text-align: left !important;
}

/* =======================================================
   その他UI部品（モーダル、アイコン、リスト、フッター）
======================================================= */
.help-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    background-color: #17a2b8;
    color: #fff !important;
    font-size: 0.75rem;
    text-decoration: none;
    margin-left: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.help-icon:hover {
    background-color: #138496;
}

/* モーダルウィンドウ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1050;
    align-items: center;
    justify-content: center;
}
.modal.is-active {
    display: flex;
}
.modal__bg {
    background: rgba(0,0,0,0.6);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.modal__content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    position: relative;
    z-index: 1051;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* アンケート用テキストリスト（ps-3で表示するラジオ回答と左位置を揃える） */
.answer-list {
    margin-bottom: 0;
    padding-left: 1rem;
    list-style: none;
}
.answer-list li {
    margin-bottom: 5px;
}

/* フッター固定バー */
.fixed-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #dee2e6;
    padding: 15px 0;
    z-index: 1030;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    backdrop-filter: blur(5px);
}

/* =======================================================
   印刷用設定 (confirm.php用)
======================================================= */
#print-tables { display: none; }

@media print {
    body {
        background-color: #fff;
        padding-bottom: 0;
        font-size: 10pt;
    }
    .header-title, .fixed-bottom-bar, .d-print-none, .help-icon {
        display: none !important;
    }
    .card {
        border: none;
        box-shadow: none;
        margin-bottom: 15px;
    }
    .card-header-custom {
        background-color: transparent;
        border-bottom: 2px solid #000;
        padding: 5px 0;
    }
    #screen-table { display: none !important; }
    #print-tables { display: block !important; }

    #print-tables table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 20px;
        font-size: 9pt;
    }
    #print-tables th, #print-tables td {
        border: 1px solid #000;
        padding: 4px;
    }
    #print-tables th {
        background-color: #eee;
        text-align: center;
    }
    @page { size: A4 landscape; margin: 10mm; }
}
