/* tennis/static/tennis/participants.css */

/* =========================================
   参加者一覧（カードレイアウト）
   ========================================= */

#participants-table {
    width: max-content;      /* ★中身の合計幅で止める（左に詰まる） */
    max-width: 100%;         /* ★画面より大きい場合の保険 */
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 6px;
}

/* ヘッダー */
#participants-table th {
    border: none;
    padding: 4px 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

/* 通常セル */
#participants-table td {
    border: none;
    padding: 4px 8px;
    vertical-align: middle;
}

/* 連番セル：幅を詰める（★修正） */
#participants-table td.participant-index{
  width: 22px;           /* ★列幅を固定で小さく */
  padding: 0 4px;        /* ★左右paddingを削って左に詰める */
}

/* ラッパー：右寄せにする（★修正） */
#participants-table td.participant-index .idx{
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;  /* ★中央→右寄せ */

  height: 100%;
  min-height: 34px;
  width: 100%;               /* ★右寄せを確実に効かせる */
}




/* チェックボックス列 */
#participants-table .checkbox-cell {
    text-align: center;
}

/* 対戦表の名前カードのミニ版 */
.tb-player-card-sm {
    display: inline-block;
    width: 116px;      /* 対戦表より少し小さめ */
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #555;
    background: #fff;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    box-sizing: border-box;
    white-space: nowrap;
}

/* 名前部分（個人ページへのリンク）：下線・色は親に合わせる */
.tb-player-card-sm a.name-link,
.tb-player-card-sm a.name-link:visited {
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.tb-player-card-sm a.name-link:hover {
    color: #1f7a8c;
}

/* 退会者・過去イベントのゲスト：名前の後ろに付けるアスタリスク */
.withdrawn-mark {
    margin-left: 3px;
    color: #000;
    font-weight: 700;
}
/* 名前カード自体のホバー枠（リンク化に伴う視覚補助） */
.tb-player-card-sm:focus-within {
    outline: 2px solid #1f7a8c;
    outline-offset: 1px;
}

/* 行ホバー時の薄いハイライト */
#participants-table tbody tr:hover td {
    background: #fafafa;
}

/* ===== settings: 出欠（チェック表示の見た目） ===== */
.attendance-cell { text-align: center; }

.attendance-btn{
  border: none !important;          /* ←枠を消す */
  background: transparent !important;
  padding: 2px 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

/* 出欠：カラム中央に固定 */
.attendance-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;          /* ★セル幅いっぱいを基準に中央化 */
  padding: 0;           /* ★左右paddingで中心がズレるのを防ぐ */
}

.attendance-btn:focus{ outline: none; }
.attendance-btn:active{ transform: translateY(1px); }

.attendance-icon{
  display: inline-flex;           /* ★ inline-block → inline-flex */
  align-items: center;            /* ★縦中央 */
  justify-content: center;        /* ★横中央 */

  width: 26px;
  height: 26px;
  box-sizing: border-box;         /* ★枠込みで26pxに固定 */

  border: 1.5px solid #d1d5db;
  border-radius: 4px;

  font-size: 20px;                /* ★check-icon と揃える（今 22px なのでズレやすい） */
  font-weight: 900;
  line-height: 1;                 /* これはOK */
}

.attendance-none {
  /* 表示なし（空） */
}

