/* === 全体のスタイル === */
body {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background-color: #f0f0f0;
  color: #222;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* === ナビゲーションバー === */
nav {
  background-color: #111;
  color: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 20px;
  font-weight: bold;
  background-color: #333;
  padding: 8px 14px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

nav a:hover {
  background-color: #555;
}

/* === テーブル === */
table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 20px;
  background-color: white;
}

th, td {
  border: 1px solid #ccc;
  padding: 12px;
  text-align: center;
  vertical-align: middle;
}

th {
  background-color: #eee;
  font-weight: bold;
}

/* === イベント一覧テーブル（Excel風） === */
.events-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* 列幅を決めやすくする */
  background-color: #fff;
  font-size: 14px;
}

.events-table th,
.events-table td {
  border: 1px solid #ccc;
  padding: 8px 10px;
  text-align: left;        /* Excel っぽく左寄せ */
  vertical-align: middle;
}

/* ヘッダー */
.events-table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

/* ゼブラ＋ホバーで見やすく */
.events-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.events-table tbody tr:hover {
  background-color: #fff8e1;
}

/* 各列の幅調整（ID・種類・タイトル・日付・メモ） */
.events-table .col-id {
  width: 60px;
  text-align: right;
}

.events-table .col-kind {
  width: 100px;
}

.events-table .col-title {
  width: 340px;
}

.events-table .col-date {
  width: 140px;
  white-space: nowrap;
}

.events-table .col-memo {
  width: 260px;
}

.events-table th.sortable {
  cursor: pointer;
  user-select: none; /* クリックしても文字選択されにくくする */
}

/* === イベント検索フォーム === */
.events-search-form {
  margin-top: 20px;
  margin-bottom: 10px;
  background-color: #fff;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.events-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.events-search-item label {
  font-size: 14px;
}

.events-search-item input[type="text"] {
  padding: 4px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.events-search-item button {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #888;
  background-color: #f5f5f5;
  cursor: pointer;
}

.events-search-item button:hover {
  background-color: #e0e0e0;
}

.events-search-clear {
  margin-left: 8px;
  font-size: 13px;
  text-decoration: none;
  color: #666;
}

.events-search-clear:hover {
  text-decoration: underline;
}

/* === イベント一覧ヘッダーのボタン === */
.events-header-actions {
  margin-top: 8px;
  margin-bottom: 6px;
  text-align: right;
}

.btn-primary {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  background-color: #1976d2;
  color: #fff;
  text-decoration: none;
  border: 1px solid #115293;
}

.btn-primary:hover {
  background-color: #1565c0;
}

/* === イベント新規作成フォーム === */
.event-form {
  margin-top: 20px;
  background-color: #fff;
  padding: 20px;
  border-radius: 6px;
  border: 1px solid #ddd;
  max-width: 900px;       /* 画面いっぱいじゃなくてちょっと細く */
  margin: 20px auto;      /* 左右中央寄せ */
}

.event-form .form-row {
  margin-bottom: 16px;
}

.event-form label {
  display: block;
  font-size: 14px;
}

.event-form input[type="text"],
.event-form input[type="date"],
.event-form select,
.event-form textarea {
  flex: 1;
  width: 100%;
  max-width: 400px;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.event-form textarea {
  resize: vertical;
}

.form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

.form-actions {
  margin-top: 20px;
  margin-left: 140px;  /* ラベルと同じ幅だけ右に寄せる */
  display: flex;
  gap: 10px;
}

.form-actions button,
.form-actions .btn-secondary {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #888;
  background-color: #f5f5f5;
  text-decoration: none;
  color: #222;
  cursor: pointer;
}

.form-actions button:hover,
.form-actions .btn-secondary:hover {
  background-color: #e0e0e0;
}

.form-error {
  margin-top: 12px;
  padding: 8px 12px;
  background-color: #ffe0e0;
  border: 1px solid #ff9999;
  border-radius: 4px;
  color: #b00000;
  font-size: 13px;
}

.event-form .form-row-label {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 16px;
}

/* 左側のラベル部分 */
.form-label-text {
  display: inline-block;
  width: 140px;          /* 全項目でラベル幅をそろえる */
  font-size: 14px;
  font-weight: bold;
  padding-top: 6px;      /* 入力欄の高さといい感じに揃えるため */
}

.form-field-with-help .form-help {
  margin-top: 4px;
}

.btn-secondary {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #888;
  background-color: #f5f5f5;
  text-decoration: none;
  color: #222;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #e0e0e0;
}

.events-header-actions a + a {
  margin-left: 8px;
}

/* === 削除モード === */
#delete-bar {
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 6px;
  padding: 10px 14px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
}

#delete-count-label {
  font-size: 14px;
  font-weight: bold;
  color: #555;
  min-width: 80px;
}

.btn-danger {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #c62828;
  background-color: #fff;
  color: #c62828;
  cursor: pointer;
  text-decoration: none;
}

.btn-danger:hover {
  background-color: #fdecea;
}

.btn-danger-solid {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  border: none;
  background-color: #d32f2f;
  color: #fff;
  cursor: pointer;
}

.btn-danger-solid:disabled {
  background-color: #e57373;
  cursor: not-allowed;
}

.btn-danger-solid:not(:disabled):hover {
  background-color: #b71c1c;
}

.btn-cancel {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #888;
  background-color: #f5f5f5;
  color: #222;
  cursor: pointer;
}

.btn-cancel:hover {
  background-color: #e0e0e0;
}

/* チェックボックスのセル */
.col-check {
  width: 36px;
  text-align: center !important;
}

/* 選択中の行をハイライト */
.events-table tbody tr.row-selected {
  background-color: #fdecea !important;
}
