/* AI Modal Styles */
.ai-modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(5px);
}

.ai-modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: white;
	padding: 0;
	border-radius: 13px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	max-width: 90vw;
	max-height: 90vh;
	overflow-y: auto;
	min-width: 600px;
	min-height: 500px;
}

.ai-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 30px;
	border-bottom: 1px solid #e0e0e0;
	background-color: #f8f9fa;
	border-radius: 13px 13px 0 0;
}

.ai-modal-header h2 {
	margin: 0;
	color: #333;
	font-size: 24px;
}

.ai-close-button {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background-color 0.2s;
}

.ai-close-button:hover {
	background-color: #e0e0e0;
}

/* Step Container */
.ai-step {
	display: none;
	padding: 30px;
}

.ai-step.active {
	display: block;
}

.ai-step h3 {
	margin: 0 0 10px 0;
	color: #333;
	font-size: 20px;
}

.ai-step p {
	margin: 0 0 20px 0;
	color: #666;
	font-size: 16px;
}

/* Object Selection (Step 1) */
.ai-object-container {
	margin-bottom: 20px;
}

.ai-object-switches {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
	justify-content: center;
}

.ai-switch-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ai-object-buttons {
	position: relative;
}

.ai-object-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
	max-height: 300px;
	overflow-y: auto;
	padding: 20px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow-x: hidden;
}

.ai-object-grid button {
	background: white;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 10px;
	cursor: pointer;
	transition: all 0.2s;
	aspect-ratio: 1;
}

.ai-object-grid button:hover {
	border-color: #f30000;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ai-object-grid button.selected {
	border-color: #f30000;
	background-color: #fff5f5;
}

.ai-object-grid button img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 4px;
	user-drag: none;
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
	pointer-events: none;
}

/* Texture Selection (Step 2) */
.ai-texture-container {
	margin-bottom: 20px;
}

.ai-texture-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 15px;
	max-height: 300px;
	overflow-y: auto;
	padding: 20px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
}

.ai-texture-grid button {
	background: white;
	border: 2px solid #e0e0e0;
	border-radius: 50%;
	padding: 5px;
	cursor: pointer;
	transition: all 0.2s;
	aspect-ratio: 1;
}

.ai-texture-grid button:hover {
	border-color: #f30000;
	transform: scale(1.05);
}

.ai-texture-grid button.selected {
	border-color: #f30000;
	box-shadow: 0 0 0 3px rgba(243, 0, 0, 0.2);
}

.ai-texture-grid button img,
.ai-texture-grid button canvas {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	user-drag: none;
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
	pointer-events: none;
}

/* Confirmation (Step 3) */
.ai-confirm-container {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin-bottom: 20px;
}

.ai-confirm-item {
	text-align: center;
}

.ai-confirm-item h4 {
	margin: 0 0 10px 0;
	color: #333;
	font-size: 16px;
}

.ai-image-preview,
.ai-object-preview,
.ai-texture-preview {
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 10px;
	min-height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #f8f9fa;
}

.ai-image-preview img,
.ai-object-preview img,
.ai-texture-preview img,
.ai-texture-preview canvas {
	max-width: 100%;
	max-height: 100px;
	object-fit: contain;
	border-radius: 4px;
	user-drag: none;
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
}

.ai-texture-preview img,
.ai-texture-preview canvas {
	border-radius: 50%;
	width: 80px;
	height: 80px;
	user-drag: none;
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
}

/* Loading and Result (Step 4) */
.ai-loading {
	text-align: center;
	padding: 40px;
}

.ai-spinner {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #f30000;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
	margin: 0 auto 20px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.ai-result {
	text-align: center;
	padding: 20px;
}

.ai-result-image {
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	min-height: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #f8f9fa;
}

.ai-result-image img {
	max-width: 100%;
	max-height: 400px;
	object-fit: contain;
	border-radius: 4px;
	user-drag: none;
	-webkit-user-drag: none;
	user-select: none;
	-webkit-user-select: none;
}

/* Step Buttons */
.ai-step-buttons {
	display: flex;
	gap: 15px;
	justify-content: flex-end;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #e0e0e0;
}

.ai-button {
	padding: 12px 24px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 500;
	transition: all 0.2s;
	min-width: 120px;
}

.ai-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ai-button-primary {
	background-color: #f30000;
	color: white;
}

.ai-button-primary:hover:not(:disabled) {
	background-color: #d60000;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(243, 0, 0, 0.3);
}

.ai-button-secondary {
	background-color: #e0e0e0;
	color: #333;
}

.ai-button-secondary:hover {
	background-color: #d0d0d0;
	transform: translateY(-1px);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
	.ai-modal-content {
		min-width: 95vw;
		margin: 10px;
	}
	
	.ai-object-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.ai-texture-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	
	.ai-confirm-container {
		grid-template-columns: 1fr;
	}
	
	.ai-step-buttons {
		flex-direction: column;
	}
} 