/* リセットとグローバルスタイル */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Roboto', 'Noto Sans JP', sans-serif;
}

body {
	background-color: #f8f9fa;
	color: #333;
	overflow: hidden;
	height: 100vh;
}

/* ヘッダー */
header {
	background-color: #000000;
	color: white;
	padding: 0 20px;
	height: 60px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	position: relative;
	z-index: 10;
}

.app-title {
	font-family: 'Impact', 'Anton', 'Bebas Neue', sans-serif;
	font-weight: bold;
	font-size: 1.8rem;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.play-controls {
	display: flex;
	align-items: center;
	background-color: #333333;
	padding: 5px 15px;
	border-radius: 30px;
}

.control-btn {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background-color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 10px;
	cursor: pointer;
	position: relative;
	transition: transform 0.1s;
}

.control-btn:hover {
	transform: scale(1.1);
}

.control-btn:active {
	transform: scale(0.95);
}

.play-icon {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent #000000;
	margin-left: 3px;
}

.pause-icon {
	display: flex;
}

.pause-icon span {
	width: 4px;
	height: 14px;
	background-color: #000000;
	margin: 0 2px;
}

.stop-icon {
	width: 12px;
	height: 12px;
	background-color: #000000;
}

.time-display {
	color: white;
	font-size: 1rem;
	margin-left: 10px;
	font-family: 'Courier New', monospace;
	font-weight: bold;
}

.user-icon {
	width: 40px;
	height: 40px;
	background-color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #000000;
	font-weight: bold;
	cursor: pointer;
	transition: transform 0.2s;
}

.user-icon:hover {
	transform: scale(1.1);
}

/* メインレイアウト */
.main-container {
	display: flex;
	height: calc(100vh - 60px);
}

/* サイドバー共通スタイル */
.sidebar {
	background-color: white;
	width: 250px;
	height: 100%;
	overflow-y: auto;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
	background-color: #f0f0f0;
	padding: 15px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #e0e0e0;
}

.sidebar-title {
	font-size: 18px;
	font-weight: bold;
}

.add-btn {
	width: 30px;
	height: 30px;
	background-color: #000000;
	color: white;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	cursor: pointer;
	line-height: 1;
	transition: transform 0.2s;
}

.add-btn:hover {
	transform: scale(1.1);
}

/* ダンサーサイドバー */
.dancer-list {
	padding: 15px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* ドラッグ元のダンサーをアニメーション無効に */
.dancer-item {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: bold;
	cursor: move;
	transition: transform 0.2s; /* ドラッグ中は不要なアニメーションを削除 */
	user-select: none;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	z-index: 5;
}

.dancer-item:hover {
	transform: scale(1.1);
}

/* ドラッグ中のダンサーを最前面に表示 */
.dancer-item.dragging {
	z-index: 1000 !important;
	opacity: 0.8;
	transform: scale(1.1);
}

/* ステージエリア */
.stage-container {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
}

.stage-settings {
	background-color: white;
	padding: 15px;
	border-radius: 5px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.setting-label {
	margin-right: 15px;
	font-weight: bold;
}

.dimension-input {
	width: 100px;
	padding: 5px 10px;
	border: 2px solid #000000;
	border-radius: 5px;
	margin-right: 15px;
	text-align: center;
}

.apply-btn, .edit-background-btn {
	padding: 5px 15px;
	background-color: #000000;
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	transition: background-color 0.2s;
	margin-right: 10px;
}

.apply-btn:hover, .edit-background-btn:hover {
	background-color: #333333;
}

.edit-background-btn.active {
	background-color: #e74c3c;
}

.edit-background-btn.active:hover {
	background-color: #c0392b;
}

.stage-area {
	background-color: white;
	border-radius: 5px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	height: calc(100% - 70px);
	position: relative;
	overflow: hidden;
}

.center-line {
	position: absolute;
	left: 0;
	top: 50%;
	width: 100%;
	height: 1px;
	background-color: #e0e0e0;
	border-top: 1px dashed #ccc;
	z-index: 2;
}

.middle-line {
	position: absolute;
	top: 0;
	left: 50%;
	height: 100%;
	width: 1px;
	background-color: #e0e0e0;
	border-left: 1px dashed #ccc;
	z-index: 2;
}

.stage-label {
	position: absolute;
	top: -20px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 12px;
	color: #999;
	z-index: 2;
}

/* キャンバス関連スタイル */
.stage-canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1; /* ガイドラインの下、ダンサーの下 */
}

.scene-canvas {
	display: none; /* 初期状態では非表示 */
	z-index: 2; /* メインキャンバスの上 */
}

.drawing-tools {
	position: absolute;
	top: 70px;
	right: 20px;
	background-color: white;
	border-radius: 5px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	padding: 15px;
	z-index: 50;
	transition: all 0.3s ease;
}

.drawing-tool-group {
	margin-bottom: 10px;
	display: flex;
	align-items: center;
}

.drawing-tool-group label {
	margin-right: 10px;
	font-weight: bold;
	min-width: 80px;
}

.drawing-tool-group button {
	padding: 5px 10px;
	margin-right: 5px;
	background-color: #f8f9fa;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
}

.drawing-tool-group button:hover {
	background-color: #e9ecef;
}

#clearCanvasBtn {
	color: #e74c3c;
	border-color: #e74c3c;
}

#clearCanvasBtn:hover {
	background-color: #e74c3c;
	color: white;
}