/* 色イメージ（調整さん風） */
.attendance-yes  { color: #16a34a; }  /* 濃い緑 */
.attendance-no   { color: #cbd5e1; }  /* 薄いグレー */
.attendance-maybe{ color: #86efac; }  /* 薄い緑 */



/* ===== コメント（グレーのテキストボックス風：モーダル入力欄に寄せる） ===== */
.comment-editable{
  min-height: 34px;
  padding: 8px 10px;


  border-radius: 10px;
  background: #f2f3f5;

  outline: none;
  text-align: left;

  /* 文章が長い時に自然に折り返す */
  white-space: normal;
  word-break: break-word;

  /* セル幅いっぱいに */
  width: 100%;
  box-sizing: border-box;

  /* 触った感（inputっぽさ） */
  transition: background 0.15s ease, border-color 0.15s ease;
}

/* hover/active で少しだけ濃く（入力欄らしさ） */
.comment-editable:hover{
  background: #eceef1;
}

.comment-editable:focus{
  background: #ffffff;
  border-color: rgba(0,0,0,0.18);
}

/* placeholder（空のとき） */
.comment-editable:empty:before{
  content: attr(data-placeholder);
  color: #9ca3af;
}


/* ===== 共通：チェックマークUI（出欠/試合参加/フラグ） ===== */

.check-cell{
  text-align: center;
}

.check-btn{
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px 6px;
}

/* 試合参加/フラグ：カラム中央に固定 */
.check-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;          /* ★セル幅いっぱいを基準に中央化 */
  padding: 0;           /* ★左右paddingで中心がズレるのを防ぐ */
}

.check-btn:focus{ outline: none; }
.check-btn:active{ transform: translateY(1px); }

.check-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 26px;
  height: 26px;

  border: 1.5px solid #d1d5db;   /* ★ 薄グレー枠 */
  border-radius: 4px;

  font-size: 20px;
  font-weight: 900;
  line-height: 1;

  transition: background-color 0.15s ease,
              border-color 0.15s ease,
              color 0.15s ease;
}

/* ★ 試合参加・フラグ用（赤） */
/* 未チェック */
.check-off{
  color: transparent;
  background: transparent;
}

/* ★ チェックON（赤） */
.check-on{
  color: #dc2626;
  /* border-color: #dc2626; */
  /* background: #fff5f5; */
}

/* hover で操作感 */
.check-btn:hover .check-icon{
  background: #f8fafc;
}

/* =========================================
   フラグ追加／削除ボタン
   ========================================= */

.flag-add-btn,
.flag-delete-btn {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    color: #fff;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.flag-add-btn {
    background: linear-gradient(135deg, #3da9ff, #267dff);
}

.flag-add-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5abbff, #3d8dff);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.4);
}

.flag-add-btn:active:not(:disabled) {
    background: linear-gradient(135deg, #2c8be6, #1b6fe0);
    transform: translateY(1px);
}

.flag-add-btn:disabled {
    background: #aacbee;
    color: #eef5ff;
    cursor: not-allowed;
    box-shadow: none;
}

/* メンバー削除ボタン：黒背景・赤文字・赤縁（保存の緑と明確に区別） */
.member-delete-btn {
    margin-right: 8px;
    background: #111;
    color: #e02e2e;
    border: 1px solid #e02e2e;
    box-shadow: 0 3px 0 #7a1414;   /* btn-pill の緑影を上書き */
}
.member-delete-btn:hover:not(:disabled) {
    background: #1c1c1c;
    color: #ff4d4d;
    border-color: #ff4d4d;
    box-shadow: 0 4px 0 #5e0f0f;
    transform: translateY(-1px);
}
.member-delete-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 2px 0 #5e0f0f;
}
.member-delete-btn:disabled {
    background: #ccc;
    color: #888;
    border-color: #ccc;
    box-shadow: none;
}

.flag-delete-btn {
    margin-left: 6px;
    background: linear-gradient(135deg, #ff6262, #d64444);
}

.flag-delete-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff7a7a, #e55656);
}

.flag-delete-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.flag-delete-btn:disabled {
    background: #ccc;
    color: #888;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* 出欠がyes以外の時は「試合参加」ボタンを完全に消す */
.match-toggle.is-hidden {
  display: none !important;
}

/* =========================================================
   Match checkbox hide (keep table alignment)
   - Do NOT use display:none on <td> or button.
   - Keep column width so the comment column never shifts.
   ========================================================= */

/* 行が「試合参加を隠すべき」状態のとき（出欠が yes 以外） */
.participant-row.match-hidden td.match-cell,
.participant-row.match-hidden td.match-cell * {
  visibility: hidden;   /* 見えないが、スペースは維持 */
  pointer-events: none; /* クリック不可 */
}

/* ボタンだけに付ける場合（保険） */
.toggle-check.match-hidden,
.toggle-check.match-hidden * {
  visibility: hidden;
  pointer-events: none;
}

/* ===== 出席者リスト：カラムは中央ぞろえ ===== */
#participants-table th,
#participants-table td {
  text-align: center;
  vertical-align: middle;
}


/* セル内UIだけ中央 */
#participants-table .attendance-cell > *,
#participants-table .check-cell > *,
#participants-table .participant-index {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* コメント列：ボックスは中央、文字は左 */
#participants-table .comment-cell {
  text-align: center;   /* ボックスを中央 */
}

