/* =========================================================
   検索画面デザイン (search-v2) — すっきり版
   戻し方: search_legacy.css に差し替え
   ========================================================= */

body.search-v2 {
    font-family: "M PLUS Rounded 1c", sans-serif;
    background: linear-gradient(180deg, #f3f7fb 0%, #f7f8fa 100%) !important;
    background-size: auto !important;
    color: #2C3E50;
}

body.search-v2 .hidden {
    display: none;
}

body.search-v2 .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 56px;
    min-height: auto;
}

body.search-v2 .search-page-head {
    margin-bottom: 16px;
}

body.search-v2 .search-page-head .title {
    text-align: left;
    font-size: 22px;
    font-weight: 800;
    color: #1f2a37;
    margin: 0 0 4px;
    padding: 0 0 10px 10px;
    border-bottom: 1px solid rgba(44, 62, 80, 0.1);
    position: relative;
}

body.search-v2 .search-page-head .title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35em;
    width: 3px;
    height: 1em;
    background: #4CAF50;
}

body.search-v2 .sub-title {
    margin: 0;
    padding: 0;
    border: none;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: #7a8794;
}

/* ----- 検索パネル ----- */
body.search-v2 .search-wrapper {
    padding: 20px 22px 18px;
    background: #fff;
    border: 1px solid rgba(44, 62, 80, 0.06);
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.04);
}

/* 選択中条件（控えめ） */
body.search-v2 .active-filters {
    margin: 0 0 16px;
    padding: 0 0 14px;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(44, 62, 80, 0.08);
}

body.search-v2 .active-filters[hidden] {
    display: none !important;
}

body.search-v2 .active-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

body.search-v2 .active-filters-label {
    font-size: 12px;
    font-weight: 700;
    color: #7a8794;
}

body.search-v2 .active-filters-clear {
    border: none;
    background: none;
    color: #7a8794;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

body.search-v2 .active-filters-clear:hover {
    color: #4CAF50;
}

body.search-v2 .active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.search-v2 .active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 8px;
    border: none;
    background: #eef6ef;
    color: #2C3E50;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

body.search-v2 .active-filter-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

body.search-v2 .active-filter-chip .chip-x {
    color: #7a8794;
    font-size: 13px;
    line-height: 1;
}

body.search-v2 .active-filter-chip:hover {
    background: #e2f0e3;
}

/* セクション：ラベル上・内容下 */
body.search-v2 .search-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid rgba(44, 62, 80, 0.06);
}

body.search-v2 .search-section:last-of-type {
    border-bottom: none;
}

