/**
 * nuclen-admin.css
 *
 * Plugin-wide admin CSS.
 */

/*--------------------------------------------------------------
Nuclear Engagement Plugin Admin Styles
This file provides a consistent set of classes to build the plugin's admin UI.
--------------------------------------------------------------*/

/*--------------------------------------------------------------
#RESET/BASIC STYLES (Optional)
You might include a basic reset or normalizing styles here.
--------------------------------------------------------------*/
/* Example (if desired):
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, b, u, i,
center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption,
tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	vertical-align: baseline;
}
body {
	font-family: Arial, sans-serif;
	font-size: 14px;
	linuclen-height: 1.5;
}
*/

:root {
	--nuclen-spacing-xs: 0.25rem;
	--nuclen-spacing-sm: 0.5rem;
	--nuclen-spacing-md: 1rem;
	--nuclen-spacing-lg: 1.5rem;
	--nuclen-spacing-xl: 2.5rem;
}

/*--------------------------------------------------------------
#LAYOUT CLASSES
Use these to structure your UI into containers, sections, rows, and columns.
--------------------------------------------------------------*/

.nuclen-quiz-metabox-question {
		margin: var(--nuclen-spacing-md) 0 0 0;
	border: 1px solid #eee;
	border-left: none;
	border-bottom: none;
	border-right: none;
}

#nuclen-quiz-data-meta-box .inside, #nuclen-summary-data-meta-box .inside {
		max-height: 50vh;
		display: flex;
		overflow-y: scroll;
		overflow-x: hidden;
		padding: var(--nuclen-spacing-md);
		gap: var(--nuclen-spacing-md);
		flex-direction: column;
}

#nuclen-page-header {
		margin: var(--nuclen-spacing-lg) 0 var(--nuclen-spacing-xl) 0;
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 10px;
}

.nuclen-container {
		padding: var(--nuclen-spacing-lg);
}

.nuclen-section {
		width: fit-content;
		border: 1px solid #ddd;
		padding: var(--nuclen-spacing-xl);
		background: #fff;
}

.nuclen-row {
		display: flex;
		gap: var(--nuclen-spacing-lg);
		flex-wrap: wrap;
		margin-bottom: var(--nuclen-spacing-md);
}

.nuclen-column {
		flex: 1;
		min-width: 200px;
		padding: var(--nuclen-spacing-sm);
}

.nuclen-label-col {
		min-width: 150px;
		margin-right: var(--nuclen-spacing-sm);
		text-align: right;
}
.nuclen-input-col {
	flex: 1;
}

/* setup page*/

#nuclen-setup-step-1, #nuclen-setup-step-2 {
	width: auto;
}

/*--------------------------------------------------------------
#TYPOGRAPHY
Headings, subheadings, muted text, and emphasis classes.
--------------------------------------------------------------*/
.nuclen-heading {
		font-size: 1.5rem;
		margin-bottom: var(--nuclen-spacing-sm);
		font-weight: 600;
}

.nuclen-subheading {
		border-bottom: solid 0.1em #ddd;
		padding: var(--nuclen-spacing-lg) 0 var(--nuclen-spacing-sm) 0;
		margin-bottom: var(--nuclen-spacing-md);
}

.nuclen-text-muted {
	color: #666;
}

.nuclen-text-bold {
	font-weight: 600;
}

/*--------------------------------------------------------------
#FORMS & INPUTS
Classes for form groups, labels, inputs, and buttons.
--------------------------------------------------------------*/

#nuclen-section th {
	width: 100px;
	text-align: right;
}

.nuclen-form-row {
		margin: var(--nuclen-spacing-md) 0;
}

.nuclen-form-group {
		margin-bottom: var(--nuclen-spacing-md);
}

.nuclen-label {
		display: block;
		margin-bottom: var(--nuclen-spacing-sm);
		font-weight: 500;
}

.nuclen-input {
	min-width: 200px;
	width: fit-content;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
}

	.nuclen-input:focus {
				border-color: #007cba;
				outline: none;
	}

	input[type="color"].nuclen-input {
min-width: 40px;
width: 40px;
height: 34px;
padding: 0;
border: 0;
border-radius: 4px;
	}

