/**
 * NMS frontend styles.
 */

.nms-form,
.nms-csv-wrap {
	max-width: 820px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.nms-form label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
	font-size: 14px;
}

.nms-form input[type="text"],
.nms-form input[type="url"],
.nms-form input[type="date"],
.nms-form select,
.nms-form textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #cfd4d9;
	border-radius: 4px;
	box-sizing: border-box;
	font-size: 14px;
}

.nms-form textarea { font-family: inherit; }

.nms-form .required { color: #c00; }

.nms-form .nms-has-error input,
.nms-form .nms-has-error select,
.nms-form .nms-has-error textarea {
	border-color: #c0392b;
	background: #fff5f5;
}

.nms-form .nms-field-error {
	color: #c0392b;
	font-size: 12px;
	margin-top: 4px;
	display: block;
}

.nms-has-error input,
.nms-has-error textarea,
.nms-has-error select {
	border-color: #dc3232 !important;
}

.nms-field-error {
	display: block;
	margin-top: 5px;
	color: #dc3232;
	font-size: 13px;
	font-weight: 500;
}

input.nms-has-error,
textarea.nms-has-error,
select.nms-has-error {
	border-color: #dc3232 !important;
}

.nms-steps {
	display: flex;
	gap: 4px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.nms-step {
	flex: 1 1 auto;
	background: #f3f4f6;
	border: 1px solid #cfd4d9;
	color: #444;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 14px;
	border-radius: 4px;
}
.nms-editor-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 4px 0 6px;
	flex-wrap: wrap;
}
.nms-insert-media {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
}
.nms-insert-media .dashicons {
	font-size: 17px;
	width: 17px;
	height: 17px;
	line-height: 1;
}
/* Images dropped into the story shouldn't overflow the editor or the
   live preview. */
.nms-form .wp-editor-container img,
.nms-preview-desc img { max-width: 100%; height: auto; }
.nms-preview-desc img { margin: 6px 0; border-radius: 3px; }

.nms-step:hover { background: #e8eaed; }
.nms-step.is-active {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}
.nms-step.is-active:hover { background: #1b5e8f; }

/* A step holding an unresolved error, so a problem on a hidden pane is
   still visible from the tab strip. */
.nms-step-error {
	border-color: #c0392b;
	box-shadow: inset 0 -3px 0 #c0392b;
}
/* A blocked forward jump: brief nudge so the click clearly registered. */
@keyframes nms-nudge {
	0%, 100% { transform: translateX(0); }
	25%      { transform: translateX(-3px); }
	75%      { transform: translateX(3px); }
}
.nms-step-blocked { animation: nms-nudge 180ms ease-in-out 2; }
@media (prefers-reduced-motion: reduce) {
	.nms-step-blocked { animation: none; }
}
.nms-step-error::after {
	content: " !";
	font-weight: 700;
	color: #c0392b;
}
.nms-step-error.is-active::after { color: #ffd9d4; }
.nms-step:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.nms-pane { display: none; }
.nms-pane.is-active { display: block; }

.nms-step-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 16px;
	gap: 8px;
}

.nms-status-bar {
	margin-top: 12px;
	font-size: 13px;
	color: #555;
	display: flex;
	gap: 16px;
	align-items: center;
}

.nms-message {
	font-weight: 600;
}
.nms-message.is-success { color: #1f7a3a; }
.nms-message.is-error { color: #c0392b; }

.nms-preview img {
	max-height: 90px;
	margin-left: 8px;
	vertical-align: middle;
	border-radius: 4px;
}

.nms-notice {
	padding: 10px 14px;
	border-radius: 4px;
	margin: 12px 0;
}
.nms-notice-info { background: #e8f4fd; border: 1px solid #2271b1; }
.nms-notice-error { background: #fde8e8; border: 1px solid #c0392b; color: #7a1a13; }

/* ---------- Char counter ---------- */
.nms-char-counter {
	display: block;
	text-align: right;
	font-size: 12px;
	color: #6b7280;
	margin-top: 4px;
}
.nms-char-counter.is-over { color: #c0392b; font-weight: 600; }

/* ---------- Field hints ---------- */
.nms-field-hint {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: #6b7280;
	font-style: italic;
}

/* ---------- Submission status widget (My Submissions) ---------- */
.nms-my-submissions {
	max-width: 1200px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.nms-my-submissions-header {
	display: flex; justify-content: space-between; align-items: center;
	gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.nms-my-submissions-header h2 { margin: 0; font-size: 20px; }
.nms-my-submissions-filters {
	display: flex; gap: 6px; flex-wrap: wrap;
}
.nms-filter-pill {
	background: #f3f4f6;
	border: 1px solid #cfd4d9;
	color: #444;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 13px;
	cursor: pointer;
	text-decoration: none;
}
.nms-filter-pill.is-active {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

/* Reviewer scope toggle (All / Mine) */
.nms-my-submissions-scope {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin: 4px 0 12px;
}
.nms-scope-pill {
	background: #fff;
	border: 1px solid #cfd4d9;
	color: #555;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	text-decoration: none;
	font-weight: 500;
}
.nms-scope-pill.is-active {
	background: #111827;
	border-color: #111827;
	color: #fff;
}
.nms-my-submissions-table .nms-sub-actions button {
	margin-right: 6px;
	padding: 4px 10px;
	font-size: 13px;
	cursor: pointer;
}
.nms-my-submissions-table .nms-sub-actions button[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}
.nms-sub-action-msg {
	display: inline-block;
	margin-left: 6px;
	font-size: 12px;
}
.nms-sub-action-msg.is-success { color: #1f7a3a; }
.nms-sub-action-msg.is-error   { color: #c0392b; }
.nms-my-submissions-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
}
.nms-my-submissions-table th,
.nms-my-submissions-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
	font-size: 14px;
	vertical-align: top;
}
.nms-my-submissions-table th {
	background: #f8f9fa;
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	color: #4b5563;
	letter-spacing: 0.04em;
}
.nms-my-submissions-table tr:last-child td { border-bottom: 0; }
.nms-my-submissions-table .nms-sub-title { font-weight: 600; color: #111; }
.nms-my-submissions-table .nms-sub-actions a {
	margin-right: 8px;
	text-decoration: none;
}
.nms-my-submissions-empty {
	text-align: center;
	padding: 40px 16px;
	color: #6b7280;
	background: #fff;
	border: 1px dashed #cfd4d9;
	border-radius: 6px;
}
.nms-my-submissions-note {
	background: #fff5f5;
	border: 1px solid #f5c2c0;
	color: #842029;
	padding: 8px 10px;
	border-radius: 4px;
	margin-top: 6px;
	font-size: 13px;
}
.nms-pagination {
	margin-top: 14px;
	display: flex;
	gap: 6px;
	justify-content: center;
	flex-wrap: wrap;
}
.nms-pagination a,
.nms-pagination span {
	padding: 5px 10px;
	border: 1px solid #cfd4d9;
	border-radius: 4px;
	font-size: 13px;
	text-decoration: none;
	color: #2271b1;
	background: #fff;
}
.nms-pagination .current {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* ---------- TinyMCE inside the form ---------- */
.nms-form .wp-editor-wrap {
	margin-top: 4px;
}
.nms-form .wp-editor-container {
	border: 1px solid #cfd4d9;
	border-radius: 4px;
	overflow: hidden;
}
.nms-form .mce-toolbar-grp,
.nms-form .mce-statusbar {
	background: #f8f9fa !important;
}
.nms-form .quicktags-toolbar { background: #f8f9fa; }
.nms-form .wp-switch-editor {
	border-color: #cfd4d9;
	border-bottom: none;
	background: #f3f4f6;
}

/* ---------- Select2 polish to match form ---------- */
.nms-form .select2-container--default .select2-selection--multiple {
	border-color: #cfd4d9;
	border-radius: 4px;
	min-height: 38px;
	padding: 2px 4px;
}
.nms-form .select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: #2271b1;
}
.nms-form .select2-container--default .select2-selection--multiple .select2-selection__choice {
	background: #e0e7ff;
	color: #3730a3;
	border: 0;
	padding: 2px 8px;
	margin-top: 4px;
	font-size: 13px;
	border-radius: 3px;
}

/* ---------- Fix: WP media modal "Upload Files" tab visibility ---------- *
 * Some frontend themes inherit a transparent or low-contrast colour onto
 * the .media-menu buttons; force the WP defaults so the tab is visible
 * without needing to hover.
 */
.media-modal .media-router .media-menu-item {
	color: #2271b1 !important;
	opacity: 1 !important;
	background: transparent;
}
.media-modal .media-router .media-menu-item.active,
.media-modal .media-router .media-menu-item:hover,
.media-modal .media-router .media-menu-item:focus {
	color: #135e96 !important;
	box-shadow: inset 0 -3px #2271b1 !important;
}
.media-modal .media-frame-router { background: #f6f7f7; }

/* CSV Import */
.nms-csv-wrap {
	max-width: 100%;
}

.nms-csv-template-box {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	background: #f1f8e9;
	border: 1px solid #c5e1a5;
	border-radius: 6px;
	padding: 12px 14px;
	margin: 0 0 14px;
	font-size: 14px;
}
.nms-csv-template-box strong { color: #1f7a3a; }
.nms-csv-template-box span { color: #4b5563; flex: 1 1 auto; min-width: 200px; }
.nms-csv-template-link { white-space: nowrap; }

.nms-csv-status {
	margin: 12px 0;
	min-height: 1.4em;
	font-weight: 600;
}

.nms-csv-error-summary {
	background: #fff5f5;
	border: 1px solid #f5c2c0;
	border-radius: 4px;
	padding: 10px 14px;
	margin: 12px 0;
}
.nms-csv-error-summary h3 { margin: 0 0 6px 0; font-size: 14px; color: #842029; }
.nms-csv-error-summary ul { margin: 0; padding-left: 18px; max-height: 180px; overflow-y: auto; }
.nms-csv-error-summary a { color: #842029; text-decoration: none; }
.nms-csv-error-summary a:hover { text-decoration: underline; }

.nms-csv-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 12px 0 6px;
	flex-wrap: wrap;
}
.nms-csv-toolbar-actions { display: flex; gap: 6px; }
.nms-csv-summary { font-weight: 600; }

.nms-csv-table-wrap { overflow-x: auto; }

.nms-csv-table {
	width: 100%;
	min-width: 1100px;
	border-collapse: collapse;
	margin: 8px 0 16px;
}
.nms-csv-table th,
.nms-csv-table td {
	padding: 6px 8px;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: top;
	font-size: 13px;
	text-align: left;
}
.nms-csv-table th {
	background: #f8f9fa;
	font-weight: 600;
}
.nms-csv-table tr.nms-has-error td { background: #fff5f5; }
.nms-csv-table tr.is-new td { background: #f1f8e9; }
.nms-csv-table tr.is-new.nms-has-error td { background: #fff5f5; }
.nms-csv-table tr.nms-row-flash td { background: #fffbcc !important; transition: background 1s; }

.nms-csv-table .nms-cell {
	padding: 4px 6px;
	border: 1px solid transparent;
	min-width: 120px;
	min-height: 22px;
	border-radius: 3px;
}
.nms-csv-table .nms-cell:focus {
	border-color: #2271b1;
	background: #fff;
	outline: none;
}

.nms-csv-table .nms-input {
	width: 100%;
	padding: 4px 6px;
	font-size: 13px;
	border: 1px solid #cfd4d9;
	border-radius: 3px;
	box-sizing: border-box;
}

.nms-csv-table .col-row { width: 36px; text-align: right; color: #6b7280; }
.nms-csv-table .col-actions { width: 40px; text-align: center; }
.nms-csv-table .col-errors { width: 240px; }
.nms-csv-table .col-publish,
.nms-csv-table .col-archive { width: 130px; }

.nms-row-delete {
	color: #c0392b;
	font-size: 18px;
	line-height: 1;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 4px 8px;
}
.nms-row-delete:hover { color: #fff; background: #c0392b; border-radius: 3px; }

.nms-csv-table .nms-err {
	font-size: 12px;
	color: #842029;
	padding: 1px 0;
}

.nms-csv-table .nms-empty {
	text-align: center;
	color: #6b7280;
	padding: 24px 8px;
}

/* Media picker (single + gallery) inside source cells */

/* Product search (Select2) inside source cells */

@media (max-width: 600px) {
	.nms-steps { flex-direction: column; }
	.nms-step { text-align: left; }
}

/* Submission form layout with live preview pane */
.nms-submit-wrap {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	max-width: 1200px;
	margin: 0 auto;
}
.nms-submit-wrap > .nms-form { 
	flex: 1 1 auto; min-width: 0; 
	border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 30px;
  background: #fff;
  width: 100%;
}
.nms-preview-pane {
	flex: 0 0 360px;
	position: sticky;
	top: 24px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 14px 16px;
	font-size: 14px;
}
.nms-preview-pane.is-collapsed .nms-preview-card { display: none; }
.nms-preview-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid #e5e7eb;
}
.nms-preview-title { font-weight: 600; color: #4b5563; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.nms-preview-toggle { color: #2271b1; cursor: pointer; background: transparent; border: 0; }

.nms-preview-card { display: flex; flex-direction: column; gap: 10px; }
.nms-preview-h-title { margin: 0; font-size: 18px; line-height: 1.3; color: #111; }
.nms-preview-meta { color: #6b7280; font-size: 12px; }
.nms-preview-short { color: #374151; font-style: italic; }
.nms-preview-desc { color: #1f2937; font-size: 13px; }
.nms-preview-desc p { margin: 0 0 8px 0; }

.nms-preview-media { min-height: 0; }
.nms-preview-image { width: 100%; height: auto; border-radius: 4px; }
.nms-preview-placeholder {
	display: inline-block; padding: 24px 8px; background: #f3f4f6;
	border-radius: 3px; color: #6b7280; text-align: center; font-size: 11px;
	width: 100%; box-sizing: border-box;
}
.nms-preview-link a { word-break: break-all; }

.nms-preview-tag {
	display: inline-block; background: #f3f4f6; color: #4b5563;
	padding: 2px 8px; border-radius: 3px; font-size: 11px; margin-right: 4px;
}
.nms-preview-cats { font-size: 12px; color: #4b5563; }

@media (max-width: 900px) {
	.nms-submit-wrap { flex-direction: column; }
	.nms-preview-pane { position: static; flex: 1 1 auto; max-height: none; width: 100%; box-sizing: border-box; }
}

/* CSV preview modal + import report */
.nms-csv-pending-note {
	background: #fff3cd; border: 1px solid #ffe39a; color: #856404;
	padding: 8px 12px; border-radius: 4px; font-size: 13px; margin: 8px 0;
}

.nms-csv-modal {
	display: none;
	position: fixed; inset: 0; z-index: 100050;
	align-items: center; justify-content: center;
}
.nms-csv-modal:not([hidden]) {
	display: flex;
}
.nms-csv-modal[hidden] { display: none !important; }
.nms-csv-modal-backdrop {
	position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.nms-csv-modal-dialog {
	position: relative; background: #fff; border-radius: 6px;
	width: min(820px, 92vw); max-height: 86vh; display: flex; flex-direction: column;
	box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.nms-csv-modal-header,
.nms-csv-modal-footer {
	padding: 12px 16px;
	display: flex; align-items: center; justify-content: space-between;
}
.nms-csv-modal-header { border-bottom: 1px solid #e5e7eb; }
.nms-csv-modal-footer { border-top: 1px solid #e5e7eb; gap: 8px; justify-content: flex-end; }
.nms-csv-modal-header h2 { margin: 0; font-size: 16px; }
.nms-csv-modal-close {
	background: transparent; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #6b7280;
}
.nms-csv-modal-body { padding: 14px 16px; overflow-y: auto; }
.nms-csv-modal-summary { font-weight: 600; margin: 0 0 12px 0; }

.nms-csv-preview-list { display: flex; flex-direction: column; gap: 10px; }
.nms-csv-preview-item {
	display: flex; gap: 12px; padding: 10px; border: 1px solid #e5e7eb; border-radius: 4px; background: #fcfcfc;
}
.nms-csv-preview-item.nms-has-error { background: #fff5f5; border-color: #f5c2c0; }
.nms-csv-preview-thumb {
	flex: 0 0 64px; width: 64px; height: 64px;
	display: flex; align-items: center; justify-content: center;
	background: #f3f4f6; border-radius: 4px; overflow: hidden;
}
.nms-csv-preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nms-preview-thumb-placeholder {
	font-size: 24px; font-weight: 700; color: #9ca3af;
}
.nms-csv-preview-body { flex: 1; min-width: 0; }
.nms-csv-preview-row1 { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.nms-csv-preview-row-num { font-size: 11px; color: #6b7280; align-self: center; margin-right: 6px; }
.nms-csv-preview-body h4 { margin: 0 0 4px 0; font-size: 14px; }
.nms-csv-preview-short { color: #4b5563; font-size: 12px; margin: 2px 0; }
.nms-csv-preview-meta { font-size: 12px; color: #4b5563; margin: 2px 0; }
.nms-csv-preview-errors { margin: 6px 0 0; padding-left: 18px; color: #842029; font-size: 12px; }

.nms-csv-report {
	background: #f1f8e9; border: 1px solid #c5e1a5; border-radius: 6px;
	padding: 14px 16px; margin: 16px 0;
}
.nms-csv-report-headline { margin: 0 0 4px 0; }
.nms-csv-report-note { color: #4b5563; font-size: 13px; margin: 0 0 12px 0; }

/* Featured image picker inside the importer table */
.nms-csv-table .col-image { width: 130px; }
.nms-csv-table .col-short { min-width: 180px; }
.nms-csv-table .col-desc { min-width: 240px; }
.nms-csv-table .col-cats,
.nms-csv-table .col-tags { min-width: 150px; }
.nms-textarea {
	width: 100%;
	min-height: 48px;
	font-size: 12px;
	line-height: 1.4;
	padding: 6px;
	border: 1px solid #cfd4d9;
	border-radius: 3px;
	resize: vertical;
	font-family: inherit;
}
.nms-textarea:focus { border-color: #2271b1; outline: none; box-shadow: 0 0 0 1px #2271b1; }
.nms-csv-table .col-related { min-width: 280px; }
.nms-csv-table th.col-related { white-space: nowrap; }
.nms-csv-table .col-related .select2-container { max-width: 100%; }

.nms-related-stack {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.nms-related-field label {
	display: block;
	font-size: 11px;
	font-weight: 500;
	color: #6b7280;
	margin-bottom: 2px;
	cursor: help;
}
.nms-related-field .select2-container .select2-selection--multiple {
	min-height: 30px;
	border-color: #cfd4d9;
	border-radius: 3px;
}
.nms-related-field .select2-container--default .select2-selection--multiple .select2-selection__choice {
	font-size: 12px;
	padding: 1px 6px;
	margin-top: 3px;
}
.nms-media-picker { font-size: 12px; }
.nms-media-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
}
.nms-media-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: #f3f4f6;
	border: 1px solid #cfd4d9;
	border-radius: 3px;
	font-size: 11px;
	color: #4b5563;
	overflow: hidden;
}
.nms-media-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.nms-media-clear {
	color: #c0392b;
	font-size: 16px;
	line-height: 1;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 2px 6px;
}
.nms-media-clear:hover { color: #fff; background: #c0392b; border-radius: 3px; }
.nms-upload-note {
	display: inline-block;
	margin-top: 4px;
	font-size: 11px;
	color: #4b5563;
}

/* Shared badges for frontend (echo of admin) */
.nms-badge {
	display: inline-block; font-size: 11px; font-weight: 600;
	padding: 2px 8px; border-radius: 999px;
	text-transform: uppercase; letter-spacing: 0.04em;
}
.nms-badge-approved { background: #d1f2dc; color: #1f7a3a; }
.nms-badge-rejected { background: #fde2e1; color: #842029; }
.nms-badge-pending  { background: #fff3cd; color: #856404; }
.nms-badge-error    { background: #fde2e1; color: #842029; }
.mce-widget button {
    border: 1px solid transparent !important;
}
.mce-toolbar .mce-btn-group .mce-btn:focus, .mce-toolbar .mce-btn-group .mce-btn:hover, .qt-dfw:focus, .qt-dfw:hover {
    box-shadow: unset !important;
}
.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus, .mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover {
    border-color: transparent !important;
}
.mce-btn.mce-active button, .mce-btn.mce-active:hover button, .mce-btn.mce-active i, .mce-btn.mce-active:hover i {
    color: #000 !important;
}
