/* ================================================================
   Custom Search – 統合検索ページスタイル
   ================================================================ */

/* ----------------------------------------------------------------
   タブ
   ---------------------------------------------------------------- */
.custom-search-tabs {
    display: flex;
    border-bottom: 0.125rem solid #EBEBEB;
    margin-bottom: 1.25rem;
}

.custom-search-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    font-weight: bold;
    color: #AAAAAC;
    background: none;
    border: none;
    border-bottom: 0.15625rem solid transparent;
    margin-bottom: -0.125rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.custom-search-tab.is-active {
    color: #7D40A0;
    border-bottom-color: #7D40A0;
}

/* ----------------------------------------------------------------
   検索フォーム
   ---------------------------------------------------------------- */
.custom-search-search-form {
    margin-top: 1.25rem;
}

.custom-search-search-section {
    margin-bottom: 1.25rem;
}

.custom-search-search-label {
    display: block;
    font-size: 0.875rem;
    font-weight: bold;
    color: #535353;
    margin-bottom: 0.5rem;
}

/* フリーワード入力 */
.custom-search-input-wrap {
    position: relative;
}

.custom-search-input-icon {
    position: absolute;
    left: 1.125rem;
    top: 50%;
    transform: translateY(-50%);
    color: #AAAAAC;
    pointer-events: none;
}

.custom-search-search-input {
    font-size: 0.875rem;
    padding: 0.9375rem 1.125rem;
    border: none;
    border-radius: 62.5rem;
    background-color: #F5F5F5;
    width: 100%;
    color: #535353;
    box-sizing: border-box;
}

.custom-search-search-input.has-icon {
    padding-left: 2.75rem;
}

.custom-search-search-input::placeholder {
    color: #AAAAAC;
}

/* タグ（ピルボタン） */
.custom-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.custom-search-tag {
    padding: 0.375rem 0.875rem;
    border-radius: 62.5rem;
    border: 0.0625rem solid #AAAAAC;
    background-color: #ffffff;
    color: #AAAAAC;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.custom-search-tag.active {
    background-color: #7D40A0;
    border-color: #7D40A0;
    color: #ffffff;
}

/* MBTI タグ */
.custom-search-tags-mbti {
    gap: 0.375rem;
}

.custom-search-tag-mbti {
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.03em;
}

/* トグル */
.custom-search-toggles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.custom-search-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-search-toggle-label {
    font-size: 0.875rem;
    color: #535353;
}

.custom-search-toggle-switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.custom-search-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-search-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #AAAAAC;
    border-radius: 62.5rem;
    transition: 0.3s;
}

.custom-search-toggle-slider::before {
    position: absolute;
    content: '';
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background-color: #ffffff;
    border-radius: 50%;
    transition: 0.3s;
}

.custom-search-toggle-switch input:checked + .custom-search-toggle-slider {
    background-color: #7D40A0;
}

.custom-search-toggle-switch input:checked + .custom-search-toggle-slider::before {
    transform: translateX(1.5rem);
}

/* ----------------------------------------------------------------
   詳細検索ボタン + 選択済みチップ
   ---------------------------------------------------------------- */
.custom-search-detail-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.125rem;
    border-radius: 62.5rem;
    border: 0.0625rem solid #AAAAAC;
    background-color: #ffffff;
    color: #535353;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-search-detail-btn.has-conditions {
    border-color: #7D40A0;
    color: #7D40A0;
}

.custom-search-detail-btn-icon {
    display: inline-block;
    width: 0; height: 0;
    margin-left: auto;
    border-left: 0.3125rem solid transparent;
    border-right: 0.3125rem solid transparent;
    border-top: 0.375rem solid currentColor;
}

.custom-search-active-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.custom-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem 0.25rem 0.75rem;
    border-radius: 62.5rem;
    background-color: #7D40A0;
    color: #ffffff;
    font-size: 0.75rem;
}

.custom-search-chip-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* ----------------------------------------------------------------
   出勤日ボタン
   ---------------------------------------------------------------- */
.custom-search-schedule-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.125rem;
    border-radius: 62.5rem;
    border: 0.0625rem solid #AAAAAC;
    background-color: #ffffff;
    color: #535353;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.custom-search-schedule-btn.has-conditions {
    border-color: #7D40A0;
    color: #7D40A0;
}

.custom-search-schedule-note {
    font-size: 0.75rem;
    color: #AAAAAC;
    margin-top: 0.5rem;
    text-align: center;
}

/* ----------------------------------------------------------------
   出勤日カレンダー（flatpickr inline）
   ---------------------------------------------------------------- */
#custom-search-cast-schedule-date .flatpickr-calendar {
    box-shadow: none;
    border: 0.0625rem solid #AAAAAC;
    border-radius: 1rem;
    margin: auto;
    box-sizing: border-box;
}

#custom-search-cast-schedule-date .flatpickr-calendar::before,
#custom-search-cast-schedule-date .flatpickr-calendar::after {
    display: none !important;
}

#custom-search-cast-schedule-date .flatpickr-months {
    padding: 0.5rem 0;
}


