/**
 * CR AI Chat Forms Styles
 *
 * Styles for form rendering in chat interface
 */

/* Form Message Container */
.form-message {
	max-width: 100%;
}

.message-form {
	margin-top: 12px;
}

/* Form Renderer */
.cr-ai-form-renderer {
	background: #ffffff;
	border: 1px solid #e1e4e8;
	border-radius: 8px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-header {
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #e1e4e8;
}

.form-title {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 600;
	color: #1a1a1a;
}

.form-description {
	margin: 0;
	font-size: 14px;
	color: #6a737d;
	line-height: 1.5;
}

/* Form Error Message */
.form-error-message {
	background: #fff5f5;
	border: 1px solid #feb2b2;
	border-radius: 4px;
	padding: 12px;
	margin-bottom: 16px;
	color: #c53030;
	font-size: 14px;
}

/* Form Fields */
.cr-ai-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.form-label {
	font-size: 14px;
	font-weight: 500;
	color: #24292e;
	display: flex;
	align-items: center;
	gap: 4px;
}

.required-indicator {
	color: #d73a49;
	font-weight: 600;
}

/* Input Styles */
.form-input,
.form-textarea,
.form-select {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	color: #24292e;
	background-color: #ffffff;
	border: 1px solid #d1d5da;
	border-radius: 6px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
	outline: none;
	border-color: #0366d6;
	box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.form-input.has-error,
.form-textarea.has-error,
.form-select.has-error {
	border-color: #d73a49;
}

.form-input.has-error:focus,
.form-textarea.has-error:focus,
.form-select.has-error:focus {
	box-shadow: 0 0 0 3px rgba(215, 58, 73, 0.1);
}

.form-textarea {
	resize: vertical;
	min-height: 80px;
}

/* Radio and Checkbox Groups */
.form-radio-group,
.form-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.form-radio-label,
.form-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #24292e;
	cursor: pointer;
	padding: 8px;
	border-radius: 4px;
	transition: background-color 0.2s ease;
}

.form-radio-label:hover,
.form-checkbox-label:hover {
	background-color: #f6f8fa;
}

.form-radio,
.form-checkbox {
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: #0366d6;
}

/* Help Text */
.form-help-text {
	margin: 0;
	font-size: 12px;
	color: #6a737d;
	line-height: 1.4;
}

/* Error Text */
.form-error {
	margin: 0;
	font-size: 12px;
	color: #d73a49;
	font-weight: 500;
}

/* Form Actions */
.form-actions {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e1e4e8;
}

.btn {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	border: 1px solid transparent;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

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

.btn-primary {
	color: #ffffff;
	background-color: #0366d6;
	border-color: #0366d6;
}

.btn-primary:hover:not(:disabled) {
	background-color: #0256c1;
	border-color: #0256c1;
}

.btn-secondary {
	color: #24292e;
	background-color: #f6f8fa;
	border-color: #d1d5da;
}

.btn-secondary:hover:not(:disabled) {
	background-color: #e9ecef;
	border-color: #b8bcc2;
}

/* Form Success */
.cr-ai-form-success {
	background: #f0fff4;
	border: 1px solid #9ae6b4;
	border-radius: 8px;
	padding: 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.success-icon {
	width: 48px;
	height: 48px;
	background: #48bb78;
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	font-weight: 600;
}

.success-message {
	font-size: 16px;
	color: #22543d;
	font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
	.cr-ai-form-renderer {
		padding: 16px;
	}

	.form-title {
		font-size: 16px;
	}

	.form-description {
		font-size: 13px;
	}

	.form-actions {
		flex-direction: column;
	}

	.btn {
		width: 100%;
	}
}

/* Admin Styles */
.cr-ai-forms-overview .cr-ai-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

.cr-ai-forms-overview .cr-ai-stat-card {
	background: white;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 15px;
}

.cr-ai-forms-overview .stat-icon {
	font-size: 32px;
}

.cr-ai-forms-overview .stat-value {
	font-size: 32px;
	font-weight: 600;
	color: #2271b1;
	line-height: 1;
}

.cr-ai-forms-overview .stat-label {
	font-size: 13px;
	color: #646970;
	text-transform: uppercase;
	margin-top: 5px;
}

.cr-ai-forms-overview .cr-ai-quick-links {
	background: white;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
	margin: 20px 0;
}

.cr-ai-forms-overview .quick-links-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
	margin-top: 15px;
}

.cr-ai-forms-overview .quick-link-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 30px 20px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	text-decoration: none;
	color: #2c3338;
	transition: all 0.2s;
}

.cr-ai-forms-overview .quick-link-card:hover {
	background: #2271b1;
	color: white;
	border-color: #2271b1;
}

.cr-ai-forms-overview .quick-link-card .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	margin-bottom: 10px;
}

.cr-ai-forms-overview .cr-ai-recent-activity {
	background: white;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 20px;
	margin: 20px 0;
}

.status-badge {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 500;
}

.status-active {
	background: #d5f4e6;
	color: #008a20;
}

.status-inactive {
	background: #f0f0f1;
	color: #646970;
}

.status-draft {
	background: #fcf3cd;
	color: #996800;
}

.status-submitted {
	background: #e0f2fe;
	color: #075985;
}

.status-processed {
	background: #d5f4e6;
	color: #008a20;
}

.status-failed {
	background: #fee;
	color: #b32d2e;
}
