/* リセットCSS */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	line-height: 1.6;
	color: #333;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

/* ヘッダー */
.header {
	text-align: center;
	margin-bottom: 30px;
	color: white;
}

.header h1 {
	font-size: 2.5rem;
	margin-bottom: 10px;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
	font-size: 1.1rem;
	opacity: 0.9;
}

/* コントロール部分 */
.controls {
	background: white;
	padding: 20px;
	border-radius: 15px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	margin-bottom: 30px;
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: center;
	justify-content: space-between;
}

.filter-section,
.sort-section,
.search-section {
	display: flex;
	align-items: center;
	gap: 10px;
}

.filter-section label,
.sort-section label {
	font-weight: 600;
	color: #555;
}

select,
input[type="text"] {
	padding: 8px 12px;
	border: 2px solid #e1e5e9;
	border-radius: 8px;
	font-size: 14px;
	transition: border-color 0.3s ease;
}

select:focus,
input[type="text"]:focus {
	outline: none;
	border-color: #667eea;
}

#search-btn {
	background: #667eea;
	color: white;
	border: none;
	padding: 8px 12px;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.3s ease;
}

#search-btn:hover {
	background: #5a6fd8;
}

/* スレッド作成フォーム */
.thread-form {
	background: white;
	padding: 25px;
	border-radius: 15px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	margin-bottom: 30px;
}

.thread-form h3 {
	margin-bottom: 20px;
	color: #333;
	font-size: 1.3rem;
}

/* レス投稿フォーム */
.reply-form {
	background: white;
	padding: 25px;
	border-radius: 15px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	margin-bottom: 30px;
}

.reply-form h3 {
	margin-bottom: 20px;
	color: #333;
	font-size: 1.3rem;
}

.thread-info {
	background: #f8f9fa;
	padding: 10px 15px;
	border-radius: 8px;
	margin-bottom: 20px;
	border-left: 4px solid #667eea;
}

.thread-info span {
	font-weight: 600;
	color: #333;
}

.form-actions {
	display: flex;
	gap: 10px;
	align-items: center;
}

.cancel-btn {
	background: #95a5a6;
	color: white;
	border: none;
	padding: 12px 25px;
	border-radius: 8px;
	font-size: 16px;
	cursor: pointer;
	transition: background 0.3s ease;
}

.cancel-btn:hover {
	background: #7f8c8d;
}

.form-group {
	margin-bottom: 15px;
}

.form-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 10px;
	border: 2px solid #e1e5e9;
	border-radius: 8px;
	font-size: 14px;
	transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: #667eea;
}

.form-group textarea {
	resize: vertical;
	min-height: 100px;
}

.submit-btn {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	padding: 12px 25px;
	border-radius: 8px;
	font-size: 16px;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* スレッド一覧 */
.threads-container {
	background: white;
	border-radius: 15px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.threads-header {
	background: #f8f9fa;
	padding: 20px;
	border-bottom: 1px solid #e1e5e9;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.threads-header h3 {
	color: #333;
	font-size: 1.3rem;
}

.threads-count {
	color: #666;
	font-size: 14px;
}

.threads-list {
	padding: 20px;
}

/* スレッド詳細 */
.thread-detail {
	background: white;
	border-radius: 15px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.thread-detail-header {
	background: #f8f9fa;
	padding: 20px;
	border-bottom: 1px solid #e1e5e9;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.thread-detail-header h3 {
	color: #333;
	font-size: 1.3rem;
	margin: 0;
}

.back-btn {
	background: #667eea;
	color: white;
	border: none;
	padding: 8px 15px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.3s ease;
	font-size: 14px;
}

.back-btn:hover {
	background: #5a6fd8;
}

.thread-stats {
	color: #666;
	font-size: 14px;
}

.thread-posts {
	padding: 20px;
}

/* スレッドカード */
.thread-card {
	border: 1px solid #e1e5e9;
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	background: #fafafa;
	cursor: pointer;
}

.thread-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 投稿カード（スレッド詳細内） */
.post-card {
	border: 1px solid #e1e5e9;
	border-radius: 8px;
	padding: 15px;
	margin-bottom: 15px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	background: #fafafa;
	position: relative;
}

.post-card:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* レス番号 */
.post-number {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #667eea;
	color: white;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
}

/* 階層表示 */
.post-card.reply {
	margin-left: 30px;
	border-left: 3px solid #667eea;
	background: #f8f9fa;
}

.post-card.reply-2 {
	margin-left: 60px;
	border-left: 3px solid #f39c12;
}

.post-card.reply-3 {
	margin-left: 90px;
	border-left: 3px solid #e74c3c;
}

.post-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 15px;
}

.post-title {
	font-size: 1.2rem;
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
}

.post-meta {
	display: flex;
	gap: 15px;
	font-size: 14px;
	color: #666;
	flex-wrap: wrap;
}

.post-category {
	background: #667eea;
	color: white;
	padding: 4px 8px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 500;
}

.post-content {
	color: #555;
	line-height: 1.6;
	margin-bottom: 15px;
}

.post-actions {
	display: flex;
	gap: 10px;
	align-items: center;
}

.like-btn,
.delete-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 5px 10px;
	border-radius: 6px;
	transition: background 0.2s ease;
	font-size: 14px;
}

.like-btn {
	color: #e74c3c;
}

.like-btn:hover {
	background: #ffeaea;
}

.like-btn.liked {
	color: #c0392b;
	font-weight: 600;
}

.delete-btn {
	color: #95a5a6;
}

.delete-btn:hover {
	background: #f8f9fa;
	color: #e74c3c;
}

.like-count {
	font-size: 14px;
	color: #666;
	margin-left: 5px;
}

/* カテゴリ別の色分け */
.post-card[data-category="general"] .post-category {
	background: #95a5a6;
}

.post-card[data-category="tech"] .post-category {
	background: #3498db;
}

.post-card[data-category="news"] .post-category {
	background: #e74c3c;
}

.post-card[data-category="fun"] .post-category {
	background: #f39c12;
}

.post-card[data-category="help"] .post-category {
	background: #27ae60;
}

/* ユーザー情報表示 */
.user-info {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-top: 15px;
	padding: 10px 20px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	backdrop-filter: blur(10px);
}

.user-info span {
	color: white;
	font-weight: 600;
}

.logout-btn {
	background: rgba(255, 255, 255, 0.2);
	color: white;
	border: 1px solid rgba(255, 255, 255, 0.3);
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 14px;
}

.logout-btn:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: translateY(-1px);
}