.comment-editable {
  text-align: left;     /* ← 中の文字だけ左寄せ */
}


/* ============================
   settings：メンバー管理テーブル
   ============================ */

/* テーブル自体は左詰め */
#members-table {
  margin-left: 0;
  margin-right: auto;
}

/* ヘッダ・セル内は中央寄せ */
#members-table th,
#members-table td {
  text-align: center;
  vertical-align: middle;
}

/* 名前セル内の span も中央に */
#members-table .member-name {
  display: inline-block;
  text-align: center;
}

/* 固定トグルの見た目安定 */
#members-table .check-btn {
  margin: 0 auto;
}

/* ============================
   settings：メンバー管理テーブルは左詰め
   （共通 .participants-table の margin:0 auto を上書き）
   ============================ */
#members-table.participants-table {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* セル内は中央寄せでOK */
#members-table.participants-table th,
#members-table.participants-table td {
  text-align: center;
  vertical-align: middle;
}

/* settings: メンバー管理は左詰め（テーブル自体を縮める） */
.members-admin-area{
  text-align: left; /* inline-table を左に寄せる */
}

#members-table.participants-table{
  width: fit-content !important;   /* ← これが効く */
  max-width: 100%;
  display: inline-table;          /* ← text-align に従って左に寄る */
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* カラム内は中央寄せでOK */
#members-table.participants-table th,
#members-table.participants-table td{
  text-align: center;
  vertical-align: middle;
}

/* settings：メンバー管理 名前カラムだけ左寄せ（ヘッダー除外） */
#members-table tbody td:nth-child(2) {
  text-align: left;
}


/* =====================================
   Event page: Flag (digit) input style
   ===================================== */

.flag-digit-input {
  border: none;                 /* 枠線を消す */
  background: #f2f3f5;          /* 薄いグレーで塗りつぶし */
  box-shadow: none;             /* 念のため影も消す */

  border-radius: 4px;           /* 角はほんのり（不要なら0でもOK） */
  text-align: center;

  padding: 4px 6px;
}

/* フォーカス時も枠を出さない */
.flag-digit-input:focus {
  outline: none;
  border: none;
  background: #e9ebee;          /* フォーカス時だけ少し濃く（任意） */
}

/* ============================
   settings：チーム分け/フラグもメンバー管理と同じ見栄えに揃える
   - テーブル自体：縮めて左寄せ（inline-table + text-align:left）
   - カラム内：中央寄せ
   ============================ */

/* wrappers を左寄せ基準にする */
.participants-wrap{
  text-align: left; /* inline-table を左に寄せる */
}

/* classes / flags table をメンバー管理と同じ挙動に */
#classes-table.participants-table,
#flags-table.participants-table{
  width: fit-content !important;   /* 中身幅に縮める */
  max-width: 100%;
  display: inline-table;           /* wrapper の text-align に従う */
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* セル内は中央寄せ */
#classes-table.participants-table th,
#classes-table.participants-table td,
#flags-table.participants-table th,
#flags-table.participants-table td{
  text-align: center;
  vertical-align: middle;
}
