/* plan.css - 学習指導案ページ専用スタイル */

/* 検索フォームの調整 */
.filter-area {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #eee;
}

.filter-group {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
}

.filter-group label {
    font-weight: bold;
    margin-right: 5px;
    display: block;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    min-width: 150px;
}

/* 検索・リセットボタン */
#filterButton, #resetButton {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    transition: 0.3s;
}

#filterButton {
    background-color: #064fc4;
    color: white;
}

#filterButton:hover {
    background-color: #053ca0;
}

#resetButton {
    background-color: #666;
    color: white;
}

#resetButton:hover {
    background-color: #444;
}

/* テーブルスタイル */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f4f4f4;
    border-top: 2px solid #064fc4;
}

/* キャプション */
caption {
    font-weight: bold;
    margin-bottom: 10px;
    text-align: left;
    font-size: 1.1rem;
}

tr:hover {
    background-color: #fcfcfc;
}

/* メッセージスタイル */
.no-results {
    display: none;
    margin-top: 20px;
    padding: 20px;
    color: #d9534f;
    background-color: #fdf7f7;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

/* レスポンシブデザイン（スマホでのカード形式） */
@media screen and (max-width: 768px) {
    .filter-group {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    
    .filter-group select {
        width: 100%;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    td {
        display: flex;
        justify-content: space-between;
        padding: 8px 5px;
        border-bottom: 1px dotted #eee;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #064fc4;
        margin-right: 10px;
    }

    td:last-child {
        border-bottom: none;
        flex-direction: column;
    }
    
    caption {
        display: block;
        width: 100%;       /* 幅をいっぱいにする */
        box-sizing: border-box;
        text-align: left;
        padding: 5px 0;
        margin-bottom: 15px;
        white-space: normal; /* 折り返しを許可 */
    }
    /* 検索エリア全体の余白を調整 */
    .filter-area {
        padding: 15px;
    }

    /* ラベルの文字を大きく、少し太くして見やすく */
    .filter-group label {
        font-size: 1rem; /* 16px相当 */
        margin-bottom: 8px;
    }

    /* セレクトボックスを大きくし、文字サイズを16pxに（iPhoneでのズーム防止） */
    .filter-group select {
        width: 100%;
        height: 48px;     /* タップしやすい高さ */
        font-size: 16px;  /* 16px未満だとiPhoneで入力時に自動ズームしてしまうため */
        margin-bottom: 15px;
        padding: 10px;
    }
    /* ボタンエリアの調整（横並び維持） */
    .filter-group[style*="vertical-align: bottom"] {
        display: flex;
        gap: 8px;      /* ボタン間の隙間 */
        width: 100%;
        margin-top: 5px;
    }
    /* ボタンを横に並べて大きくする */
    #filterButton, #resetButton {
        flex: 1;       /* 均等な幅で横並び */
        height: 50px;  /* 押しやすい高さ */
        font-size: 1rem;
        padding: 0;    /* 高さをheightで制御するためパディングをリセット */
        display: flex;
        align-items: center;
        justify-content: center;
    }
}