#saveDrawingBtn {
	color: #2ecc71;
	border-color: #2ecc71;
}

#saveDrawingBtn:hover {
	background-color: #2ecc71;
	color: white;
}

.drawing-mode-info {
	margin-top: 10px;
	font-size: 12px;
	color: #666;
	text-align: center;
	padding: 5px;
	background-color: #f8f9fa;
	border-radius: 4px;
}

/* シーンキャンバスモード時のスタイル */
.drawing-tools.scene-mode {
	background-color: #f0f8ff; /* 薄い青色の背景 */
}

.drawing-tools.scene-mode .drawing-mode-info {
	background-color: #e6f2ff;
	color: #0066cc;
}

/* シーンサイドバー */
.scene-list {
	padding: 15px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.scene-item {
	background-color: white;
	border: 2px solid #e0e0e0;
	border-radius: 5px;
	padding: 10px;
	cursor: pointer;
	transition: all 0.2s;
}

.scene-item:hover {
	transform: translateX(-5px);
	box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.scene-item.active {
	background-color: #000000;
	color: white;
	border-color: #000000;
}

.scene-title {
	font-weight: bold;
	margin-bottom: 5px;
}

.scene-time {
	font-size: 12px;
	color: #666;
}

.scene-item.active .scene-time {
	color: rgba(255, 255, 255, 0.8);
}

.save-btn {
	margin-top: auto;
	background-color: #000000;
	color: white;
	border: none;
	border-radius: 30px;
	padding: 12px;
	font-size: 16px;
	font-weight: bold;
	cursor: pointer;
	transition: transform 0.2s, background-color 0.2s;
	margin: 20px 15px;
}

.save-btn:hover {
	background-color: #333333;
	transform: translateY(-2px);
}

.save-btn:active {
	transform: translateY(1px);
}

/* ステージ上のダンサーのz-indexを調整 */
.stage-dancer {
	position: absolute;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: bold;
	cursor: move;
	z-index: 10; /* ステージ上のダンサーのz-indexを上げる */
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	/* デフォルトでは即時変更 */
	transition: transform 0.2s ease;
}

.stage-dancer:hover {
	z-index: 15;
	transform: scale(1.1);
}

.stage-dancer.dragging {
	z-index: 1000 !important;
	opacity: 0.8;
}

/* 再生中のアニメーション */
.stage-dancer.animating {
	transition: left 0.3s linear, top 0.3s linear;
}

/* シーン切り替え時のアニメーション */
.stage-dancer.transition {
	transition: left 0.5s ease-in-out, top 0.5s ease-in-out !important; /* !important で確実に適用 */
}


/* ユーティリティクラス */
.hidden {
	display: none !important;
}

.disabled {
	opacity: 0.5;
	pointer-events: none;
}