/* マーカー公開設定オーバーレイ（mapStreetViewMarkerEdit と同等のレイヤー・中央配置） */
#marker-publication-setting-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    /* 地図／SV サイドメニュー（z-index 1001〜10000）より前面 */
    z-index: 11000;
}

/* 設定フォーム本体 */
#marker-publication-setting-form {
    width: 90vw;
    max-width: 520px;
    max-height: 90vh;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    overflow-x: hidden;
}

#marker-publication-setting-form::-webkit-scrollbar {
    width: 6px;
}

#marker-publication-setting-form::-webkit-scrollbar-thumb {
    background: #727272;
    border-radius: 4px;
}

#marker-publication-setting-form::-webkit-scrollbar-track {
    background: #f0f0f0;
}

#marker-publication-setting-form:focus {
    outline: none;
}

#marker-publication-setting-form h3 {
    font-size: 20px;
    margin: 0 0 16px 0;
    color: #222;
    font-weight: 700;
}

.marker-publication-setting-section {
    margin-bottom: 20px;
}

.marker-publication-setting-section h4 {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 700;
}

/* 検索（map-streetview-marker-search-box-container に準拠） */
.marker-publication-setting-search-box-container {
    display: flex;
    align-items: center;
    width: 95%;
    gap: 10px;
}

#marker-publication-setting-user-search-input {
    flex: 1;
    min-width: 0;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    outline: none;
    background-color: transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#marker-publication-setting-user-search-input:focus {
    border: 2px solid #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

#marker-publication-setting-user-search-input::placeholder {
    color: #aaa;
    font-size: 14px;
}

#marker-publication-setting-search-user-btn {
    background-color: #ffffff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#marker-publication-setting-search-user-btn::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background-color: #7bb9fa;
    border-radius: 50%;
    transition: width 0.3s ease;
}

#marker-publication-setting-search-user-btn:hover {
    background-color: #d1e7ff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#marker-publication-setting-search-user-btn:hover::after {
    width: 60%;
}

/* ユーザーリスト表（データ部は約5行ぶんの高さに収め、それ以上は縦スクロール） */
.marker-publication-setting-table-wrap {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    /* thead 1行 + tbody 約5行分（padding・14px フォントを想定） */
    max-height: 260px;
    overscroll-behavior: contain;
}

.marker-publication-setting-table-wrap::-webkit-scrollbar {
    width: 8px;
}

.marker-publication-setting-table-wrap::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 4px;
}

.marker-publication-setting-table-wrap::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 0 8px 8px 0;
}

.marker-publication-setting-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #333;
}

.marker-publication-setting-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: 10px 12px;
    background: #f5f5f5;
    font-weight: 700;
    color: #222;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 0 #ddd;
}

/* 表格外枠のみ（行間の罫線は付けない） */
.marker-publication-setting-table tbody td {
    padding: 10px 12px;
    border-bottom: none;
    vertical-align: middle;
}

.marker-publication-setting-table-passcode-cell {
    word-break: break-all;
    font-family: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', monospace;
    font-size: 13px;
}

/* 行のホバー・フォーカス内（チェック操作時）をわかりやすく */
.marker-publication-setting-user-row {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.marker-publication-setting-user-row:hover {
    background-color: #f0f7ff;
}

.marker-publication-setting-user-row:focus-within {
    background-color: #e3f0ff;
    box-shadow: inset 3px 0 0 #54a5fc;
}

.marker-publication-setting-table-checkbox-cell {
    white-space: nowrap;
}

.marker-publication-setting-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #555;
}

/**
 * ネイティブ accent-color では OS 描画のチェックが黒系になりがちのため、
 * appearance: none で枠＋明るい緑塗り、白の ✓ を ::after で描画する
 */
.marker-publication-setting-publish-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 19px;
    height: 19px;
    margin: 0;
    flex-shrink: 0;
    border: 2px solid #b8b8b8;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.marker-publication-setting-publish-checkbox:hover {
    border-color: #8fd99a;
}

.marker-publication-setting-publish-checkbox:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 1px;
}

/* 明るい緑のON状態 */
.marker-publication-setting-publish-checkbox:checked {
    background: #4ade80;
    border-color: #22c55e;
}

/* 白のチェック（回転した L 字 = ✓ 風） */
.marker-publication-setting-publish-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    width: 7px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    box-sizing: border-box;
}

/* フッターボタン（mapStreetViewMarkerEdit と同系） */
.marker-publication-setting-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#marker-publication-setting-save-btn {
    background-color: #ffffff;
    border: 1px solid #969696;
    border-radius: 50px;
    color: #54a5fc;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

#marker-publication-setting-save-btn:hover {
    background-color: #cfe0ff;
    border-color: #025aff;
    color: #025aff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#marker-publication-setting-cancel-btn {
    background-color: #ffffff;
    border: 1px solid #969696;
    border-radius: 50px;
    color: #f85858;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

#marker-publication-setting-cancel-btn:hover {
    background-color: #fddfdf;
    border-color: #ff0202;
    color: #ff0202;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* マーカー登録・編集フォーム内の「公開設定を開く」（地図マーカー／スポット／SV マーカー共通クラス） */
.marker-publication-from-marker-form-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

/* 見出しは各フォームの .marker-edit-section h4 等に任せ、ここでは余白のみ調整 */
.marker-publication-from-marker-form-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.marker-publication-from-marker-form-open-btn {
    padding: 10px 18px;
    font-size: 14px;
    color: #fff;
    background-color: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.marker-publication-from-marker-form-open-btn:hover {
    background-color: #1d4ed8;
}

@media screen and (max-width: 600px) {
    #marker-publication-setting-form {
        width: 95vw;
        max-width: none;
        padding: 15px;
    }

    #marker-publication-setting-form h3 {
        font-size: 18px;
    }

    .marker-publication-setting-buttons button {
        padding: 8px 12px;
    }

    .marker-publication-setting-table {
        font-size: 13px;
    }

    .marker-publication-setting-table thead th,
    .marker-publication-setting-table tbody td {
        padding: 8px 10px;
    }

    .marker-publication-setting-table-wrap {
        max-height: 230px;
    }
}
