/* search.phpページ固有のスタイル */

/* パンくずリスト */
.breadcrumb {
    padding: 15px 0;
    background-color: #f5f5f5;
    margin-bottom: 30px;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb-item:not(:last-child)::after {
    content: '>';
    margin: 0 10px;
    color: #999;
}

.breadcrumb-item a {
    color: var(--color-primary);
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* セクションタイトル */
.section-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: var(--color-text);
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
}

/* 検索結果ヘッダー */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.results-count {
    font-size: 1rem;
    color: #666;
}

.search-results-header .btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}

/* 検索結果リスト */
.search-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* 結果なしの場合 */
.no-results {
    text-align: center;
    padding: 50px 0;
    color: #666;
}

.no-results i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

.no-results h3 {
    margin-bottom: 15px;
    color: #444;
}

.no-results p {
    margin-bottom: 20px;
}

/* アクティブフィルターの表示 */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e8f5e9;
    color: var(--color-primary);
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 0.85rem;
    border: 1px solid #c8e6c9;
}

.filter-tag .remove-filter {
    margin-left: 5px;
    width: 18px;
    height: 18px;
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tag .remove-filter:hover {
    background-color: var(--color-primary);
    color: white;
}

/* ソート機能 */
.sort-controls {
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
}

.sort-label {
    font-weight: 600;
    color: #444;
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid #ddd;
    font-size: 0.95rem;
}

.sort-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-option {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    color: #555;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sort-option i {
    margin-left: 5px;
    font-size: 0.9rem;
}

.sort-option:hover {
    background-color: #e8f5e9;
    border-color: #c8e6c9;
    color: var(--color-primary);
}

.sort-option.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}



/* 検索結果セクション */
.search-results-section {
    padding: 40px 0 60px;
}

/* 検索フォームセクション */
.search-section {
    padding: 60px 0;
    background-color: white;
}

.search-form {
    background-color: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 20px;
}

.search-group {
    flex: 1;
    min-width: 200px;
}

.search-group-full {
    flex: 0 0 100%;
    max-width: 100%;
}

.search-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.search-input,
.search-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus,
.search-select:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.search-submit {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    font-size: 1rem;
}

/* 検索フォーム内のソートセレクトボックス用スタイル */
.search-group-sort {
    position: relative;
}

.search-group-sort select {
    padding-right: 30px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.search-group-sort::after {
    content: '\f0d7';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    color: #555;
    pointer-events: none;
}

/* チェックボックスコンテナ */
.checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

/* チェックボックスラベル */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
    user-select: none;
}

.checkbox-label:hover {
    background-color: #e8f5e9;
}

/* チェックボックスを非表示にし、カスタムスタイルを適用 */
.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* カスタムチェックボックス */
.checkbox-label .checkbox-text {
    position: relative;
    padding-left: 25px;
    font-size: 0.95rem;
    color: #555;
}

