/* styles.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    color: #333;
    background-color: #f4f4f4;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.5rem;
}

/* 説明テキスト用スタイル */
.description-text {
    text-align: center;
    font-size: 16px;
    color: #2c3e50;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #eaeaea;
}

.result-description {
    margin-bottom: 15px;
}

/* 注意文のスタイル */
.notice-text {
    font-size: 12px;
    color: #666;
    border-radius: 5px;
    padding: 10px 15px;
}

/* フォームリンクスタイル */
.form-link {
    color: #3498db;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px dotted #3498db;
    transition: all 0.3s ease;
}

.form-link:hover {
    color: #2980b9;
    border-bottom: 1px solid #2980b9;
}

/* アクションボタンコンテナ */
.action-button-container {
    margin-top: 12px;
}

/* アクションボタンスタイル */
.action-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    font-weight: bold;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.action-button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

/* 検索エリア */
.search-area {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;  /* 左寄せに変更 */
    margin-bottom: 15px;
}

.search-item {
    flex: 1;
    margin-right: 15px;
}

.search-item:last-child {
    margin-right: 0;
}

.search-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.search-item select,
.search-item input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.search-btn {
    background-color: #3498db;
    color: white;
}

.search-btn:hover {
    background-color: #2980b9;
}

.reset-btn {
    background-color: #95a5a6;
    color: white;
    margin-left: 10px;
}

.reset-btn:hover {
    background-color: #7f8c8d;
}

/* ボタンサイズの調整 */
.search-btn, .reset-btn {
    min-width: 120px;
    text-align: center;
}

/* 結果エリア */
.result-area {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.result-count {
    margin-bottom: 15px;
    font-weight: bold;
}

#propertyTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px; /* 一覧の文字サイズを14pxに修正 */
}

#propertyTable th, 
#propertyTable td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

#propertyTable th {
    background-color: #f8f9fa;
    font-weight: bold;
}

#propertyTable tr:hover {
    background-color: #f5f5f5;
}

.id-col {
    width: 100px; /* 物件IDの幅を100pxに固定 */
    cursor: pointer;
}

.id-col:hover {
    color: #3498db;
}

.pref-col {
    width: 100px; /* 都道府県の幅を100pxに固定 */
}

.subject-col {
    width: 15%;
}

.name-col {
    width: 15%;
}

.section-col {
    width: 15%;
}

.rent-col {
    width: 12%;
}

.feature-col {
    width: 27%;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    width: 80%;
    max-width: 800px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

/* 科目グリッド - 4列レイアウト */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.subject-checkbox {
    display: flex;
    align-items: center;
}

.subject-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
}

.apply-btn {
    background-color: #3498db;
    color: white;
}

.apply-btn:hover {
    background-color: #2980b9;
}

.clear-btn {
    background-color: #95a5a6;
    color: white;
    margin-right: 10px;
}

.clear-btn:hover {
    background-color: #7f8c8d;
}

/* テーブルのレスポンシブ対応を強化 */
.result-area {
    overflow-x: auto; /* 結果エリア全体を横スクロール可能に */
    width: 100%;
    -webkit-overflow-scrolling: touch; /* iOSでのスムーズなスクロール */
}

#propertyTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 900px; /* テーブルの最小幅を設定 */
}

/* レスポンシブ対応の強化 */
@media screen and (max-width: 768px) {
    .search-row {
        flex-direction: column;
    }
    
    .search-item {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    /* スマホ時のボタンスタイル調整 */
    .search-btn, .reset-btn {
        width: 48%;  /* ボタン幅を均等に */
        margin: 0;   /* マージンをリセット */
    }
    
    /* アクションボタンのスマホ対応 */
    .action-button {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
        text-align: center;
        font-size: 15px;
        padding: 12px 15px;
    }
    
    /* 検索ボタンとリセットボタンを含む行のスタイル */
    .search-row:last-child {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .subject-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* スクロール指示の追加 */
    .result-area::after {
        content: "←スワイプしてください→";
        display: block;
        text-align: center;
        padding: 5px;
        color: #666;
        font-size: 0.8rem;
        background-color: #f8f9fa;
        border-top: 1px solid #ddd;
        position: sticky;
        bottom: 0;
        left: 0;
        width: 100%;
    }
    
    /* 各列の幅を調整 */
    .id-col { width: 100px; } /* スマホ表示でも100pxに固定 */
    .pref-col { width: 100px; } /* スマホ表示でも100pxに固定 */
    .subject-col { width: 140px; }
    .name-col { width: 140px; }
    .section-col { width: 140px; }
    .rent-col { width: 120px; }
    .feature-col { width: 220px; }
}

/* フッターのスタイル */
.footer {
    background-color: #f5f5f5;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-link {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.copyright {
    text-align: center;
    font-size: 0.9rem;
    color: #777;
}