/**
 * セラピストカード & 一覧UI (5カ所共通)
 * /public_html/assets/thera-cards.css
 *
 * shop.css の後に読み込む前提(--shop-* / 1rem=10px を共有)。
 *
 * 使用場所:
 *   お店トップ 本日の出勤 / 在籍セラピスト / 新人セラピスト
 *   出勤ページ(shop-schedule.php) / セラピスト一覧(shop-therapists.php)
 *
 * カードのクラスは県トップ(area_l)と共通の .ap-thcard 系。
 * ツールバー・日付バー系は .tc-* のまま(お店サブページ専用)。
 */

/* ─────────────────────────────
   ツールバー
   ───────────────────────────── */
.tc-toolbar {
    margin-bottom: 14px;
}

.tc-toolbar__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-toolbar__row:empty {
    display: none;
}

/* 検索バーの置き場所(PC=上段 / SP=絞り込みパネル内)。空なら畳む */
.tc-toolbar__searchslot {
    flex: 1;
    display: flex;
    min-width: 0;
}

.tc-toolbar__searchslot:empty,
.tc-panel__search:empty {
    display: none;
}

.tc-panel__search {
    display: flex;
    flex: 1 1 100%;
    min-width: 0;
}

.tc-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    min-width: 0;
    padding: 0 14px;
    border-radius: var(--ap-radius);
    background: var(--shop-bg-card);
    border: 1px solid var(--ap-line);
}

.tc-search:focus-within {
    border-color: var(--shop-gold);
    box-shadow: 0 0 0 2px rgba(201, 168, 108, .2);
}

.tc-search i {
    flex-shrink: 0;
    font-size: 1.5rem;
    color: var(--shop-text);
    font-weight: 700;
}

.tc-search__input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    color: var(--shop-text);
    font-family: inherit;
    font-size: 1.4rem;
    transform: scale(.875);
    transform-origin: left center;
    width: calc(100% / .875);
}

.tc-search__input::placeholder {
    color: var(--shop-text-mute);
}

.tc-search__go {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: -8px;
    border: 0;
    border-radius: var(--ap-radius);
    background: var(--ap-red-point);
    font-size: 1.3rem;
    cursor: pointer;
}

/* 絞り込み(details/summary) */
.tc-filter {
    margin-top: 10px;
    text-align: right;
}

.tc-filter__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 42px;
    padding: 0 16px;
    background: var(--ap-panel-v2);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    color: var(--shop-gold-soft);
    font-size: 1.3rem;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.tc-filter__btn::-webkit-details-marker {
    display: none;
}

.tc-filter__btn::marker {
    content: "";
}

.tc-filter__btn i {
    color: var(--shop-gold);
    font-size: 1.4rem;
}

.tc-filter__lb--sp {
    display: none;
}

.tc-filter__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--shop-gold);
    color: #1a1611;
    font-size: 1.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tc-filter[open] .tc-filter__btn {
    border-color: var(--shop-gold);
}

.tc-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 12px;
    margin-top: 10px;
    padding: 16px;
    background: var(--ap-panel-v2);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    text-align: left;
}

.tc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tc-field__label {
    color: var(--shop-gold-soft);
    font-size: 1.1rem;
    letter-spacing: .06em;
}

.tc-field__select {
    height: 38px;
    min-width: 130px;
    padding: 0 10px;
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    background: var(--shop-bg-card);
    color: var(--shop-text);
    font-family: inherit;
    font-size: 1.3rem;
    cursor: pointer;
}

.tc-field__select option {
    background: var(--shop-bg-card);
}

.tc-switches {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 6px;
}

.tc-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--shop-text);
    font-size: 1.3rem;
    cursor: pointer;
    user-select: none;
}

.tc-switch input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

.tc-switch__track {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 22px;
    background: var(--ap-panel-dwn);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    transition: background .2s, border-color .2s;
}

.tc-switch__track::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--shop-text-mute);
    transform: translateY(-50%);
    transition: transform .2s, background .2s;
}

.tc-switch input:checked + .tc-switch__track {
    border-color: var(--shop-gold);
    background: rgba(201, 168, 108, .3);
}

.tc-switch input:checked + .tc-switch__track::after {
    background: var(--shop-gold);
    transform: translateY(-50%) translateX(16px);
}

.tc-switch input:focus-visible + .tc-switch__track {
    box-shadow: 0 0 0 2px rgba(201, 168, 108, .4);
}

.tc-panel__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.tc-panel__submit {
    flex: 1;
    height: 42px;
    border: 1px solid var(--shop-gold);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--shop-gold) 0%, var(--shop-gold-soft) 100%);
    color: #1a1611;
    font-family: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: opacity .2s;
}

.tc-panel__submit:hover {
    opacity: .8;
}

.tc-panel__clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 42px;
    padding: 0 16px;
    border: 1px solid var(--shop-gold-dim);
    border-radius: 999px;
    color: var(--shop-gold);
    font-size: 1.2rem;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .2s;
}

.tc-panel__clear:hover {
    opacity: .8;
}