/* 認証ボタン */
.auth-buttons {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-bottom: 20px;
}

.auth-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	transition: all 0.3s ease;
}

.login-btn {
	background: #3498db;
	color: white;
}

.login-btn:hover {
	background: #2980b9;
	transform: translateY(-2px);
}

.register-btn {
	background: #27ae60;
	color: white;
}

.register-btn:hover {
	background: #229954;
	transform: translateY(-2px);
}

/* モーダル */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-content {
	background: white;
	border-radius: 15px;
	max-width: 500px;
	width: 90%;
	max-height: 80vh;
	overflow-y: auto;
}

.modal-header {
	padding: 20px;
	border-bottom: 1px solid #e1e5e9;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header h3 {
	margin: 0;
	color: #333;
}

.close-btn {
	background: none;
	border: none;
	font-size: 20px;
	cursor: pointer;
	color: #666;
}

.close-btn:hover {
	color: #333;
}

.modal-body {
	padding: 20px;
}

/* 認証モーダル */
.auth-modal-content {
	max-width: 400px;
	width: 90%;
}

.auth-tabs {
	display: flex;
	margin-bottom: 20px;
	border-bottom: 2px solid #e1e5e9;
}

.auth-tab {
	flex: 1;
	padding: 12px 20px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	color: #666;
	transition: all 0.3s ease;
	border-bottom: 3px solid transparent;
}

.auth-tab.active {
	color: #667eea;
	border-bottom-color: #667eea;
}

.auth-tab:hover {
	color: #667eea;
	background: #f8f9fa;
}

.auth-form {
	animation: fadeIn 0.3s ease;
}

/* メール認証フォーム */
.verification-info {
	text-align: center;
	margin-bottom: 25px;
	padding: 20px;
	background: #e3f2fd;
	border-radius: 10px;
	border-left: 4px solid #2196f3;
}

.verification-info i {
	font-size: 2rem;
	color: #2196f3;
	margin-bottom: 10px;
}

.verification-info h4 {
	margin: 10px 0;
	color: #333;
	font-size: 1.2rem;
}

.verification-info p {
	color: #666;
	line-height: 1.5;
	margin: 0;
}

.form-actions {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 20px;
}

.resend-btn {
	background: #ff9800;
	color: white;
	border: none;
	padding: 12px 20px;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 14px;
}

.resend-btn:hover {
	background: #f57c00;
	transform: translateY(-1px);
}

.resend-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
}

/* パスワード強度表示 */
.password-strength {
	margin-top: 5px;
	font-size: 12px;
}

.password-strength.weak {
	color: #e74c3c;
}

.password-strength.medium {
	color: #f39c12;
}

.password-strength.strong {
	color: #27ae60;
}

/* エラーメッセージ */
.error-message {
	background: #f8d7da;
	color: #721c24;
	padding: 10px;
	border-radius: 6px;
	margin-bottom: 15px;
	border: 1px solid #f5c6cb;
}

.success-message {
	background: #d4edda;
	color: #155724;
	padding: 10px;
	border-radius: 6px;
	margin-bottom: 15px;
	border: 1px solid #c3e6cb;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
	.container {
		padding: 10px;
	}

	.auth-buttons {
		flex-direction: column;
		align-items: center;
	}

	.auth-btn {
		width: 200px;
	}

	.user-info {
		flex-direction: column;
		gap: 10px;
		text-align: center;
	}

	.header h1 {
		font-size: 2rem;
	}

	.controls {
		flex-direction: column;
		align-items: stretch;
	}

	.filter-section,
	.sort-section,
	.search-section {
		justify-content: space-between;
	}

	.post-header {
		flex-direction: column;
		gap: 10px;
	}

	.post-meta {
		flex-direction: column;
		gap: 5px;
	}

	.threads-header,
	.thread-detail-header {
		flex-direction: column;
		gap: 10px;
		text-align: center;
	}

	.post-card.reply,
	.post-card.reply-2,
	.post-card.reply-3 {
		margin-left: 15px;
	}
}

@media (max-width: 480px) {
	.header h1 {
		font-size: 1.5rem;
	}

	.thread-form,
	.reply-form,
	.threads-container,
	.thread-detail {
		margin: 0 -5px;
		border-radius: 10px;
	}

	.post-card {
		padding: 15px;
	}
}

/* アニメーション */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.post-card {
	animation: fadeIn 0.3s ease;
}

/* 空の状態 */
.empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #666;
}

.empty-state i {
	font-size: 3rem;
	margin-bottom: 15px;
	color: #bdc3c7;
}

.empty-state h3 {
	margin-bottom: 10px;
	color: #555;
}

/* ローディング状態 */
.loading {
	text-align: center;
	padding: 20px;
	color: #666;
}

.loading i {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}
