/* Page Loader */
.shortcodeglut-page-loader {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(245, 245, 245, 0.98);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.shortcodeglut-loader-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #2271b1;
	border-radius: 50%;
	animation: shortcodeglut-spin 1s linear infinite;
}

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

.shortcodeglut-loader-text {
	margin-top: 20px;
	font-size: 16px;
	font-weight: 500;
	color: #1d2327;
	animation: shortcodeglut-pulse 1.5s ease-in-out infinite;
}

@keyframes shortcodeglut-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

/* Template Editor Page - Full Width Layout */
body.shortcodeglut-fullpage-editor #wpwrap {
	margin-top: 0 !important;
}

body.shortcodeglut-fullpage-editor #adminmenumain {
	display: none !important;
}

body.shortcodeglut-fullpage-editor #wpbody {
	margin-left: 0 !important;
}

body.shortcodeglut-fullpage-editor #wpbody-content {
	padding-left: 0 !important;
	padding-bottom: 0 !important;
}

body.shortcodeglut-fullpage-editor #wpcontent,
body.shortcodeglut-fullpage-editor #wpfooter {
	margin-left: 0 !important;
}

body.shortcodeglut-fullpage-editor.html.wp-toolbar {
	padding-top: 0 !important;
}

/* More specific override for html.wp-toolbar */
html.shortcodeglut-fullpage-editor.wp-toolbar {
	padding-top: 0 !important;
	box-sizing: border-box;
}

/* Direct targeting with maximum specificity */
html.shortcodeglut-fullpage-editor.wp-toolbar[xmlns] {
	padding-top: 0 !important;
}

body.shortcodeglut-fullpage-editor .wrap {
	margin: 20px;
}

/* Template Editor Page Layout */
.shortcodeglut-template-editor-page {
	max-width: 100%;
	padding: 0;
}

/* Editor Header with Back Button */
.shortcodeglut-editor-header {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
	position: relative;
}

.shortcodeglut-header-left {
	flex-shrink: 0;
}

.shortcodeglut-header-left .button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	font-size: 14px;
	height: auto;
	line-height: 1.4;
}

.shortcodeglut-header-left .button .dashicons {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	font-size: 18px;
}

.shortcodeglut-header-center {
	flex: 1;
}

.shortcodeglut-header-center h1 {
	margin: 0;
	padding: 0;
	font-size: 23px;
	font-weight: 400;
	line-height: 1.3;
}

/* Editor Layout with Sidebar */
.shortcodeglut-editor-layout {
	display: flex;
	gap: 20px;
	margin-top: 20px;
}

.shortcodeglut-editor-main {
	flex: 1;
	max-width: calc(100% - 320px);
}

.shortcodeglut-editor-sidebar {
	width: 300px;
	flex-shrink: 0;
}

/* Tags Panel */
.shortcodeglut-tags-panel {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 15px;
}

.shortcodeglut-tags-panel h3 {
	margin-top: 0;
	font-size: 14px;
	font-weight: 600;
	padding-bottom: 10px;
	border-bottom: 1px solid #c3c4c7;
	margin-bottom: 15px;
}

.shortcodeglut-tags-panel .description {
	font-size: 12px;
	color: #646970;
	margin-bottom: 15px;
}

.shortcodeglut-tag-category {
	margin-bottom: 20px;
}

.shortcodeglut-tag-category:last-child {
	margin-bottom: 0;
}

.shortcodeglut-tag-category h4 {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 10px 0;
	color: #1d2327;
}

.shortcodeglut-tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.shortcodeglut-tag-item {
	background: #f0f0f1;
	border: 1px solid #c3c4c7;
	border-radius: 3px;
	padding: 8px 12px;
	font-size: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.shortcodeglut-tag-item:hover {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
	transform: translateY(-1px);
}

.shortcodeglut-tag-item code {
	background: none;
	padding: 0;
	font-size: 12px;
	color: inherit;
	font-weight: 600;
}

.shortcodeglut-tag-description {
	font-size: 11px;
	opacity: 0.8;
	line-height: 1.3;
}

/* Form Table Adjustments */
.shortcodeglut-template-editor-page .form-table {
	max-width: 100%;
}

.shortcodeglut-template-editor-page .form-table td {
	padding: 15px 10px;
}

/* Editor Adjustments */
.shortcodeglut-template-editor-page .wp-editor-container {
	border: 1px solid #c3c4c7;
	border-radius: 4px;
}

/* Responsive */
@media (max-width: 1200px) {
	.shortcodeglut-editor-layout {
		flex-direction: column;
	}

	.shortcodeglut-editor-main {
		max-width: 100%;
	}

	.shortcodeglut-editor-sidebar {
		width: 100%;
		max-width: 100%;
	}
}

/* Responsive for shortcodeglut header */
@media (max-width: 768px) {
	.shortcodeglut-editor-header {
		flex-wrap: wrap;
		gap: 10px;
	}

	.shortcodeglut-header-left {
		width: 100%;
	}

	.shortcodeglut-header-center {
		width: 100%;
	}

	.shortcodeglut-header-center h1 {
		font-size: 20px;
	}
}

/* Fixed Form Actions at Bottom Left */
.shortcodeglut-form-actions {
	position: fixed;
	bottom: 0;
	left: 0;
	z-index: 1000;
	background: #fff;
	padding: 15px 20px;
	border-radius: 0;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
	border-top: 1px solid #c3c4c7;
	border-right: 1px solid #c3c4c7;
	display: flex;
	gap: 15px;
}

.shortcodeglut-form-actions .button {
	margin: 0;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	height: 46px;
	line-height: 1.2;
	min-width: 120px;
}

.shortcodeglut-form-actions .button.button-primary {
	padding: 12px 28px;
}

/* Responsive styles for fixed buttons */
@media (max-width: 768px) {
	.shortcodeglut-form-actions {
		right: 0;
		padding: 12px 15px;
		gap: 10px;
	}

	.shortcodeglut-form-actions .button {
		flex: 1;
		text-align: center;
		font-size: 14px;
		padding: 10px 20px;
		min-width: 100px;
	}
}

/* Fix button text color */
.shortcodeglut-form-actions .button.button-primary {
	color: #ffffff !important;
}

/* Ensure white text on primary button */
.shortcodeglut-form-actions .button.button-primary,
.shortcodeglut-form-actions .button.button-primary:hover,
.shortcodeglut-form-actions .button.button-primary:focus {
	color: #ffffff !important;
}