/* 適用中の条件チップ */
.tc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--shop-gold-dim);
    border-radius: 999px;
    background: rgba(201, 168, 108, .1);
    color: var(--shop-gold-soft);
    font-size: 1.15rem;
    text-decoration: none;
}

.tc-chip i {
    font-size: 1.1rem;
    opacity: .7;
}

.tc-chip--clear {
    border-style: dashed;
    background: none;
    color: var(--shop-text-dim);
}

/* 並び替え + 件数 */
.tc-sortrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.tc-seg {
    display: inline-flex;
    min-width: 0;
    padding: 3px;
    background: var(--ap-panel-dwn);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    overflow-x: auto;
    scrollbar-width: none;
}

.tc-seg::-webkit-scrollbar {
    display: none;
}

.tc-seg__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--ap-dim);
    font-size: 1.2rem;
    text-decoration: none;
    white-space: nowrap;
}

.tc-seg__item.is-on {
    background: var(--ap-red-point);
    color: var(--shop-text);
    font-weight: 700;
}

.tc-count {
    flex-shrink: 0;
    color: var(--shop-text-dim);
    font-size: 1.2rem;
    white-space: nowrap;
}

.tc-count b {
    color: var(--shop-gold);
    font-size: 1.6rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 表示切替はツールバー右端に同居 */
.tc-toolbar__views {
    flex-shrink: 0;
}

/* ─────────────────────────────
   日付バー(21日分・横スクロール)
   ───────────────────────────── */
.tc-datebar {
    display: flex;
    align-items: stretch;
    margin-bottom: 12px;
    gap: 5px;
}

.tc-datebar__nav {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    padding: 0;
    background: var(--ap-panel-v2);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    color: var(--shop-text);
    font-family: inherit;
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .2s;
}

.tc-datebar__nav.is-disabled {
    opacity: .3;
    pointer-events: none;
}

.tc-datebar__days {
    flex: 1;
    display: flex;
    gap: 5px;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.tc-datebar__days::-webkit-scrollbar {
    display: none;
}

.tc-datebar__day {
    flex: 0 0 calc((100% - 30px) / 7);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 2px;
    background: var(--ap-panel-v2);
    border: 1px solid var(--ap-line);
    border-radius: var(--ap-radius);
    color: var(--shop-text);
    line-height: 1.2;
    text-decoration: none;
}

.tc-datebar__day.is-today {
    border-color: var(--shop-gold-dim);
}

.tc-datebar__day.is-active {
    border-color: var(--shop-gold);
}

.tc-datebar__md {
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tc-datebar__wd {
    color: var(--shop-text-dim);
    font-size: 1rem;
}

.tc-datebar__wd.is-sun {
    color: #e26a6a;
}

.tc-datebar__wd.is-sat {
    color: #6a9ce2;
}

.tc-datebar__cnt {
    color: var(--shop-gold);
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

.tc-datebar__cnt.is-zero {
    color: var(--shop-text-mute);
}

/* ─────────────────────────────
   凡例(予約グリッド用)
   ───────────────────────────── */
.tc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 8px;
    padding: 9px 12px;
    border: 1px solid var(--shop-border);
    border-radius: 6px;
    background: var(--shop-bg-card-alt);
    color: var(--shop-text-dim);
    font-size: 1.15rem;
}

.tc-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tc-legend b {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.tc-legend .is-open {
    color: var(--accent-geen, #2ecc71);
}

.tc-legend .is-ng {
    color: var(--accent-red, #c52630);
}

.tc-legend .is-tmp {
    color: var(--shop-gold);
}

.tc-legend .is-tel {
    color: #5a8dd6;
}

.tc-legend .is-off {
    color: var(--shop-text-mute);
}

/* 空状態 */
.tc-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 50px 0;
    color: var(--shop-text-dim);
    font-size: 1.4rem;
    text-align: center;
}

.tc-empty i {
    color: var(--shop-text-mute);
    font-size: 1.6rem;
}

/* ─────────────────────────────
   ツールバー / 日付バー SP
   ───────────────────────────── */
@media (max-width: 600px) {
    .tc-toolbar__row {
        flex-wrap: wrap;
    }

    /* 検索はパネル内に移動するので、送信は「この条件で絞り込む」1つに寄せる */
    .tc-search__go {
        display: none;
    }

    .tc-search--solo .tc-search__go {
        display: inline-flex;
    }

    .tc-filter,
    .tc-filter__btn {
        width: 100%;
        justify-content: center;
    }

    .tc-filter {
        margin-top: 0;
    }

    .tc-filter__lb--pc {
        display: none;
    }

    .tc-filter__lb--sp {
        display: inline;
    }

    .tc-field {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .tc-field__select {
        width: 100%;
        min-width: 0;
    }

    .tc-switches {
        flex: 1 1 100%;
        justify-content: center;
    }

    .tc-sortrow {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tc-count {
        text-align: right;
    }

    .tc-datebar__nav {
        display: none;
    }

    .tc-datebar__days {
        gap: 4px;
    }

    .tc-datebar__day {
        flex: 0 0 calc((100% - 16px) / 4.5);
    }

    .tc-datebar__md {
        font-size: 1.15rem;
    }

    .tc-legend {
        gap: 5px 10px;
        font-size: 1.05rem;
    }
}