body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	margin: 0;
	background-color: #f4f7f6;
	color: #333;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
header {
	background-color: #5cb85c;
	color: white;
	padding: 15px 25px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	flex-shrink: 0;
}
header h1 {
	margin: 0;
	font-size: 24px;
	}
.search-add {
	display: flex;
	align-items: center;
}
.search-bar {
	padding: 8px 12px;
	border: none;
	border-radius: 5px;
	margin-right: 15px;
	width: 250px;
	font-size: 16px;
}
.add-button {
	background-color: #4CAF50;
	color: white;
	padding: 10px 20px;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 16px;
	transition: background-color 0.3s ease;
}
.add-button:hover {
	background-color: #45a049;
}

/* 共通ボタンとタグのスタイル */
.card-button, .action-button, .form-button {
	padding: 8px 12px;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	transition: background-color 0.3s ease;
}
.card-button.view, .action-button.edit {
	background-color: #2196f3;
	color: white;
}
.card-button.view:hover, .action-button.edit:hover {
	background-color: #1976d2;
}
/* 印刷ボタンのスタイル */
.card-button.print-button, .action-button.print-button {
	background-color: #f44336; /* 赤色を流用 */
	color: white;
}
.card-button.print-button:hover, .action-button.print-button:hover {
	background-color: #d32f2f;
}
.action-button.delete {
	background-color: #dc3545;
	color: white;
}
.action-button.delete:hover {
	background-color: #c82333;
}
.form-button.submit {
	background-color: #4CAF50;
	color: white;
	padding: 10px 20px;
}
.form-button.submit:hover {
	background-color: #45a049;
}
.form-button.cancel {
	background-color: #9e9e9e;
	color: white;
	padding: 10px 20px;
}
.form-button.cancel:hover {
	background-color: #757575;
}
.tag {
	display: inline-block;
	background-color: #e0f2f7;
	color: #2196f3;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	margin-right: 5px;
	margin-bottom: 5px;
}

/* 活動一覧画面のスタイル */
.container {
	display: flex;
	flex: 1;
	padding: 25px;
	gap: 25px;
}
.sidebar {
	width: 250px;
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	padding: 20px;
	flex-shrink: 0;
}
.sidebar h3 {
	color: #5cb85c;
	margin-top: 0;
	margin-bottom: 15px;
	border-bottom: 1px solid #eee;
	padding-bottom: 10px;
}
.filter-group {
	margin-bottom: 20px;
}
.filter-group h4 {
	margin-top: 0;
	margin-bottom: 10px;
	color: #555;
	font-size: 16px;
}
.filter-group label {
	display: block;
	margin-bottom: 8px;
	cursor: pointer;
	font-size: 14px;
}
.filter-group input[type="radio"],
.filter-group input[type="checkbox"] {
	margin-right: 8px;
}
.activity-list {
	flex-grow: 1;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	align-content: start;
}
.activity-card {
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 8px rgba(0,0,0,0.08);
	padding: 20px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.activity-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}
.activity-card h4 {
	color: #333;
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 18px;
}
.activity-card p {
	font-size: 14px;
	color: #666;
	margin-bottom: 5px;
}
.activity-card .steam-tags {
	margin-top: 10px;
	margin-bottom: 15px;
}
.activity-card img,.activity-card video {
	max-width: 90%; /* 親要素の幅に合わせて縮小 */
	max-height: 90%; /* 親要素の高さに合わせて縮小 */
	object-fit: contain; /* アスペクト比を維持して収まるように */ }

.card-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: auto;
}

