/* 全体の基本設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    line-height: 1.6;
}

/* 言語セレクター */
.lang-selector-container {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 10;
    display: flex;
    gap: 8px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.lang-btn.active, .lang-btn:hover {
    background: #a07855; /* 高級感のあるブロンズゴールド */
    border-color: #a07855;
    color: #fff;
}

/* ヘッダーセクション（背景画像対応・明るさ調整済み） */
.main-header {
    position: relative;
    width: 100%;
    height: 420px;
    background-image: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.35)), url('../images/back.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    filter: brightness(1.05); /* 程よい明るさにブースト */
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
}

#main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 3px 6px rgba(0,0,0,0.7);
}

#main-subtitle {
    font-size: 1.1rem;
    color: #ddd;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/* 検索バーとNear Meボタン */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

#search-bar {
    width: 100%;
    padding: 12px 12px 12px 45px;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
}

#near-me-btn {
    background: #a07855;
    border: none;
    color: white;
    padding: 0 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

#near-me-btn:hover {
    background: #bd936c;
}

.status-message {
    font-size: 0.85rem;
    color: #ffcc00;
    margin-bottom: 15px;
    height: 18px;
}

/* フィルターボックス */
.filter-box {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.area-filter-group, .price-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.area-badge, .price-badge {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #ccc;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.area-badge.active, .price-badge.active, .area-badge:hover, .price-badge:hover {
    background: #a07855;
    border-color: #a07855;
    color: #fff;
}

/* チェックボックスUI */
.checkbox-filter-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.advanced-filters {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
}

.advanced-filters summary {
    cursor: pointer;
    color: #ddd;
    font-size: 0.85rem;
    font-weight: 600;
    list-style-position: inside;
}

.advanced-filters[open] summary {
    margin-bottom: 10px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #ccc;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
}

.custom-checkbox:hover input ~ .checkmark {
    background-color: #3a3a3a;
}

.custom-checkbox input:checked ~ .checkmark {
    background-color: #a07855;
    border-color: #a07855;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* メインコンテンツ & グリッド（デスクトップ3列固定） */
.content-wrapper-full {
    max-width: 1250px;
    margin: 30px auto 0 auto;
    padding: 0 20px;
}

.results-header-container {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #aaa;
    border-left: 3px solid #a07855;
    padding-left: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#reset-filters-btn {
    background: transparent;
    color: #bbb;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}

#reset-filters-btn:hover {
    color: #fff;
    border-color: #a07855;
}

.no-results {
    padding: 35px 20px;
    text-align: center;
    color: #aaa;
    border: 1px dashed #444;
    border-radius: 8px;
}

.cards-grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* デスクトップで綺麗な3列配置 */
    gap: 25px;
    margin-bottom: 5px;
}

/* カードのデザイン */
.item-card {
    background: #1a1a1a;
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: translateY(-4px);
    border-color: #a07855;
}

.card-body-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-main-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.item-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.area-tag-label {
    background: #2a2a2a;
    color: #aaa;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.distance-badge-ui {
    font-size: 0.85rem;
    color: #ffcc00;
    margin-bottom: 12px;
}

.item-description-text {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 15px;
    flex: 1; /* 各カードのボタンやバッジの位置を綺麗に揃える */
}

/* 特徴バッジインジケーター */
.feature-tags-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.feature-tags-flex span {
    background: rgba(160, 120, 85, 0.15);
    color: #bd936c;
    border: 1px solid rgba(160, 120, 85, 0.3);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.walkable-alert-row {
    font-size: 0.8rem;
    color: #2ecc71;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* アクションボタン */
.map-action-btn {
    display: block;
    text-align: center;
    background: #252525;
    border: 1px solid #444;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.2s;
}

.map-action-btn:hover {
    background: #a07855;
    border-color: #a07855;
}

/* シェアボタン（フッター上に綺麗な横1行で固定） */
.share-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.share-btn {
    background: #222;
    border: 1px solid #444;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.share-btn:hover {
    background: #333;
    color: #fff;
    border-color: #666;
}

/* ==========================================
   レスポンシブ対応（モバイル・タブレット最適化）
   ========================================== */
@media (max-width: 992px) {
    .cards-grid-layout {
        grid-template-columns: repeat(2, 1fr); /* タブレット画面では2列 */
    }
}

@media (max-width: 768px) {
    /* モバイルヘッダーの高さ制限を撤廃し、中身に応じて自動で伸びるように変更 */
    .main-header {
        height: auto !important; 
        min-height: 400px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 60px !important;
        padding-bottom: 25px !important; /* 下部にしっかり余白を確保 */
    }

    #main-title {
        font-size: 1.55rem !important;
        margin-top: 0 !important;
        text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    }

    #main-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }

    /* 検索バー周りのコンパクト化 */
    .search-container {
        flex-direction: row;
        gap: 6px;
        margin-bottom: 12px;
    }

    #search-bar {
        padding: 10px 10px 10px 35px;
        font-size: 0.9rem;
    }
    
    .search-icon {
        left: 12px;
    }

    #near-me-btn {
        padding: 0 12px;
        font-size: 0.85rem;
    }

    /* フィルターUIのモバイル最適化 */
    .filter-box {
        padding: 12px 10px;
        gap: 10px;
    }

    .area-filter-group, .price-filter-group {
        gap: 6px;
    }

    .area-badge, .price-badge {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .checkbox-filter-group {
        gap: 12px 8px; /* 行間を少し詰めて縦幅を節約 */
    }

    .custom-checkbox {
        font-size: 0.8rem;
    }

    /* ヘッダーが自動で伸びた分、下のコンテンツとの間にさらに安全な隙間を開ける */
    .content-wrapper-full {
        margin-top: 30px !important;
        position: relative;
        z-index: 5;
    }

    /* カウント表示とカードのレイアウト */
    .results-header-container {
        margin-bottom: 20px;
        font-size: 0.9rem;
    }

    .cards-grid-layout {
        grid-template-columns: 1fr; /* スマホ画面では見やすい1列 */
        gap: 20px;
    }
    
    /* 横幅の狭いスマホ画面でのシェアボタン溢れ防止 */
    .share-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}
