/**
 * RMS frontend styles.
 */

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

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

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

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

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

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

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

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

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

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

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

.rms-step {
	flex: 1 1 auto;
	background: #f3f4f6;
	border: 1px solid #cfd4d9;
	color: #444;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 14px;
	border-radius: 4px;
}
.rms-step.is-active {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

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

.rms-source { display: none; padding: 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 4px; margin-bottom: 12px; }
.rms-source.is-visible { display: block; }

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

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

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

.rms-preview img {
	max-height: 90px;
	margin-left: 8px;
	vertical-align: middle;
	border-radius: 4px;
}
.rms-preview-gallery-wrap {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-left: 8px;
	vertical-align: middle;
}
.rms-preview-gallery-wrap img {
	margin-left: 0;
	max-height: 60px;
}
.rms-preview-file-wrap {
	display: inline-block;
	margin-left: 8px;
	font-size: 13px;
	color: #2271b1;
}
.rms-preview-file-wrap a { color: inherit; }

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

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

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

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

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

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

/* ---------- Select2 polish to match form ---------- */
.rms-form .select2-container--default .select2-selection--multiple {
	border-color: #cfd4d9;
	border-radius: 4px;
	min-height: 38px;
	padding: 2px 4px;
}
.rms-form .select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: #2271b1;
}
.rms-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 */
.rms-csv-wrap {
	max-width: 100%;
}

.rms-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;
}
.rms-csv-template-box strong { color: #1f7a3a; }
.rms-csv-template-box span { color: #4b5563; flex: 1 1 auto; min-width: 200px; }
.rms-csv-template-link { white-space: nowrap; }

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

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

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

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

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

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

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

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

.rms-source-cell strong {
	display: block;
	font-size: 12px;
	color: #4b5563;
	margin-bottom: 4px;
}
.rms-source-field {
	margin-bottom: 6px;
}
.rms-source-field label {
	display: block;
	font-size: 11px;
	color: #6b7280;
	margin-bottom: 2px;
	font-weight: 500;
}
.rms-source-empty,
.rms-upload-empty { color: #9ca3af; }
.rms-upload-note {
	display: inline-block;
	margin-top: 2px;
	font-size: 11px;
	color: #4b5563;
}

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

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

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

/* Media picker (single + gallery) inside source cells */
.rms-media-picker {
	font-size: 12px;
}
.rms-media-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
}
.rms-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;
}
.rms-media-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.rms-media-clear {
	color: #c0392b;
	font-size: 16px;
	line-height: 1;
	background: transparent;
	border: 0;
	cursor: pointer;
	padding: 2px 6px;
}
.rms-media-clear:hover { color: #fff; background: #c0392b; border-radius: 3px; }

/* Product search (Select2) inside source cells */
.rms-source-field .rms-product-search,
.rms-source-field .select2-container {
	width: 100% !important;
	min-width: 220px;
}
.rms-source-field .select2-container .select2-selection--multiple {
	min-height: 32px;
	border-color: #cfd4d9;
	border-radius: 3px;
}
.rms-source-field .select2-container--default .select2-selection--multiple .select2-selection__choice {
	font-size: 12px;
	padding: 1px 6px;
	margin-top: 3px;
}
.rms-source-field .select2-search--inline .select2-search__field {
	font-size: 12px;
}

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

/* Submission form layout with live preview pane */
.rms-submit-wrap {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	max-width: 1200px;
	margin: 0 auto;
}
.rms-submit-wrap > .rms-form { 
	flex: 1 1 auto; min-width: 0; 
	border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 30px;
  background: #fff;
  width: 100%;
}
.rms-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;
}
.rms-preview-pane.is-collapsed .rms-preview-card { display: none; }
.rms-preview-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid #e5e7eb;
}
.rms-preview-title { font-weight: 600; color: #4b5563; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.rms-preview-toggle { color: #2271b1; cursor: pointer; background: transparent; border: 0; }

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

.rms-preview-type-badge {
	display: inline-block;
	background: #e0e7ff;
	color: #3730a3;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	align-self: flex-start;
}

.rms-preview-media { min-height: 0; }
.rms-preview-image { width: 100%; height: auto; border-radius: 4px; }
.rms-preview-embed {
	position: relative; padding-top: 56.25%; height: 0; overflow: hidden;
	border-radius: 4px;
}
.rms-preview-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.rms-preview-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rms-preview-gallery img { width: 100%; height: 80px; object-fit: cover; border-radius: 3px; }
.rms-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;
}
.rms-preview-link a { word-break: break-all; }
.rms-preview-file { background: #f3f4f6; padding: 8px 10px; border-radius: 3px; font-size: 13px; }
.rms-preview-list { padding-left: 18px; margin: 0; }

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

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

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

.rms-csv-modal {
	display: none;
	position: fixed; inset: 0; z-index: 100050;
	align-items: center; justify-content: center;
}
.rms-csv-modal:not([hidden]) {
	display: flex;
}
.rms-csv-modal[hidden] { display: none !important; }
.rms-csv-modal-backdrop {
	position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.rms-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);
}
.rms-csv-modal-header,
.rms-csv-modal-footer {
	padding: 12px 16px;
	display: flex; align-items: center; justify-content: space-between;
}
.rms-csv-modal-header { border-bottom: 1px solid #e5e7eb; }
.rms-csv-modal-footer { border-top: 1px solid #e5e7eb; gap: 8px; justify-content: flex-end; }
.rms-csv-modal-header h2 { margin: 0; font-size: 16px; }
.rms-csv-modal-close {
	background: transparent; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: #6b7280;
}
.rms-csv-modal-body { padding: 14px 16px; overflow-y: auto; }
.rms-csv-modal-summary { font-weight: 600; margin: 0 0 12px 0; }

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

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

/* Shared badges for frontend (echo of admin) */
.rms-badge {
	display: inline-block; font-size: 11px; font-weight: 600;
	padding: 2px 8px; border-radius: 999px;
	text-transform: uppercase; letter-spacing: 0.04em;
}
.rms-badge-approved { background: #d1f2dc; color: #1f7a3a; }
.rms-badge-rejected { background: #fde2e1; color: #842029; }
.rms-badge-pending  { background: #fff3cd; color: #856404; }
.rms-badge-error    { background: #fde2e1; color: #842029; }
.rms-badge-type     { background: #e0e7ff; color: #3730a3; }
.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;
}