/* 活動詳細画面のスタイル */
.detail-header {
	background-color: #5cb85c;
	color: white;
	padding: 15px 25px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	flex-shrink: 0;
}
.detail-header .back-button {
	background-color: #007bff;
	color: white;
	padding: 10px 15px;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 15px;
	transition: background-color 0.3s ease;
	text-decoration: none;
	display: inline-block;
}
.detail-header .back-button:hover {
	background-color: #0056b3;
}
.detail-container {
	flex: 1;
	padding: 25px;
	display: flex;
	justify-content: center;
	align-items: flex-start;
}
.activity-detail-card, .activity-form-card {
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.1);
	padding: 30px;
	width: 100%;
	max-width: 800px; /* 詳細画面の最大幅を調整 */
}
.activity-detail-card h2, .activity-form-card h2 {
	color: #5cb85c;
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 28px;
	border-bottom: 2px solid #eee;
	padding-bottom: 10px;
}
.detail-item {
	margin-bottom: 15px;
}
.detail-item strong {
	display: block;
	margin-bottom: 5px;
	color: #555;
	font-size: 16px;
}
.detail-item p, .detail-item ul, .detail-item ol {
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 5px 0;
	padding-left: 20px;
}
.detail-item ul li, .detail-item ol li {
	margin-bottom: 5px;
}
.detail-actions {
	display: flex;
	justify-content: flex-end; /* 右寄せ維持 */
	gap: 8px; /* ボタン間のギャップを維持 */
	margin-top: 30px;
	border-top: 1px solid #eee;
	padding-top: 20px;
	padding-right: 40px; /* 右側に追加のパディングを入れて全体を左に寄せる */
	flex-wrap: wrap; /* 必要に応じてボタンを折り返す */
}
.detail-actions .action-button {
	min-width: 80px; 
}

/* 新規活動追加・編集フォームのスタイル */
.form-group {
	margin-bottom: 20px;
}
.form-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: #555;
}
.form-group input[type="text"],
.form-group textarea,
.form-group select {
	width: calc(100% - 24px); /* Padding 고려 */
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 16px;
	box-sizing: border-box; /* Paddingを幅に含める */
}
.form-group textarea {
	min-height: 80px;
	resize: vertical;
}
.form-group .checkbox-group label {
	display: inline-block;
	margin-right: 15px;
	font-weight: normal;
}
.form-group .photo-preview-container {
	margin-top: 10px;
	border: 1px dashed #ccc;
	padding: 10px;
	text-align: center;
	min-height: 100px;
	display: flex;
	flex-wrap: wrap; /* 複数の写真プレビューを折り返す */
	gap: 10px; /* プレビュー間のスペース */
	align-items: center; /* 中央揃え */
	justify-content: center; /* 中央揃え */
}
.form-group .photo-preview-item {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: calc(50% - 5px); /* 1行に2枚表示、ギャップ考慮 */
	max-width: 200px; /* 各プレビューの最大幅 */
	height: 150px; /* 固定高さを設定 */
	overflow: hidden; /* はみ出しを隠す */
	border: 1px solid #ddd;
	border-radius: 5px;
	background-color: #f9f9f9;
}
.form-group .photo-preview-item img {
	max-width: 90%; /* 親要素の幅に合わせて縮小 */
	max-height: 90%; /* 親要素の高さに合わせて縮小 */
	object-fit: contain; /* アスペクト比を維持して収まるように */
	display: block;
}
.form-group .photo-preview-item .remove-photo-button {
	position: absolute;
	top: 5px;
	right: 5px;
	background-color: rgba(255, 0, 0, 0.7);
	color: white;
	border: none;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
}
.form-group .photo-preview-container p.no-photo-message {
	width: 100%;
	text-align: center;
	color: #777;
	font-style: italic;
}

.form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 15px;
	margin-top: 30px;
	border-top: 1px solid #eee;
	padding-top: 20px;
}

footer {
	background-color: #333;
	color: white;
	text-align: center;
	padding: 15px 0;
	font-size: 14px;
	margin-top: 20px;
	flex-shrink: 0;
}

/* 画面切り替えのためのスタイル */
.hidden {
	display: none !important;
}