/* Utility inputs */
.nuclen-width-full {
		width: 100%;
}

.nuclen-meta-date-input {
		width: 100%;
		background: #f9f9f9;
}

.nuclen-answer-correct {
		font-weight: bold;
		background: #e6ffe6;
}

.nuclen-answer-label {
				margin-bottom: var(--nuclen-spacing-sm);
}

/* Buttons */
.nuclen-button {
	display: inline-block;
	padding: 8px 12px;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	text-align: center;
}

.nuclen-button-primary {
	background: #007cba;
	color: #fff;
}

.nuclen-button-secondary {
	background: #f3f3f3;
	color: #333;
}

.nuclen-button:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* checkboxes */
.nuclen-checkbox {
		margin-right: var(--nuclen-spacing-sm);
	width: auto;
	height: auto;
	cursor: pointer;
	accent-color: #007cba;
}

.nuclen-checkbox-label {
	cursor: pointer;
	font-size: 14px;
	/* any other label stylings you want */
}

/* tooltip */

[nuclen-tooltip] {
	align-self: center;
	position: relative;
	cursor: pointer;
	}

	/* The tooltip text */
	[nuclen-tooltip]::after {
	content: attr(nuclen-tooltip);
	position: absolute;
	bottom: -200%;
	left: 50%;
	transform: translateX(-50%);
	padding: 6px 8px;
	background: #333;
	color: #fff;
	border-radius: 4px;
	white-space: normal;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease-out;
	z-index: 9999;
	width: 200px;
	}

	/* Arrow */
	/*
	[nuclen-tooltip]::before {
	content: "";
	position: absolute;
	bottom: 110%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #333;
	opacity: 0;
	transition: opacity 0.15s ease-out;
	pointer-events: none;
	z-index: 9999;
	}
 */

	/* Show the tooltip on hover */
	[nuclen-tooltip]:hover::after,
	[nuclen-tooltip]:hover::before {
	opacity: 1;
	}


/*--------------------------------------------------------------
#COMPONENTS
Alerts, progress indicators, etc.
--------------------------------------------------------------*/
.nuclen-alert {
	padding: 10px 15px;
	border-radius: 3px;
	margin-bottom: 15px;
	font-size: 14px;
	min-height: 40px;
	position: relative;
	display: flex;
	align-items: center;
}

.nuclen-alert-success {
	background: #e7f7e3;
	border: 1px solid #b2d8b2;
	color: #2d6a2d;
}

.nuclen-alert-error {
	background: #fdd8d8;
	border: 1px solid #f5a5a5;
	color: #a33;
}

.nuclen-alert-info {
	background: #eef5fd;
	border: 1px solid #c7dbfc;
	color: #245c99;
}

.nuclen-progress {
		margin-bottom: var(--nuclen-spacing-sm);
	font-size: 14px;
}

/*--------------------------------------------------------------
#GENERATION PROGRESS BAR
--------------------------------------------------------------*/

/* --- Progress Bar Container --- */
.ne-step-bar {
		display: flex;
		gap: 2px;
		margin-bottom: var(--nuclen-spacing-lg);
		width: 100%;
		border: 1px solid #ccc;
		border-radius: 4px;
		overflow: hidden;
		}

		/* --- Individual Step (shared base styles) --- */
		.ne-step-bar__step {
		flex: 1;
		text-align: center;
		color: #fff;
		padding: var(--nuclen-spacing-sm) 0;
		font-weight: bold;
		transition: background-color 0.3s ease;
		}

		/* The default "todo" might be gray-ish */
		.ne-step-bar__step--todo {
		background-color: #9ea1a6;
		}

	/* "current" stands out with a different color */
		.ne-step-bar__step--current {
		background-color: #888800; /* WP admin blue or your brand color */
		}

	/* "done" could be green */
		.ne-step-bar__step--done {
		background-color: #46b450;
		}

	/* "failed" could be red */
		.ne-step-bar__step--failed {
		background-color: #dc3232;
		}



