.rg-generator .rg-form label { display:block; margin-bottom:6px; }
.rg-generator select { min-width: 260px; }
.rg-generator .button { cursor: pointer; }
.rg-results .rg-results-actions { display:flex; gap:8px; }

/* RTL adjustments */
.rg-generator[dir="rtl"] { direction: rtl; text-align: right; }
.rg-generator[dir="rtl"] .rg-form label { text-align: right; }
.rg-generator[dir="rtl"] input[type="text"],
.rg-generator[dir="rtl"] textarea,
.rg-generator[dir="rtl"] select { text-align: right; }
.rg-generator[dir="rtl"] .rg-results .rg-results-actions { justify-content: flex-start; }

/* Modern UI enhancements */
.rg-generator { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.rg-generator .rg-form,
.rg-generator .rg-results { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,0.08); padding: 24px; }

.rg-generator .rg-template-chooser { margin-bottom: 16px; padding: 16px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; }
.rg-generator .rg-template-chooser label { color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.rg-generator .rg-template-chooser select { background: #fff; border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.rg-generator .rg-field-group { margin-bottom: 18px; }
.rg-generator .rg-field-group label { font-weight: 700; color: #1f2937; margin-bottom: 8px; font-size: 15px; }
.rg-generator input[type="text"],
.rg-generator textarea,
.rg-generator select { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 2px solid #e5e7eb; border-radius: 12px; background: #fff; color: #111827; outline: none; transition: all .3s ease; font-size: 15px; }
.rg-generator textarea { min-height: 140px; resize: vertical; font-family: inherit; }
.rg-generator input[type="text"]:focus,
.rg-generator textarea:focus,
.rg-generator select:focus { border-color: #667eea; box-shadow: 0 0 0 4px rgba(102,126,234,0.15); transform: translateY(-1px); }

/* Image upload field styling */
.rg-generator .rg-upload-container {
	position: relative;
}

.rg-generator .rg-file-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
}

.rg-generator .rg-file-button {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	color: #111827;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: all .3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	outline: none;
}

.rg-generator .rg-file-button:hover {
	border-color: #667eea;
	background: #f0f6fc;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}

.rg-generator .rg-file-button:focus {
	border-color: #667eea;
	box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
}

.rg-generator input[type="file"] {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	color: #111827;
	outline: none;
	transition: all .3s ease;
	font-size: 15px;
	cursor: pointer;
}

.rg-generator input[type="file"]:hover {
	border-color: #667eea;
}

.rg-generator input[type="file"]:focus {
	border-color: #667eea;
	box-shadow: 0 0 0 4px rgba(102,126,234,0.15);
	transform: translateY(-1px);
}

/* Drop zone styling */
.rg-generator .rg-drop-zone {
	width: 100%;
	min-height: 180px;
	border: 2px dashed #d1d5db;
	border-radius: 12px;
	background: #f9fafb;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all .3s ease;
	padding: 24px;
	box-sizing: border-box;
}

.rg-generator .rg-drop-zone:hover {
	border-color: #667eea;
	background: #f0f6fc;
}

.rg-generator .rg-drop-zone.rg-drag-over {
	border-color: #667eea;
	background: #e0e7ff;
	border-style: solid;
	transform: scale(1.02);
}

.rg-generator .rg-drop-content {
	text-align: center;
}

.rg-generator .rg-drop-zone .dashicons {
	font-family: dashicons;
}

.rg-generator .rg-image-preview {
	margin-top: 12px;
	border-radius: 12px;
	overflow: hidden;
	border: 2px solid #e5e7eb;
	position: relative;
}

.rg-generator .rg-image-preview img {
	display: block;
	width: 100%;
	height: auto;
}

.rg-generator .rg-change-image {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 8px 16px;
	background: rgba(255,255,255,0.95);
	border: 2px solid #667eea;
	border-radius: 8px;
	color: #667eea;
	font-weight: 600;
	cursor: pointer;
	font-size: 13px;
	z-index: 10;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	transition: all .3s ease;
}

.rg-generator .rg-change-image:hover {
	background: #667eea;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.rg-generator .rg-cloud-icon {
	font-size: 48px;
	color: #667eea;
	display: block;
	margin: 0 auto 12px;
	line-height: 1;
}

.rg-generator .rg-icon-upload {
	margin-left: 8px;
	font-size: 18px;
}

/* Choice fields styling */
.rg-generator .rg-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px;
	background: #f9fafb;
	border: 2px solid #e5e7eb;
	border-radius: 12px;
	transition: all .3s ease;
}

.rg-generator .rg-choices:hover {
	border-color: #d1d5db;
}

.rg-generator .rg-choices label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	transition: all .3s ease;
	font-weight: 500;
	color: #374151;
	margin: 0;
	flex: 1;
	min-width: 0;
}

.rg-generator .rg-choices label:hover {
	border-color: #667eea;
	background: #f0f6fc;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}

.rg-generator .rg-choices input[type="checkbox"] {
	width: 20px;
	height: 20px;
	cursor: pointer;
	accent-color: #667eea;
	flex-shrink: 0;
	margin: 0;
}

.rg-generator .rg-choices input[type="checkbox"]:checked + span {
	color: #667eea;
	font-weight: 600;
}

.rg-generator .rg-choices label input[type="checkbox"]:checked ~ span {
	color: #667eea;
	font-weight: 600;
}

/* Vertical layout for choice fields */
.rg-generator .rg-choices[data-layout="vertical"] {
	flex-direction: column;
}

.rg-generator .rg-choices[data-layout="vertical"] label {
	width: 100%;
	justify-content: flex-start;
}

/* Horizontal layout for choice fields */
.rg-generator .rg-choices[data-layout="horizontal"] label {
	flex: 0 1 auto;
	min-width: 140px;
}

.rg-generator .button { border-radius: 12px; padding: 12px 20px; font-weight: 600; transition: all .3s ease; border: none; }
.rg-generator .button.button-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-color: transparent; box-shadow: 0 4px 12px rgba(102,126,234,0.4); color: #fff; }
.rg-generator .button.button-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(102,126,234,0.5); }
.rg-generator .button:not(.button-primary) { background: #f3f4f6; color: #374151; }
.rg-generator .button:not(.button-primary):hover { background: #e5e7eb; }

.rg-generator #rg-actions { display: flex; gap: 10px; margin-top: 20px; }

.rg-generator .rg-results { margin-top: 24px; }
.rg-generator .rg-results-actions { display:flex; gap:10px; margin-bottom:16px; flex-wrap: wrap; }

.rg-previews { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rg-previews > div { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); overflow: hidden; }
.rg-previews img { display: block; width: 100%; height: auto; border: 0; }

/* Catalog modern styles */
.rg-catalog[dir="rtl"] { direction: rtl; }
.rg-catalog { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:20px; max-width:1100px; margin:24px auto; padding:0 16px; }
.rg-catalog .rg-card { border:1px solid #e5e7eb; border-radius: 16px; background:#fff; overflow:hidden; box-shadow: 0 6px 20px rgba(0,0,0,0.08); display:flex; flex-direction:column; transition: all .3s ease; }
.rg-catalog .rg-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(102,126,234,0.25); border-color: #667eea; }
.rg-catalog .rg-thumb { aspect-ratio:4/3; background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%); display:flex; align-items:center; justify-content:center; position: relative; overflow: hidden; }
.rg-catalog .rg-thumb::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%); opacity: 0; transition: opacity .3s; }
.rg-catalog .rg-card:hover .rg-thumb::before { opacity: 1; }
.rg-catalog .rg-thumb img { max-width:100%; max-height:100%; display:block; transition: transform .3s; }
.rg-catalog .rg-card:hover .rg-thumb img { transform: scale(1.05); }
.rg-catalog .rg-no-preview { color:#9ca3af; padding:16px; font-weight: 600; }
.rg-catalog .rg-card-body { padding:16px; display:flex; align-items:center; justify-content:space-between; gap:12px; background: linear-gradient(to bottom, #fff 0%, #f9fafb 100%); }
.rg-catalog .rg-card-title { font-weight:800; color:#111827; font-size: 16px; }
.rg-catalog .button.button-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border: none; border-radius: 10px; padding: 10px 18px; font-weight: 700; box-shadow: 0 4px 12px rgba(102,126,234,0.35); transition: all .3s; color: #fff !important; }
.rg-catalog .button.button-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(102,126,234,0.5); color: #fff !important; }

.rg-title { text-align:center; font-weight:800; color:#111827; margin: 8px 0 16px; }

/* Responsive previews grid */
.rg-previews { grid-template-columns: 1fr; }
@media (min-width: 768px) { .rg-previews { grid-template-columns: repeat(3, 1fr); } }