#custom-search-cast-schedule-date .flatpickr-weekdaycontainer {
    display: flex;
    justify-content: space-around;
}


#custom-search-cast-schedule-date .flatpickr-day.today {
    border-color: #E9528E !important;
}

#custom-search-cast-schedule-date .flatpickr-day.selected,
#custom-search-cast-schedule-date .flatpickr-day.selected:hover,
#custom-search-cast-schedule-date .flatpickr-day.selected:focus {
    background: #E9528E !important;
    border-color: #E9528E !important;
    color: #fff;
    box-shadow: none;
}

/* ----------------------------------------------------------------
   並び順 + リセット
   ---------------------------------------------------------------- */
.custom-search-sort-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 0.0625rem solid #AAAAAC;
}

.custom-search-sort {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.custom-search-sort-radio {
    display: flex;
    flex-direction: column;
}

.custom-search-sort-radio input[type="radio"] {
    display: none;
}

.custom-search-sort-label {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 62.5rem;
    border: 0.0625rem solid #AAAAAC;
    background-color: #ffffff;
    color: #AAAAAC;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

.custom-search-sort-radio input[type="radio"]:checked + .custom-search-sort-label {
    background-color: #7D40A0;
    border-color: #7D40A0;
    color: #ffffff;
}

.custom-search-reset-btn {
    align-self: flex-end;
    padding: 0.3125rem 0.875rem;
    border-radius: 62.5rem;
    border: 0.0625rem solid #AAAAAC;
    background-color: #AAAAAC;
    color: #ffffff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.custom-search-reset-btn:active {
    background-color: #AAAAAC;
}

/* ----------------------------------------------------------------
   カード（2カラムグリッド）
   ---------------------------------------------------------------- */
#custom-search-cast-list,
#custom-search-store-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 0.875rem;
    margin-bottom: 2.5rem;
}

.custom-search-card {
    width: 100%;
    position: relative;
    min-width: 0;
}

.custom-search-card-inner {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.custom-search-card-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    position: relative;
    border-radius: 0.625rem;
}

.custom-search-card-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-search-card-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.6;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.25);
    z-index: 1;
}

.custom-search-badge-shift {
    background-color: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    font-weight: bold;
}

.custom-search-badge-shift.is-active {
    background-color: #E9528E;
    color: #ffffff;
    font-weight: bold;
}

.custom-search-badge-minor {
    background-color: #E9528E;
    color: #ffffff;
    font-weight: bold;
}

.custom-search-badge-category {
    background-color: rgba(0, 0, 0, 0.55);
    color: #ffffff;
}

/* 複数バッジ（未成年 + カテゴリー） */
.custom-search-card-image .custom-search-badge-minor + .custom-search-badge-category {
    top: 2rem;
}

/* コレクション中マーク（画像左下・自分が登録しているキャストのみ表示） */
.custom-search-card-collection-mark {
    position: absolute;
    left: 0.5rem;
    bottom: 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.custom-search-card-body {
    margin-top: 0.5rem;
}

.custom-search-card-name {
    font-size: 0.875rem;
    font-weight: bold;
    color: #535353;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

.custom-search-card-store {
    font-size: 0.75rem;
    color: #7D40A0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

.custom-search-card-area {
    font-size: 0.75rem;
    color: #AAAAAC;
    margin-bottom: 0.3rem;
}

.custom-search-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.custom-search-card-tag {
    padding: 0.1rem 0.4rem;
    border-radius: 62.5rem;
    font-size: 0.75rem;
    line-height: 1.6;
}

.custom-search-tag-cast {
    background-color: #FDF1FC;
    color: #E9528E;
}

.custom-search-tag-genre {
    background-color: #F3E7FD;
    color: #7D40A0;
}

/* 所属キャストアバター（店舗サムネイル画像の下部オーバーレイ） */
.custom-search-card-casts {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 1.25rem 0.5rem 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    z-index: 1;
    pointer-events: none;
}

.custom-search-card-cast-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 0.09375rem solid #ffffff;
    margin-left: -0.3125rem;
    display: block;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.4);
}

.custom-search-card-casts .custom-search-card-cast-avatar:first-child {
    margin-left: 0;
}

.custom-search-card-cast-more {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    color: #535353;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -0.3125rem;
    flex-shrink: 0;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.4);
}

/* 空状態 */
.custom-search-empty {
    text-align: center;
    color: #AAAAAC;
    font-size: 0.875rem;
    padding: 3rem 0;
    grid-column: 1 / -1;
}

/* ----------------------------------------------------------------
   マップ
   ---------------------------------------------------------------- */
#custom-search-store-map-wrap {
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.12);
}

#custom-search-store-map {
    height: 16.25rem;
    width: 100%;
}

.gm-control-active.gm-fullscreen-control {
    display: none;
}

.gm-style-cc {
    display: none;
}

gmp-internal-camera-control.gmnoprint {
    display: none;
}

img[alt="Google"] {
    display: none !important;
}