/*--------------------------------------------------------------
#UTILITIES
Quick helper classes for display, text alignment, etc.
--------------------------------------------------------------*/
.nuclen-hidden {
	display: none !important;
}

.nuclen-inline-block {
	display: inline-block;
}

.nuclen-float-right {
	float: right;
}

.nuclen-center-text {
		text-align: center;
}

.nuclen-error-toast {
				position: fixed;
				bottom: 20px;
				right: 20px;
				background: #d63638;
				color: #fff;
				padding: 12px 16px;
				border-radius: 3px;
				z-index: 100000;
}
.nuclen-success-toast {
				position: fixed;
				bottom: 20px;
				right: 20px;
				background: #00a32a;
				color: #fff;
				padding: 12px 16px;
				border-radius: 3px;
				z-index: 100000;
				box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
/* Page-level messages */
.nuclen-page-message {
				display: flex;
				align-items: center;
				margin: 16px 0;
				padding: 12px 16px;
				border-radius: 4px;
				transition: opacity 0.3s ease;
}
.nuclen-page-message--success {
				background: #d4f4dd;
				border: 1px solid #00a32a;
				color: #00450c;
}
.nuclen-page-message--info {
				background: #e7f2ff;
				border: 1px solid #2271b1;
				color: #0a4b78;
}
.nuclen-page-message--warning {
				background: #fef8e6;
				border: 1px solid #dba617;
				color: #5a4b00;
}
.nuclen-page-message__icon {
				font-size: 20px;
				margin-right: 12px;
				line-height: 1;
}
.nuclen-page-message__text {
				flex: 1;
				font-size: 14px;
				line-height: 1.5;
}
/* Button loading state */
.button .spinner.is-active {
				display: inline-block;
				float: none;
				margin: 0 8px 0 0;
				vertical-align: middle;
}

/* Status message for polling timeouts */
.nuclen-status-message {
				background: #f0f6fc;
				border: 1px solid #72aee6;
				border-radius: 4px;
				padding: 12px 16px;
				margin: 10px 0;
}

.nuclen-status-message p {
				margin: 0 0 8px 0;
}

.nuclen-status-message p:last-child {
				margin-bottom: 0;
}

.nuclen-status-message a {
				color: #2271b1;
				text-decoration: none;
				font-weight: 500;
}

.nuclen-status-message a:hover {
				color: #135e96;
				text-decoration: underline;
}

/* Spacing utilities */
.u-mt-sm { margin-top: var(--nuclen-spacing-sm); }
.u-mt-md { margin-top: var(--nuclen-spacing-md); }
.u-mt-lg { margin-top: var(--nuclen-spacing-lg); }
.u-mb-sm { margin-bottom: var(--nuclen-spacing-sm); }
.u-mb-md { margin-bottom: var(--nuclen-spacing-md); }
.u-mb-lg { margin-bottom: var(--nuclen-spacing-lg); }

.notice.is-dismissible {
	padding-right: 38px;
}

.notice .notice-dismiss {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

/* Ensure onboarding pointers appear above sidebar */
.wp-pointer {
	z-index: 100600 !important;
}

/* Generate page credit balance */
.nuclen-generate-credits {
	margin: 10px 0 20px 0;
	padding: 10px 15px;
	background: #f0f0f1;
	border-left: 4px solid #2271b1;
	border-radius: 4px;
}

.nuclen-generate-credits-container {
	margin: 0;
}

.nuclen-generate-credits .nuclen-credit-balance-display {
	margin: 0;
	font-size: 14px;
}

/* Refresh button icon animation */
.button .dashicons-update {
	transition: transform 0.3s ease;
}

.button:hover .dashicons-update {
	transform: rotate(180deg);
}

/* Spinner styles for generation progress */
#nuclen-updates-content .spinner {
	float: none;
	margin: 0 5px 0 0;
	vertical-align: middle;
	display: inline-block;
}

#nuclen-updates-content .spinner.is-active {
	visibility: visible;
}