body.search-v2 .search-section.flex-none {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.search-v2 .search-label,
body.search-v2 .anotherClass,
body.search-v2 .anotherClass_seikaku,
body.search-v2 .anotherClass_hiseikaku,
body.search-v2 .search-subhead {
    width: auto;
    flex-shrink: 0;
    margin: 0;
}

body.search-v2 .search-label label,
body.search-v2 .anotherClass label,
body.search-v2 .search-section > label.search-label,
body.search-v2 .search-subhead label,
body.search-v2 .detail-toggle label {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #7a8794;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.search-v2 .targetClass {
    flex: 1;
    margin: 0;
    display: block;
    min-width: 0;
    width: 100%;
}

body.search-v2 .genre-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

body.search-v2 .search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.search-v2 .media-btn,
body.search-v2 .character-btn,
body.search-v2 .genre-btn,
body.search-v2 .non-desired-character-btn {
    float: none;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border: none;
    border-radius: 0;
    background: #f3f5f7;
    color: #2C3E50;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

body.search-v2 .media-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

body.search-v2 .media-btn.active,
body.search-v2 .character-btn.active,
body.search-v2 .genre-btn.active,
body.search-v2 .non-desired-character-btn.active {
    background: #4CAF50;
    border-color: transparent;
    color: #fff;
    box-shadow: none;
}

body.search-v2 .btn-action:active {
    transform: none;
    opacity: 0.9;
}

body.search-v2 .genre-btn.genre-extra-hidden {
    display: none !important;
}

body.search-v2 .genre-more-btn {
    border: none;
    background: none;
    color: #5b6b7c;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

body.search-v2 .genre-more-btn:hover {
    color: #4CAF50;
}

body.search-v2 .genre-more-btn[hidden] {
    display: none !important;
}

body.search-v2 .gameLikeName {
    width: 100%;
    margin: 0;
    display: block;
}

body.search-v2 .gameLikeName input,
body.search-v2 input[type="text"],
body.search-v2 textarea,
body.search-v2 select {
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    color: #2C3E50;
    background: #f7f8fa;
    border: 1px solid transparent;
    border-radius: 0;
    padding: 10px 12px;
    margin: 0;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

body.search-v2 .gameLikeName input,
body.search-v2 input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

body.search-v2 #keywords {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 72px;
}

body.search-v2 .gameLikeName input:focus,
body.search-v2 input[type="text"]:focus,
body.search-v2 textarea:focus,
body.search-v2 select:focus {
    border-color: rgba(76, 175, 80, 0.45);
    background: #fff;
}

/* その他の条件（1本） */
body.search-v2 .search-more {
    margin-top: 4px;
    padding-top: 4px;
}

body.search-v2 .search-more-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border: none;
    border-top: 1px solid rgba(44, 62, 80, 0.06);
    border-bottom: 1px solid rgba(44, 62, 80, 0.06);
    background: none;
    color: #2C3E50;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

body.search-v2 .search-more-toggle:hover {
    color: #4CAF50;
}

body.search-v2 .search-more-arrow {
    color: #9aa6b2;
    font-size: 11px;
}

body.search-v2 .search-more-body {
    padding: 8px 0 4px;
}

body.search-v2 .search-more-body.collapse {
    display: none !important;
}

body.search-v2 .search-quick {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0 10px;
}

body.search-v2 .search-section--quick {
    padding: 0;
    border-bottom: none;
    gap: 6px;
}

body.search-v2 .search-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

body.search-v2 .choice-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.search-v2 .choice-chip {
    margin: 0;
    padding: 6px 10px;
    border: none;
    background: #f3f5f7;
    color: #2C3E50;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

body.search-v2 .choice-chip.active {
    background: #4CAF50;
    color: #fff;
}

body.search-v2 .star-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

body.search-v2 .star-picker-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

body.search-v2 .star-pick {
    margin: 0;
    padding: 0 2px;
    border: none;
    background: none;
    color: #d5dbe3;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

body.search-v2 .star-pick.active {
    color: #F5A623;
}

body.search-v2 .search-quick--detail {
    padding-top: 4px;
}

body.search-v2 .gender-chip-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.search-v2 .gender-chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

body.search-v2 .gender-chip-label {
    flex: 0 0 auto;
    min-width: 2.5em;
    font-size: 12px;
    font-weight: 700;
    color: #7a8794;
}

body.search-v2 .search-section--keywords input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

body.search-v2 .search-quick--detail .software-grid {
    gap: 8px;
}

body.search-v2 .search-quick--detail .software-grid input {
    padding: 8px 10px;
}

body.search-v2 .search-compact-grid {
    display: none;
}

body.search-v2 .search-range,
body.search-v2 .search-time-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
}

body.search-v2 .search-range select,
body.search-v2 .search-time-row select {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

body.search-v2 .search-range .range-sep,
body.search-v2 .search-time-row .range-sep {
    flex: 0 0 auto;
    padding: 0 2px;
}

body.search-v2 .search-time-row #day_select {
    flex: 0.7 1 0;
}

body.search-v2 .search-subpanels {
    margin-top: 4px;
    border-top: 1px solid rgba(44, 62, 80, 0.06);
}

body.search-v2 .search-subpanel + .search-subpanel {
    border-top: 1px solid rgba(44, 62, 80, 0.06);
}

body.search-v2 .search-subpanel-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border: none;
    background: none;
    color: #5b6b7c;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

body.search-v2 .search-subpanel-toggle:hover {
    color: #4CAF50;
}

body.search-v2 .search-subpanel-body {
    padding: 0 0 8px;
}

body.search-v2 .search-subpanel-body.collapse {
    display: none !important;
}

body.search-v2 .search-more-body .search-section {
    padding: 10px 0;
}

body.search-v2 .collapse {
    display: none !important;
}

body.search-v2 .detail-section {
    margin: 0;
    padding: 0;
    border: none;
}

body.search-v2 .detail-section:not(.collapse) {
    display: block;
}

body.search-v2 .search-range,
body.search-v2 .search-time-row,
body.search-v2 .search-age-row,
body.search-v2 .search-gender {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

body.search-v2 .search-compact-grid .search-range,
body.search-v2 .search-compact-grid .search-time-row {
    flex-wrap: nowrap;
    gap: 6px;
}

body.search-v2 .range-sep {
    color: #9aa6b2;
    font-weight: 600;
}

body.search-v2 .search-gender .man,
body.search-v2 .search-gender .woman {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

body.search-v2 .search-gender label {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    color: #7a8794;
}

body.search-v2 .software-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

body.search-v2 .software-grid > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.search-v2 .software-grid label {
    font-size: 11px;
    font-weight: 600;
    color: #7a8794;
    margin: 0;
}

/* アクション */
body.search-v2 .button-section {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(44, 62, 80, 0.06);
}

body.search-v2 .search-btn,
body.search-v2 .clear-btn {
    margin: 0;
    min-width: 120px;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    transition: background-color 0.15s, opacity 0.15s;
    box-shadow: none;
}

body.search-v2 .search-btn {
    background: #4CAF50;
    color: #fff;
}

body.search-v2 .search-btn:hover {
    background: #43a047;
    color: #fff;
}

body.search-v2 .clear-btn {
    background: transparent;
    color: #7a8794;
    border: 1px solid rgba(44, 62, 80, 0.12);
}

body.search-v2 .clear-btn:hover {
    background: #f7f8fa;
    color: #2C3E50;
}

body.search-v2 .search-btn:active,
body.search-v2 .clear-btn:active {
    transform: none;
    opacity: 0.92;
}

/* 結果バー */
body.search-v2 .search-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 22px 0 12px;
    padding: 0;
}

body.search-v2 .search-results-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
}

body.search-v2 .result-count {
    font-size: 13px;
    font-weight: 600;
    color: #7a8794;
}

body.search-v2 .result-count strong {
    font-size: 20px;
    font-weight: 800;
    color: #1f2a37;
    margin-right: 2px;
}

body.search-v2 .icon-hint {
    display: none;
}

body.search-v2 .sort-dropdown {
    margin: 0;
    text-align: right;
}

body.search-v2 .sort-dropdown select {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid rgba(44, 62, 80, 0.1);
    border-radius: 8px;
    background: #fff;
    color: #2C3E50;
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
}

body.search-v2 .card-container {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: none;
    margin: 0;
}

body.search-v2 .search-empty {
    width: 100%;
    margin: 12px 0;
    padding: 24px 16px;
    text-align: center;
    background: #fff;
    border: 1px solid rgba(44, 62, 80, 0.06);
    color: #7a8794;
    font-weight: 600;
    font-size: 14px;
}

body.search-v2 #loadingPopup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(31, 42, 55, 0.35);
    z-index: 1000;
}

body.search-v2 .loadingPopup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 18px 28px;
    border: 1px solid rgba(44, 62, 80, 0.06);
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.12);
}

body.search-v2 .loadingPopup-container p {
    color: #2C3E50;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

@media screen and (max-width: 768px) {
    body.search-v2 .container {
        padding: 16px 12px 40px;
    }

    body.search-v2 .search-wrapper {
        padding: 14px 12px;
    }

    body.search-v2 .search-page-head .title {
        font-size: 20px;
    }

    body.search-v2 .search-compact-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 8px;
        row-gap: 8px;
    }

    body.search-v2 .search-section--followers {
        grid-column: 1 / -1;
    }

    body.search-v2 .software-grid {
        grid-template-columns: 1fr;
    }

    body.search-v2 .button-section {
        flex-direction: column;
    }

    body.search-v2 .search-btn,
    body.search-v2 .clear-btn {
        width: 100%;
    }

    body.search-v2 .search-results-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.search-v2 .sort-dropdown {
        text-align: left;
    }

    body.search-v2 .sort-dropdown select {
        width: 100%;
    }

    body.search-v2 .card-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.search-v2 .search-age-row select,
    body.search-v2 #collab_desire_select,
    body.search-v2 #collab_activeness_select,
    body.search-v2 #language_value_select {
        width: 100%;
    }

    body.search-v2 .search-range select,
    body.search-v2 .search-time-row select {
        width: auto;
        flex: 1 1 0;
    }
}