/* PDF出力時のスタイル調整（@media print） */
@media print {
	/* PDFページ全体のマージンをリセット */
	@page {
		margin: 0 !important;
		padding: 0 !important;
	}
	html, body {
		margin: 0 !important;
		padding: 0 !important;
		width: 100% !important;
		height: auto !important;
		overflow: visible !important; /* スクロールバーが表示されないように */
	}

	body > *:not(#detail-screen) { /* 詳細画面コンテナ以外を非表示 */
		display: none !important;
	}
	#detail-screen {
		display: block !important;
		position: absolute; /* 印刷時にレイアウトを制御しやすく */
		top: 0;
		left: 0;
		width: 100% !important;
		height: auto; /* コンテンツに合わせて高さを自動調整 */
		margin: 0 !important; /* 詳細画面コンテナのマージンをリセット */
		padding: 0 !important; /* 詳細画面コンテナのパディングをリセット */
		box-shadow: none; /* 影を消す */
		background-color: white;
		overflow: visible !important; /* コンテンツがはみ出しても表示 */
	}
	/* ヘッダー、フッター、**アクションボタン**をPDF出力時に表示しない */
	#detail-screen header, 
	#detail-screen footer, 
	#detail-screen .detail-actions {
		display: none !important; /* PDF出力時にこの部分は含まれないようにする */
	}
	/* 印刷対象のカードのスタイル調整 */
	.activity-detail-card {
		box-shadow: none;
		border-radius: 0;
		/* PDF出力時の余白 */
		padding: 10mm 20mm 20mm 20mm !important; /* 上10mm、左右下20mmの余白 */
		max-width: none;
		width: auto;
		margin: 0 !important; /* 中央寄せ解除 */
		box-sizing: border-box; /* paddingを含めた幅・高さ計算 */
	}
	/* 各詳細項目（教材・環境構成レイアウトなど）のマージンを調整 */
	.detail-item {
		margin-top: 0 !important; /* 各セクションの上部マージンを詰める */
		margin-bottom: 5mm !important; /* PDFでの項目間の余白を小さく */
		padding: 0 !important; /* パディングも削除 */
	}
	/* リスト項目のマージン調整 */
	.detail-item p, .detail-item ul, .detail-item ol {
		padding-left: 0;
		margin-top: 0 !important; /* リスト上部のマージンを削除 */
		margin-bottom: 0 !important; /* リスト下部のマージンを削除 */
	}
	.detail-item ul li, .detail-item ol li {
		margin-bottom: 2mm; /* リストアイテム間のスペース */
	}
	/* 見出しのマージン調整 */
	.detail-item strong {
		font-size: 16px !important; /* 印刷時に見出しサイズを調整 */
		margin-top: 0 !important; /* 見出し上部のマージンを詰める */
		margin-bottom: 2mm !important; /* 見出し下部のマージン */
	}
	/* 教材・環境構成レイアウトの画像をPDFで適切に表示するための調整 */
	.environment-photo-section {
		display: flex; /* 写真を横並びに */
		flex-wrap: wrap; /* 折り返し */
		gap: 5mm; /* PDFでの写真間のギャップ */
		justify-content: center;
		margin-top: 5mm !important; /* 上部のスペースを詰める */
		align-items: flex-start; /* 写真を上部に詰める */
	}
	.environment-photo-section img {
		max-width: calc(50% - 2.5mm) !important; /* 1行に2枚、ギャップ考慮 */
		height: auto !important;
		display: block;
		margin: 0 !important; /* PDF出力時の画像マージンを削除 */
		page-break-inside: avoid; /* 画像の途中で改ページされないようにする */
		object-fit: contain; /* アスペクト比を維持して収まるように */
	}
	/* 関連URLリストの調整 */
	.related-urls-section ul {
		list-style-type: none; /* ドットを消す */
		padding-left: 0;
	}
	.related-urls-section ul li a {
		text-decoration: none; /* 下線を消す */
		color: #000; /* 黒字にする */
		word-break: break-all; /* URLが長い場合に改行 */
	}
	/* h2 (活動名) の直前のスペースをなくすための調整 */
	#printable-area h2 {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}
}

.pic_frame {
	display: inline-block;
	text-align: center;
}