/* index.css */
:root{
	--bg: #f7f8fb;
	--card-bg: #ffffff;
	--accent-a: #667eea;
	--accent-b: #764ba2;
	--muted: #bfbfc6;
	--border: #eef0f6;
	--text: #333333;
}

*{
	box-sizing: border-box;
}

html, body{
	height: 100%;
}

body{
	font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
	margin: 20px;
	background: var(--bg);
	color: var(--text);
	padding-top: 50px; /* ツールバーの高さ分の余白確保 */
}

/* wrapper: 左寄せで横並び、隙間は 20px */
.calendar-wrapper{
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;
	gap: 20px; /* カレンダー同士の隙間 */
	flex-wrap: nowrap;
}

/* カード（ヘッダ + table を包む） */
.calendar-card{
	background: var(--card-bg);
	border-radius: 12px;
	box-shadow: 0 6px 18px rgba(20,20,40,0.06);
	overflow: hidden;
	width: 360px; /* PCで横に広がりすぎない幅 */
}

/* ヘッダ */
.calendar-header{
	padding: 12px;
	text-align: center;
	font-weight: 700;
	font-size: 1.05rem;
	color: #fff;
	background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
}

/* カレンダーテーブル（7列均等） */
table.calendar{
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed; /* 列幅を均等にする */
}

/* 曜日セル */
table.calendar thead th{
	padding: 8px 6px;
	font-weight: 600;
	font-size: 0.92rem;
	background: #f4f6fb;
	color: #444;
	border-bottom: 1px solid var(--border);
}

/* 日付セル（比率: 縦高さ固定、横は7分割） */
table.calendar td{
	width: calc(100% / 7);
	padding: 6px 4px;
	text-align: center;
	height: 44px; /* デスクトップ時の縦サイズ（必要なら調整） */
	border: 1px solid #f0f1f6;
	cursor: pointer;
	transition: background .18s ease, color .18s ease;
	box-sizing: border-box;
}

/* 無効セル（前後の空セル） */
table.calendar td.inactive{
	color: var(--muted);
	cursor: default;
	background: transparent;
}

/* ホバー（有効セルのみ） */
table.calendar td:not(.inactive):hover{
	background: var(--accent-a);
	color: #fff;
	border-radius: 6px;
}

/* フォーカス用（キーボード操作対応） */
table.calendar td[role="button"]:focus{
	outline: 3px solid rgba(102,126,234,0.18);
	outline-offset: 2px;
	border-radius: 6px;
}

/* 今日のマーク */
table.calendar td.today{
	box-shadow: inset 0 0 0 2px rgba(118,75,162,0.08);
	border-radius: 6px;
}

/* レスポンシブ：狭い画面では縦並びにしてカード幅を100% */
@media (max-width: 768px){
	.calendar-wrapper{
		flex-direction: column;
		gap: 20px;
	}
	.calendar-card{
		width: 100%;
		max-width: none;
	}
	table.calendar td{
		height: 56px; /* タッチしやすい高さに */
	}
}

/* モーダル共通 */
.modal-overlay{
	position: fixed;   /* 画面にかぶさる */
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	visibility: hidden;
	z-index: 9999;
}

.modal{
	background: #fff;
	padding: 20px;
	border-radius: 12px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.2);
	width: 320px;
	max-width: 90%;
}

.modal h2{
	margin-top: 0;
	font-size: 1.2rem;
}

.modal input[type="text"]{
	width: 100%;
	padding: 8px;
	font-size: 1rem;
	margin-bottom: 6px;
	box-sizing: border-box;
}

.modal .error-message{
	color: red;
	font-size: 0.85rem;
	height: 18px; /* エラーの場所を確保 */
}

.modal button{
	margin-top: 10px;
	padding: 8px 12px;
	font-size: 1rem;
	cursor: pointer;
}

/* ツールバー */
#toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #333;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  font-size: 14px;
  z-index: 1000;
}

#toolbar a {
  color: #fff;
  text-decoration: none;
  margin-left: 5px;
}

#toolbar a:hover {
  text-decoration: underline;
}

.toolbar-left {
  display: flex;
  align-items: center;
}

.toolbar-right {
  display: flex;
  align-items: center;
}


/* 予約可能日ハイライト */
.calendar td.active-date{
	background-color: #ffeb3b; /* 黄色で目立たせる */
	color: #000;
	border-radius: 6px;
	cursor: pointer;
}

.calendar td.active-date:hover{
	background-color: #ffc107;
}
