/**
 * WP Free Tools - Catalog Image Builder Styles
 *
 * @package WP_Free_Tools
 */

/* Container */
.wft-catalog-builder {
	max-width: 1400px;
	margin: 0 auto;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	background: #fff;
}

.wft-container {
	width: 100%;
}

/* Header */
.wft-header {
	text-align: center;
	margin-bottom: 30px;
}

.wft-title {
	font-size: 28px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0 0 10px 0;
}

.wft-subtitle {
	font-size: 16px;
	color: #666;
	margin: 0;
}

/* Editor Wrapper */
.wft-editor-wrapper {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

/* Controls Panel */
.wft-controls-panel {
	flex: 0 0 320px;
	min-width: 280px;
	background: #f8f9fa;
	border-radius: 8px;
	padding: 20px;
	max-height: calc(100vh - 200px);
	overflow-y: auto;
}

.wft-controls-panel::-webkit-scrollbar {
	width: 8px;
}

.wft-controls-panel::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.wft-controls-panel::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 4px;
}

.wft-controls-panel::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* Preview Panel */
.wft-preview-panel {
	flex: 1 1 500px;
	min-width: 280px;
	background: #f8f9fa;
	border-radius: 8px;
	padding: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Section */
.wft-section {
	margin-bottom: 25px;
	padding-bottom: 25px;
	border-bottom: 1px solid #e0e0e0;
}

.wft-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.wft-section-title {
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0 0 15px 0;
}

/* Accordion Styles */
.wft-accordion-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	padding: 8px 0;
	margin: 0 0 0 0;
	transition: color 0.2s ease;
}

.wft-accordion-header:hover {
	color: #4a90e2;
}

.wft-accordion-header span {
	flex: 1;
}

.wft-accordion-icon {
	width: 16px;
	height: 16px;
	transition: transform 0.3s ease;
	flex-shrink: 0;
	margin-left: 10px;
	color: #666;
}

.wft-accordion.wft-collapsed .wft-accordion-icon {
	transform: rotate(-90deg);
}

.wft-accordion-content {
	overflow: hidden;
	transition: max-height 0.3s ease, opacity 0.2s ease;
	max-height: 2000px;
	opacity: 1;
}

.wft-accordion.wft-collapsed .wft-accordion-content {
	max-height: 0;
	opacity: 0;
}

/* Upload Section */
.wft-upload-area {
	border: 2px dashed #ccc;
	border-radius: 8px;
	padding: 40px 20px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s ease;
	background: #fff;
}

.wft-upload-area:hover {
	border-color: #4a90e2;
	background: #f0f7ff;
}

.wft-upload-placeholder svg {
	color: #999;
	margin-bottom: 10px;
}

.wft-upload-placeholder p {
	margin: 5px 0;
	color: #666;
	font-size: 14px;
}

.wft-upload-hint {
	font-size: 12px;
	color: #999;
}

/* Canvas Wrapper */
.wft-canvas-wrapper {
	position: relative;
	width: 100%;
	max-width: 500px;
	margin: 0 auto;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	min-height: 250px;
	display: flex;
	align-items: center;
	justify-content: center;
}

#wft-canvas {
	display: block;
	max-width: 100%;
	width: 100%;
	height: auto;
	background: #fff;
}

.wft-canvas-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
	color: #999;
	width: 100%;
	height: 100%;
	min-height: 250px;
	position: absolute;
	top: 0;
	left: 0;
}

.wft-canvas-placeholder svg {
	margin-bottom: 15px;
	opacity: 0.5;
}

.wft-canvas-placeholder p {
	margin: 0;
	font-size: 16px;
	text-align: center;
}

/* Form Groups */
.wft-form-group {
	margin-bottom: 15px;
}

.wft-form-group label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	margin-bottom: 6px;
}

.wft-form-group label input[type="checkbox"] {
	margin-right: 8px;
}

.wft-input,
.wft-select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	color: #333;
	box-sizing: border-box;
}

.wft-input:focus,
.wft-select:focus {
	outline: none;
	border-color: #4a90e2;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.wft-color-input {
	width: 100%;
	height: 45px;
	padding: 2px;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	background: #fff;
}

.wft-checkbox {
	width: auto;
	height: auto;
	margin: 0;
	cursor: pointer;
}

/* Presets Grid */
.wft-presets-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.wft-preset-btn {
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.wft-preset-btn:hover {
	border-color: #4a90e2;
	background: #f0f7ff;
}

.wft-preset-btn.active {
	border-color: #4a90e2;
	background: #4a90e2;
	color: #fff;
}

.wft-preset-btn span {
	font-size: 11px;
	opacity: 0.8;
	font-weight: normal;
}

/* Buttons */
.wft-btn {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.wft-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wft-btn-primary {
	background: #4a90e2;
	color: #fff;
}

.wft-btn-primary:hover:not(:disabled) {
	background: #357abd;
}

.wft-btn-secondary {
	background: #6c757d;
	color: #fff;
}

.wft-btn-secondary:hover {
	background: #5a6268;
}

.wft-btn-block {
	width: 100%;
	display: block;
}

/* Responsive Design */
@media (max-width: 968px) {
	.wft-editor-wrapper {
		flex-direction: column;
	}

	.wft-controls-panel {
		flex: 1 1 auto;
		max-height: none;
		order: 2;
	}

	.wft-preview-panel {
		flex: 1 1 auto;
		order: 1;
	}

	.wft-catalog-builder {
		padding: 15px;
	}

	.wft-title {
		font-size: 24px;
	}
}

@media (max-width: 640px) {
	.wft-controls-panel {
		padding: 15px;
	}

	.wft-presets-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.wft-title {
		font-size: 22px;
	}

	.wft-subtitle {
		font-size: 14px;
	}
}

/* Loading State */
.wft-loading {
	opacity: 0.6;
	pointer-events: none;
}

.wft-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #4a90e2;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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