.checkbox-text:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* チェック時のスタイル */
.checkbox-label input[type="checkbox"]:checked + .checkbox-text {
    color: var(--color-primary);
    font-weight: 500;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text:before {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text:after {
    content: '\f00c';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.7rem;
}

/* アイコン付きチェックボックス */
.bird-size-container,
.habitat-icon-container,
.season-icon-container,
.rarity-icon-container,
.migration-icon-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 15px;
}

.checkbox-with-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    padding: 10px;
    text-align: center;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.checkbox-with-icon .checkbox-text {
    padding-left: 0;
    font-size: 0.9rem;
    line-height: 1.3;
    margin-top: 8px;
}

.checkbox-with-icon .checkbox-text .size-description {
    font-size: 0.75rem;
    color: #777;
    display: block;
    margin-top: 2px;
}

.habitat-description {
    display: block;
    font-size: 0.7em;
    color: #666;
    margin-top: 2px;
    line-height: 1.5;
}

/* チェックボックスを非表示 */
.checkbox-with-icon input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* アイコン付きのチェックボックスでは、通常のチェックボックス用のスタイルを非表示 */
.checkbox-with-icon .checkbox-text::before,
.checkbox-with-icon .checkbox-text::after {
    display: none;
}

/* アイコン周りの円 */
.checkbox-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: #f5f5f5;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

/* ホバー時の背景色変更 */
.checkbox-with-icon:hover .checkbox-icon {
    background-color: rgba(46, 125, 50, 0.15);
}

/* チェックマーク（デフォルトでは非表示） */
.checkbox-icon::after {
    content: '\f00c';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    color: white;
    background-color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

/* チェック状態 */
.checkbox-with-icon input[type="checkbox"]:checked ~ .checkbox-icon {
    background-color: rgba(46, 125, 50, 0.15);
}

.checkbox-with-icon input[type="checkbox"]:checked ~ .checkbox-icon::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-with-icon input[type="checkbox"]:checked ~ .checkbox-text {
    color: var(--color-primary);
    font-weight: 500;
}

.checkbox-with-icon input[type="checkbox"]:checked ~ .checkbox-icon.migration-icon {
    background-color: rgba(46, 125, 50, 0.15);
    color: var(--color-primary);
    font-weight: bold;
}

/* 各サイズアイコンのサイズ調整 */
.size-icon.size-suzume {
    width: 20px;
    height: auto;
}

.size-icon.size-mukudori {
    width: 24px;
    height: auto;
}

.size-icon.size-hato {
    width: 30px;
    height: auto;
}

.size-icon.size-karasu {
    width: 46px;
    height: auto;
}

.size-icon.size-large {
    width: 55px;
    height: auto;
}

/* 生息区分アイコンと検索フォーム内の季節アイコン */
.habitat-icon,
.search-form .season-icon {
    width: 38px;
    height: auto;
}

/* 特定のアイコンサイズ調整 */
.habitat-icon.habitat-city {
    width: 45px;
}

.search-form .season-icon.season-winter {
    width: 45px;
}

/* 季節アイコンを中央に配置 */
.season-icon-container .checkbox-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 漢字アイコン */
.migration-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    font-weight: bold;
}

.kanji-icon {
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    font-weight: 700;
}

/* 珍しさアイコン */
.rarity-icon {
    width: 38px;
    height: auto;
}

/* モバイル向け調整 */
@media (max-width: 768px) {
    .search-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-count {
        margin-bottom: 10px;
    }

    .active-filters {
        margin-top: 10px;
    }

    .search-controls {
        flex-direction: column;
    }

    .sort-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .sort-label {
        border-right: none;
        border-bottom: 1px solid #ddd;
        padding-right: 0;
        padding-bottom: 10px;
        margin-bottom: 10px;
        width: 100%;
    }

    .sort-options {
        width: 100%;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .checkbox-container,
    .bird-size-container,
    .habitat-icon-container,
    .season-icon-container,
    .rarity-icon-container,
    .migration-icon-container {
        gap: 10px;
        justify-content: center;
    }

    .checkbox-with-icon {
        width: 90px;
        padding: 8px;
    }

    .checkbox-icon {
        width: 50px;
        height: 50px;
    }

    .size-icon.size-suzume {
        width: 18px;
    }

    .size-icon.size-mukudori {
        width: 22px;
    }

    .size-icon.size-hato {
        width: 26px;
    }

    .size-icon.size-karasu {
        width: 39px;
    }

    .size-icon.size-large {
        width: 44px;
    }

    .habitat-icon.habitat-city {
        width: 45px;
    }

    .search-form .season-icon.season-winter {
        width: 45px;
    }

    .search-form {
        padding: 20px;
    }
}



/* 色選択用スタイル */
.color-icon-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 15px;
}

.color-icon {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.color-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

/* 各色の定義 */
.color-white {
    background-color: #fff;
    border: 2px solid #ddd;
}

.color-black {
    background-color: #222;
}

.color-gray {
    background-color: #919191;
}

.color-brown {
    background-color: #8B4513;
}

.color-yellow {
    background-color: #FFD700;
}

.color-green {
    background-color: #2e7d32;
}

.color-red {
    background-color: #D32F2F;
}

.color-blue {
    background-color: #1976D2;
}

.color-orange {
    background-color: #FF8F00;
}



/* モバイル向け調整 - 768px以下の場合 */
@media (max-width: 768px) {
    .color-icon-container {
        justify-content: center;  /* モバイルでは中央揃えに変更 */
    }
}