.gmnoprint.gm-style-mtc-bbw {
    display: none;
}

/* カスタムピン */
.custom-search-map-pin {
    position: relative;
    width: 3.875rem;
    cursor: pointer;
}

.custom-search-map-pin-bubble {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    border: 0.1875rem solid #7D40A0;
    overflow: hidden;
    background-color: #ffffff;
    box-shadow: 0 0.1875rem 0.5rem rgba(0, 0, 0, 0.35);
}

.custom-search-map-pin-tail {
    width: 0; height: 0;
    border-left: 0.5rem solid transparent;
    border-right: 0.5rem solid transparent;
    border-top: 0.625rem solid #7D40A0;
    margin: -0.125rem auto 0;
}

.custom-search-map-pin-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* 小さく縮小される際の線形補間をブラウザに任せて鮮明化 */
    image-rendering: -webkit-optimize-contrast;
}

/* 自己位置ピン（青ドット＋パルス） */
.custom-search-map-user-pin {
    position: relative;
    width: 1.375rem;
    height: 1.375rem;
}

.custom-search-map-user-pin-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #4285F4;
    border: 0.15625rem solid #ffffff;
    box-shadow: 0 0.0625rem 0.25rem rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.custom-search-map-user-pin-pulse {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: rgba(66, 133, 244, 0.35);
    transform: translate(-50%, -50%);
    animation: custom-search-map-user-pulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes custom-search-map-user-pulse {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.7; }
    70%  { transform: translate(-50%, -50%) scale(2.6); opacity: 0;   }
    100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0;   }
}

/* ----------------------------------------------------------------
   モーダル
   ---------------------------------------------------------------- */
body.modal-open {
    overflow: hidden;
}

.custom-search-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.custom-search-modal-backdrop.is-open {
    display: block;
}

.custom-search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 30rem;
    max-height: calc(100dvh - 4rem);
    z-index: 1001;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.custom-search-modal-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100dvh - 4rem);
}

.custom-search-modal-header {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.125rem;
    border-bottom: 0.0625rem solid #EBEBEB;
    flex-shrink: 0;
}

.custom-search-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #535353;
    cursor: pointer;
    padding: 0;
    margin-right: 0.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.custom-search-modal-title {
    font-size: 1rem;
    font-weight: bold;
    color: #535353;
}

.custom-search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.125rem;
    -webkit-overflow-scrolling: touch;
}

.custom-search-location-required-msg {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #535353;
    line-height: 1.6;
}

.custom-search-location-required-privacy {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: #535353;
    line-height: 1.6;
}

.custom-search-location-required-privacy li {
    position: relative;
    padding-left: 1.125rem;
    margin-bottom: 0.25rem;
}

.custom-search-location-required-privacy li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.4rem;
    height: 0.2rem;
    border-left: 0.125rem solid #7D40A0;
    border-bottom: 0.125rem solid #7D40A0;
    transform: rotate(-45deg);
}

.custom-search-location-help {
    margin-top: 0.5rem;
    border-top: 0.0625rem solid #EBEBEB;
    padding-top: 0.75rem;
    font-size: 0.875rem;
}

.custom-search-location-help summary {
    cursor: pointer;
    color: #7D40A0;
    font-weight: bold;
    list-style: none;
    padding: 0.25rem 0;
}

.custom-search-location-help summary::-webkit-details-marker { display: none; }

.custom-search-location-help summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.15s ease;
}

.custom-search-location-help[open] summary::before {
    content: "▾ ";
}

.custom-search-location-help-desc {
    margin: 0.5rem 0;
    color: #AAAAAC;
    line-height: 1.5;
}

.custom-search-location-help-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-search-location-help-links li {
    margin-bottom: 0.4rem;
}

.custom-search-location-help-links a {
    color: #7D40A0;
    text-decoration: underline;
    word-break: break-word;
}

.custom-search-modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-top: 0.0625rem solid #EBEBEB;
    flex-shrink: 0;
}

.custom-search-modal-count {
    font-size: 0.875rem;
    font-weight: bold;
    color: #535353;
    white-space: nowrap;
    min-width: 3.5rem;
}

.custom-search-modal-actions {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
}

.custom-search-modal-actions--dual {
    width: 100%;
    justify-content: space-between;
    gap: 0.625rem;
}

.custom-search-modal-actions--dual .custom-search-modal-cancel,
.custom-search-modal-actions--dual .custom-search-modal-apply {
    flex: 1;
}

.custom-search-modal-cancel {
    padding: 0.6875rem 1rem;
    border-radius: 62.5rem;
    border: 0.0625rem solid #AAAAAC;
    background-color: #ffffff;
    color: #535353;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
}

.custom-search-modal-reset {
    padding: 0.6875rem 1rem;
    border-radius: 62.5rem;
    border: 0.0625rem solid #AAAAAC;
    background-color: #ffffff;
    color: #535353;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
}

.custom-search-modal-apply {
    padding: 0.6875rem 1.25rem;
    border-radius: 62.5rem;
    border: none;
    background-color: #7D40A0;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
}
