/**
 * Penguin Peak Dynamic CPT Manager - Admin Styles
 *
 * @package PenguinPeak_Content_Type_Builder
 */

/* General Layout */
.ppctb-panel {
	background: #fff;
	border: 1px solid #c3c4c7;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	margin-top: 20px;
	padding: 20px;
}

.ppctb-panel h2 {
	margin-top: 0;
	padding-bottom: 10px;
	border-bottom: 1px solid #c3c4c7;
}

/* Form Grid Layout */
.ppctb-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	margin: 20px 0;
}

@media screen and (max-width: 1200px) {
	.ppctb-form-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media screen and (max-width: 1024px) {
	.ppctb-form-grid {
		grid-template-columns: 1fr;
	}
}

.ppctb-form-section.ppctb-meta-full {
	grid-column: 1 / -1;
}

.ppctb-form-section {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	padding: 15px;
	border-radius: 4px;
}

.ppctb-form-section h3 {
	margin-top: 0;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 1px solid #dcdcde;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

/* Form Elements */
.form-table th {
	padding: 10px 10px 10px 0;
	width: 200px;
	vertical-align: top;
}

.form-table td {
	padding: 10px 0;
}

.form-table .description {
	font-style: italic;
	color: #646970;
	margin-top: 4px;
}

.required {
	color: #d63638;
}

/* Toggle Switch */
.ppctb-toggle {
	position: relative;
	display: inline-block;
	width: 50px;
	height: 24px;
}

.ppctb-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #c3c4c7;
	transition: 0.3s;
	border-radius: 24px;
}

.toggle-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.3s;
	border-radius: 50%;
}

.ppctb-toggle input:checked + .toggle-slider {
	background-color: #2271b1;
}

.ppctb-toggle input:checked + .toggle-slider:before {
	transform: translateX(26px);
}

/* Checkboxes */
.ppctb-checkbox {
	display: block;
	margin-bottom: 8px;
	cursor: pointer;
}

.ppctb-checkbox input[type="checkbox"] {
	margin-right: 8px;
}

/* Notice */
#ppctb-notice {
	margin: 10px 0;
	padding: 12px;
	border-left: 4px solid #fff;
}

#ppctb-notice.success {
	border-left-color: #00a32a;
	background: #edfaef;
}

#ppctb-notice.error {
	border-left-color: #d63638;
	background: #fcf0f1;
}

#ppctb-notice p {
	margin: 0;
}

/* Empty State */
.ppctb-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #646970;
}

.ppctb-empty-state .dashicons {
	font-size: 64px;
	width: 64px;
	height: 64px;
	margin-bottom: 15px;
	color: #c3c4c7;
}

.ppctb-empty-state p {
	margin: 10px 0;
	font-size: 14px;
}

.ppctb-empty-state .description {
	font-size: 13px;
}

/* Table Actions */
.ppctb-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ppctb-actions .button-small {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.ppctb-actions .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Code tags in table */
.wp-list-table code {
	background: #f0f0f1;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 12px;
}

/* Select with icons */
#cpt_icon option {
	padding: 5px;
}

/* Submit buttons */
p.submit {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #c3c4c7;
}

/* Loading state */
.ppctb-loading {
	opacity: 0.6;
	pointer-events: none;
}

.ppctb-loading::after {
	content: "";
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-left: 8px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #2271b1;
	border-radius: 50%;
	animation: ppctb-spin 1s linear infinite;
}

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

/* Responsive */
@media screen and (max-width: 782px) {
	.ppctb-form-grid {
		gap: 20px;
	}

	.form-table th {
		width: 150px;
		padding: 8px 10px 8px 0;
	}

	.ppctb-actions {
		flex-direction: column;
		align-items: stretch;
	}
}

/* Icon preview in select */
#cpt_icon {
	min-height: 32px;
}

/* Better spacing for taxonomy settings */
#taxonomy-settings {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #dcdcde;
}

/* Meta field rows */
.ppctb-meta-row {
	display: flex;
	gap: 6px;
	align-items: center;
	margin-bottom: 4px;
	flex-wrap: wrap;
}

.ppctb-meta-row input.regular-text {
	width: 100%;
	flex: 1;
	min-width: 80px;
}

.ppctb-meta-row select {
	flex: 0 0 auto;
}

/* Repeater table */
.ppctb-repeater-table {
	border-collapse: collapse;
	width: 100%;
	margin-bottom: 0;
}

.ppctb-repeater-table th {
	background: #f0f0f1;
	padding: 8px 10px;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid #dcdcde;
	text-align: left;
}

.ppctb-repeater-table td {
	padding: 8px 10px;
	border: 1px solid #dcdcde;
	vertical-align: middle;
}

.ppctb-repeater-table tr:nth-child(even) td {
	background: #f9f9f9;
}

.ppctb-repeater-table input[type="text"],
.ppctb-repeater-table input[type="number"],
.ppctb-repeater-table input[type="email"],
.ppctb-repeater-table input[type="url"],
.ppctb-repeater-table input[type="date"],
.ppctb-repeater-table textarea {
	width: 100%;
	box-sizing: border-box;
}

.ppctb-repeater-subfields {
	margin-left: 20px;
	margin-bottom: 8px;
	background: #fff;
	border: 1px solid #dcdcde;
	padding: 10px;
	border-radius: 4px;
}
