
/**
 * Modern Product Designer - Frontend Integration Fixed Styles
 * Enhanced UI for region-based color customization
 */

/* Main container */
.mpd-frontend-controls {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	margin: 20px 0;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}

/* Color section */
.mpd-color-section {
	margin-bottom: 25px;
}

.mpd-color-section h4 {
	margin: 0 0 15px 0;
	color: #333;
	font-size: 16px;
	font-weight: 600;
}

.mpd-color-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
	gap: 8px;
	margin-bottom: 15px;
}

.mpd-color-button {
	width: 40px;
	height: 40px;
	border: 2px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	position: relative;
	transition: all .2s ease;
	background: none;
	padding: 0;
}

.mpd-color-button:hover {
	border-color: #007cba;
	transform: scale(1.05);
}

.mpd-color-button.selected {
	border-color: #007cba;
	border-width: 3px;
}

.mpd-color-button.default::after {
	content: "★";
	position: absolute;
	top: -8px;
	right: -8px;
	background: #007cba;
	color: white;
	font-size: 10px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mpd-color-check {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
	font-weight: bold;
	text-shadow: 1px 1px 2px rgba(0, 0, 0, .5);
	opacity: 0;
	transition: opacity .2s ease;
}

.mpd-color-button.selected .mpd-color-check {
	opacity: 1;
}

.mpd-selected-color {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	background: #f8f9fa;
	border-radius: 6px;
	margin-bottom: 15px;
}

.mpd-color-display {
	width: 24px;
	height: 24px;
	border: 1px solid #ddd;
	border-radius: 4px;
	display: inline-block;
}

.mpd-color-name {
	font-weight: 500;
	color: #333;
}

.mpd-color-mode {
	display: flex;
	gap: 15px;
	margin-top: 10px;
}

.mpd-color-mode label {
	display: flex;
	align-items: center;
	gap: 5px;
	cursor: pointer;
	font-size: 14px;
}

/* Region section */
.mpd-region-section {
	margin-bottom: 25px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.mpd-region-section h4 {
	margin: 0 0 15px 0;
	color: #333;
	font-size: 16px;
	font-weight: 600;
}

.mpd-region-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 15px;
}

.mpd-region-button {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: white;
	cursor: pointer;
	transition: all .2s ease;
}

.mpd-region-button:hover {
	border-color: #007cba;
	background: #f8f9fa;
}

.mpd-region-button.selected {
	border-color: #007cba;
	background: #e7f3ff;
}

.mpd-region-color {
	width: 20px;
	height: 20px;
	border: 1px solid #ddd;
	border-radius: 4px;
	display: inline-block;
}

.mpd-region-name {
	font-weight: 500;
	color: #333;
}

.mpd-region-info {
	font-size: 13px;
	color: #666;
	font-style: italic;
}

/* Actions section */
.mpd-actions-section {
	margin-bottom: 25px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.mpd-action-buttons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 10px;
}

.mpd-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all .2s ease;
	text-decoration: none;
}

.mpd-btn:disabled {
	opacity: .5;
	cursor: not-allowed;
}

.mpd-btn-preview {
	background: #007cba;
	color: white;
}

.mpd-btn-preview:hover:not(:disabled) {
	background: #005a87;
}

.mpd-btn-export {
	background: #28a745;
	color: white;
}

.mpd-btn-export:hover:not(:disabled) {
	background: #1e7e34;
}

.mpd-btn-quote {
	background: #ffc107;
	color: #212529;
}

.mpd-btn-quote:hover:not(:disabled) {
	background: #e0a800;
}

.mpd-btn-reset {
	background: #6c757d;
	color: white;
}

.mpd-btn-reset:hover:not(:disabled) {
	background: #545b62;
}

.mpd-btn-secondary {
	background: #6c757d;
	color: white;
}

.mpd-btn-secondary:hover:not(:disabled) {
	background: #545b62;
}

.mpd-btn-primary {
	background: #007cba;
	color: white;
}

.mpd-btn-primary:hover:not(:disabled) {
	background: #005a87;
}

/* Quote form */
.mpd-quote-form {
	background: #f8f9fa;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	margin-top: 20px;
}

.mpd-quote-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #ddd;
}

.mpd-quote-header h4 {
	margin: 0;
	color: #333;
}

.mpd-close-btn {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #999;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

.mpd-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
	margin-bottom: 15px;
}

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

.mpd-form-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	color: #333;
}

.mpd-form-group input, .mpd-form-group textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
}

.mpd-form-group input:focus, .mpd-form-group textarea:focus {
	outline: none;
	border-color: #007cba;
	box-shadow: 0 0 0 2px rgba(0, 124, 186, .1);
}

.mpd-checkbox-group label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

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

.mpd-quote-success {
	text-align: center;
	padding: 30px;
}

.mpd-success-message {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 15px;
}

.mpd-success-message .mpd-icon {
	font-size: 48px;
}

.mpd-success-message h4 {
	margin: 0;
	color: #28a745;
}

.mpd-success-message p {
	margin: 0;
	color: #666;
}

/* Modal styles */
.mpd-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, .7);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mpd-modal-content {
	background: white;
	border-radius: 8px;
	max-width: 90%;
	max-height: 90%;
	overflow-y: auto;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

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

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

.mpd-modal-body {
	padding: 20px;
}

.mpd-modal-actions {
	padding: 20px;
	border-top: 1px solid #eee;
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.mpd-preview-image {
	text-align: center;
	margin-bottom: 20px;
}

.mpd-preview-info {
	background: #f8f9fa;
	padding: 15px;
	border-radius: 6px;
}

.mpd-preview-info p {
	margin: 5px 0;
	color: #333;
}

/* View selector */
.mpd-view-selector-container {
	background: #f8f9fa;
	padding: 15px;
	border-radius: 6px;
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.mpd-view-selector-container label {
	font-weight: 500;
	color: #333;
}

.mpd-view-selector {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
	font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
	.mpd-frontend-controls {
		padding: 15px;
		margin: 15px 0;
	}
	
	.mpd-color-grid {
		grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
		gap: 6px;
	}
	
	.mpd-color-button {
		width: 35px;
		height: 35px;
	}
	
	.mpd-action-buttons {
		grid-template-columns: 1fr;
	}
	
	.mpd-form-row {
		grid-template-columns: 1fr;
	}
	
	.mpd-color-mode {
		flex-direction: column;
		gap: 10px;
	}
	
	.mpd-modal-content {
		max-width: 95%;
		margin: 10px;
	}
}

@media (max-width: 480px) {
	.mpd-frontend-controls {
		padding: 10px;
	}
	
	.mpd-color-grid {
		grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
		gap: 4px;
	}
	
	.mpd-color-button {
		width: 30px;
		height: 30px;
	}
	
	.mpd-btn {
		padding: 10px 12px;
		font-size: 13px;
	}
}