/* Tasks page auto-refresh styles */
.nuclen-update-indicator {
	display: inline-block;
	margin-left: 10px;
	padding: 5px 10px;
	background: #f0f0f0;
	border-radius: 3px;
	font-size: 12px;
	color: #666;
	opacity: 0;
	transition: opacity 0.3s ease;
	vertical-align: middle;
}

.nuclen-update-indicator.visible {
	opacity: 1;
}

.nuclen-update-indicator .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	vertical-align: middle;
	margin-right: 3px;
}

.nuclen-update-indicator .dashicons.spin {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}


/* Refresh button busy state */
.nuclen-refresh-button.is-busy {
	opacity: 0.6;
	cursor: not-allowed;
}

.nuclen-refresh-button.is-busy .dashicons-update {
	animation: spin 1s linear infinite;
}

/* Auto-refresh Polling Indicator */
.nuclen-polling-indicator {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: 15px;
	padding: 8px 16px;
	background: #f0f0f1;
	border: 2px solid #dcdcde;
	border-radius: 5px;
	font-size: 14px;
	color: #646970;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	font-weight: 500;
}

.nuclen-polling-indicator.active {
	background: #e8f5e9;
	border-color: #4caf50;
	color: #2e7d32;
	box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
	animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
	0%, 100% {
		border-color: #4caf50;
		box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
	}
	50% {
		border-color: #66bb6a;
		box-shadow: 0 2px 12px rgba(76, 175, 80, 0.5);
	}
}

.nuclen-polling-icon {
	display: inline-flex;
	align-items: center;
}

.nuclen-polling-icon .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	transition: color 0.3s ease;
}

.nuclen-polling-indicator.active .nuclen-polling-icon .dashicons {
	color: #4caf50;
}

.nuclen-polling-icon.spin .dashicons {
	animation: spin 2s linear infinite;
}

/* Make the active indicator's icon more visible */
.nuclen-polling-indicator.active .nuclen-polling-icon.spin .dashicons {
	color: #2e7d32;
	font-weight: bold;
}

.nuclen-polling-text {
	font-weight: 500;
}

.nuclen-polling-countdown {
	font-size: 13px;
	color: #8c8f94;
	margin-left: 8px;
	padding-left: 8px;
	border-left: 2px solid #dcdcde;
	font-weight: 600;
}

.nuclen-polling-indicator.active .nuclen-polling-countdown {
	color: #2e7d32;
	border-left-color: #4caf50;
	font-weight: 700;
}

/* Auto-refresh notification banner */
.nuclen-auto-refresh-banner {
	position: fixed;
	top: 50px;
	right: 20px;
	z-index: 1000;
	background: #4caf50;
	color: white;
	padding: 10px 16px;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	opacity: 0;
	transform: translateX(20px);
	transition: all 0.3s ease;
	pointer-events: none;
	max-width: 320px;
}

.nuclen-auto-refresh-banner.show {
	opacity: 1;
	transform: translateX(0);
	pointer-events: auto;
}

.nuclen-auto-refresh-banner .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	animation: spin 2s linear infinite;
}

/* Adjust banner position on smaller screens */
@media screen and (max-width: 782px) {
	.nuclen-auto-refresh-banner {
		top: 46px;
		right: 10px;
		font-size: 12px;
		padding: 8px 12px;
		max-width: 280px;
	}
}

/* Update animation for spinning icon */
@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/*--------------------------------------------------------------
# Summary Format Fields - Metabox Styling
--------------------------------------------------------------*/
.nuclen-summary-format-fields {
	margin: 15px 0;
}

.nuclen-summary-format-fields p {
	margin: 10px 0 5px 0;
}

.nuclen-summary-format-fields select {
	min-width: 150px;
}

.nuclen-summary-format-fields .nuclen-summary-paragraph-options,
.nuclen-summary-format-fields .nuclen-summary-bullet-options {
	margin-top: 10px;
}

/* Ensure proper spacing in metabox context */
#nuclen-summary-data-meta-box .nuclen-summary-format-fields {
	border-top: 1px solid #ddd;
	padding-top: 15px;
	margin-top: 10px;
}

/* Style for the generate button row */
#nuclen-summary-data-meta-box > div:nth-child(2) {
	margin-bottom: 15px;
}
