/* LivePortrait Frontend Styles */

.liveportrait-container {
	max-width: 1200px;
	margin: 20px auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.liveportrait-header {
	text-align: center;
	margin-bottom: 30px;
	border-bottom: 2px solid rgba(0, 0, 0, 0.1);
	padding-bottom: 20px;
}

.liveportrait-header h2 {
	color: #23282d;
	margin: 0 0 10px 0;
	font-size: 28px;
}

.liveportrait-header p {
	color: #666;
	margin: 0;
	font-size: 14px;
	font-weight: 500;
}

.liveportrait-content {
	background: white;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Canvas Wrapper and Containers */
.liveportrait-canvas-wrapper {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 30px;
}

.liveportrait-canvas-container {
	position: relative;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 3/4;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.liveportrait-canvas-container canvas {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
}

.liveportrait-canvas-label {
	position: absolute;
	bottom: 10px;
	left: 10px;
	background: rgba(0, 0, 0, 0.6);
	color: white;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Controls Section */
.liveportrait-controls {
	background: #f9f9f9;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.liveportrait-status {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
	font-size: 14px;
	font-weight: 600;
	color: #23282d;
}

.liveportrait-status-indicator {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #999;
	margin-right: 10px;
	animation: pulse 1.5s ease-in-out infinite;
}

.liveportrait-status-indicator.ready {
	background: #28a745;
	animation: none;
}

.liveportrait-status-indicator.running {
	background: #0073aa;
	animation: pulse 1s ease-in-out infinite;
}

.liveportrait-status-indicator.error {
	background: #dc3545;
	animation: none;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.liveportrait-buttons {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
	flex-wrap: wrap;
}

.liveportrait-btn {
	padding: 12px 24px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.liveportrait-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.liveportrait-btn-primary {
	background: #0073aa;
	color: white;
	border: 2px solid #0073aa;
}

.liveportrait-btn-primary:hover:not(:disabled) {
	background: #005a87;
	border-color: #004678;
	box-shadow: 0 2px 4px rgba(0, 115, 170, 0.4);
}

.liveportrait-btn-secondary {
	background: transparent;
	color: #0073aa;
	border: 2px solid #0073aa;
}

.liveportrait-btn-secondary:hover:not(:disabled) {
	background: #0073aa;
	color: white;
	box-shadow: 0 2px 4px rgba(0, 115, 170, 0.4);
}

.liveportrait-fps-counter {
	display: inline-block;
	background: #e8f0f6;
	color: #0073aa;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid #0073aa;
}

.liveportrait-fps-counter span:first-child {
	margin-right: 5px;
}

/* Settings Section */
.liveportrait-settings {
	background: #f9f9f9;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 15px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.liveportrait-settings label {
	margin: 0;
	font-weight: 600;
	color: #23282d;
	font-size: 14px;
	white-space: nowrap;
}

.liveportrait-settings select {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	background: white;
	cursor: pointer;
	flex: 1;
	min-width: 150px;
}

/* Messages */
.liveportrait-messages {
	margin-top: 20px;
}

.liveportrait-message {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 10px;
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.liveportrait-message.info {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
}

.liveportrait-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.liveportrait-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.liveportrait-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	padding: 16px;
	border-radius: 4px;
	text-align: center;
	font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.liveportrait-container {
		margin: 20px 10px;
		padding: 15px;
	}
	
	.liveportrait-header h2 {
		font-size: 24px;
	}
	
	.liveportrait-content {
		padding: 15px;
	}
	
	.liveportrait-canvas-wrapper {
		grid-template-columns: 1fr;
		gap: 15px;
	}
	
	.liveportrait-buttons {
		flex-direction: column;
	}
	
	.liveportrait-btn {
		width: 100%;
		box-sizing: border-box;
	}
	
	.liveportrait-settings {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.liveportrait-settings select {
		width: 100%;
		min-width: unset;
	}
}

/* Loading State */
.liveportrait-container.loading canvas {
	opacity: 0.5;
}

/* Error State */
.liveportrait-container.error {
	border-color: #dc3545;
}

.liveportrait-container.error .liveportrait-status-indicator {
	background: #dc3545;
}
