/*
 * Banners-specific styling for admin and frontend flows.
 * Updated 2026-02-28: Add helper styles for the new Banners tab and hidden banner marker.
 * Updated 2026-02-28: Complete UX refactor following Laws of UX — improved visual hierarchy, spacing, accessibility, and responsive design.
 * Updated 2026-02-28: Refined button spacing (margin-top: 12px) and editor shadows for better visual consistency.
 */

/* ========================================================
   HIDDEN BANNER MARKER (FRONTEND)
   ======================================================== */

.hidden-banner {
	display: none;
}

/* ========================================================
   BANNERS TAB CONTROLS
   ======================================================== */

.sytehero-banners-box {
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-lg, 20px);
}

.sytehero-banners-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: var(--sytehero-space-md, 16px);
	flex-wrap: wrap;
}

/* Updated 2026-03-02: Proper spacing between tab list and Add Banner button to prevent overlap. */
.sytehero-banners-tab-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sytehero-space-md, 16px);
	margin-top: var(--sytehero-space-xs, 4px);
}

.sytehero-banners-tabs {
	display: flex;
	gap: var(--sytehero-space-sm, 8px);
	flex-wrap: wrap;
}

.sytehero-banners-tab {
	background: var(--sytehero-color-bg-gray-50, #eef2f7);
	border: 1px solid var(--sytehero-color-border-light, #e2e8f0);
	border-radius: 999px;
	padding: 6px 16px;
	font-size: 12px;
	font-weight: 600;
	color: var(--sytehero-color-text-secondary, #475569);
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.sytehero-banners-tab.is-active {
	background: var(--sytehero-color-primary);
	color: #fff;
	border-color: var(--sytehero-color-primary);
}

.sytehero-banners-tab:focus-visible {
	outline: 2px solid var(--sytehero-color-primary);
	outline-offset: 2px;
}

/* Updated 2026-03-16: Visual indicator for schedule-linked banner tabs. */
.sytehero-banners-tab__linked-badge {
	font-size: 14px;
	width: 14px;
	height: 14px;
	margin-left: 4px;
	vertical-align: middle;
	color: var(--sytehero-color-primary);
}

.sytehero-banners-tab-add {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	margin: 0;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--sytehero-color-border-light, #e2e8f0);
	color: var(--sytehero-color-text, #0f172a);
	font-weight: 600;
	flex-shrink: 0;
}

.sytehero-banners-tab-add:hover {
	border-color: var(--sytehero-color-primary);
	color: var(--sytehero-color-primary);
}

.sytehero-banners-tab-add .dashicons {
	font-size: 16px;
}

.sytehero-banner-pane {
	display: none;
	margin-top: var(--sytehero-space-lg, 24px);
	padding-top: var(--sytehero-space-lg, 24px);
	border-top: 1px solid var(--sytehero-color-border-light, #e2e8f0);
}

.sytehero-banner-pane.is-active {
	display: block;
}

.sytehero-banner-pane__label {
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-xs, 4px);
}

.sytehero-banner-pane__label input {
	max-width: 320px;
}

/* ========================================================
   STATUS INDICATOR: ENHANCED DESIGN
   Laws of UX: Visual hierarchy, accessibility (color + icon + text)
   Updated 2026-02-28: Enhanced icon sizing
   ======================================================== */

/* Updated 2026-03-02: Remove banner status shadow so the area matches the flat card design. */
.sytehero-banners-status {
	margin: var(--sytehero-space-2xl, 24px) 0;
	padding: var(--sytehero-space-lg, 16px) var(--sytehero-space-xl, 20px);
	border-radius: var(--sytehero-radius-2xl, 12px);
	display: flex;
	align-items: flex-start;
	gap: var(--sytehero-space-md, 12px);
	box-shadow: none;
	transition: all 200ms ease;
}

.sytehero-banners-status--live {
	background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
	border: 2px solid #28a745;
	color: #155724;
}

.sytehero-banners-status--off {
	background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
	border: 2px solid #ffc107;
	color: #856404;
}

.sytehero-banners-status__icon {
	/* Updated 2026-03-02: Remove the icon shadow so the banner elements stay flat. */
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: none;
}

.sytehero-banners-status--live .sytehero-banners-status__icon {
	color: #28a745;
}

.sytehero-banners-status--off .sytehero-banners-status__icon {
	color: #ffc107;
}

.sytehero-banners-status__icon .dashicons {
	width: 22px !important;
	height: 22px !important;
	font-size: 22px !important;
	line-height: 1 !important;
	margin: 0 !important;
}

.sytehero-banners-status__content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-xs, 4px);
	padding-top: var(--sytehero-space-xs, 4px);
}

.sytehero-banners-status__title {
	font-size: var(--sytehero-font-lg, 15px);
	font-weight: 600;
	line-height: var(--sytehero-line-height-tight, 1.3);
	margin: 0;
}

.sytehero-banners-status__message {
	font-size: var(--sytehero-font-base, 13px);
	line-height: var(--sytehero-line-height-base, 1.5);
	opacity: 0.9;
}

/* Updated 2026-02-28: Highlight mapped sale labels in the status card. */
.sytehero-banners-status__message--sale {
	font-weight: 600;
	letter-spacing: 0.01em;
}

/* Updated 2026-02-28: Call out the scheduled window line in compact text. */
.sytehero-banners-status__message--window {
	font-size: 12px;
	line-height: 1.4;
	opacity: 0.8;
	text-transform: none;
}

/* ========================================================
   DATETIME FIELD: IMPROVED LAYOUT & TOUCH TARGETS
   Laws of UX: Fitts's Law (larger buttons), visual grouping
   Updated 2026-02-28: Enhanced button spacing and icon alignment
   ======================================================== */

.sytehero-datetime-field {
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-md, 12px);
	max-width: 520px;
}

.sytehero-datetime-input {
	width: 100%;
	max-width: 100%;
	min-height: 40px;
	padding: 10px 14px;
	font-size: 15px;
	line-height: var(--sytehero-line-height-base, 1.5);
	border: 1px solid var(--sytehero-color-border-medium, #94a3b8);
	border-radius: var(--sytehero-radius-lg, 8px);
	box-sizing: border-box;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}

.sytehero-datetime-input:focus {
	border-color: var(--sytehero-color-primary);
	outline: none;
	box-shadow: 0 0 0 1px var(--sytehero-color-primary);
}

.sytehero-datetime-buttons {
	display: flex;
	gap: var(--sytehero-space-sm, 8px);
	flex-wrap: wrap;
	/* Updated 2026-02-28: Added consistent spacing above the datetime button group. */
	margin-top: 12px !important;
}

.sytehero-datetime-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sytehero-space-xs, 4px);
	padding: 6px var(--sytehero-space-lg, 16px) !important;
	font-size: var(--sytehero-font-base, 13px);
	line-height: var(--sytehero-line-height-base, 1.5) !important;
	min-height: 32px;
	border-radius: var(--sytehero-radius-md, 4px);
	cursor: pointer;
	vertical-align: middle;
	transition: background-color var(--sytehero-transition-base, 150ms ease),
	            border-color var(--sytehero-transition-base, 150ms ease),
	            transform var(--sytehero-transition-fast, 100ms ease),
	            box-shadow var(--sytehero-transition-base, 150ms ease);
}

.sytehero-datetime-btn:hover {
	transform: translateY(-1px);
	box-shadow: none;
}

.sytehero-datetime-btn:active {
	transform: translateY(0);
}

.sytehero-datetime-btn .dashicons {
	font-size: 18px !important;
	width: 18px !important;
	height: 18px !important;
	line-height: 1 !important;
	margin: 0 !important;
	flex-shrink: 0;
}

/* ========================================================
   FORM ACTIONS: IMPROVED BUTTON GROUP
   Laws of UX: Fitts's Law, visual hierarchy (primary vs secondary)
   Updated 2026-03-01: Unified button system with hover effects
   ======================================================== */

.sytehero-banners-actions {
	margin-top: var(--sytehero-space-3xl, 32px);
	padding-top: var(--sytehero-space-2xl, 24px);
	border-top: 1px solid var(--sytehero-color-border-lighter, #e8eaed);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--sytehero-space-md, 12px);
}

.sytehero-banners-actions .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sytehero-space-xs, 4px);
	min-height: 36px;
	padding: 8px var(--sytehero-space-xl, 20px) !important;
	line-height: var(--sytehero-line-height-base, 1.5) !important;
	vertical-align: middle;
	border-radius: var(--sytehero-radius-md, 4px);
	transition: background-color var(--sytehero-transition-base, 150ms ease),
	            border-color var(--sytehero-transition-base, 150ms ease),
	            transform var(--sytehero-transition-fast, 100ms ease),
	            box-shadow var(--sytehero-transition-base, 150ms ease);
}

.sytehero-banners-actions .button:hover {
	transform: translateY(-1px);
	box-shadow: none;
}

.sytehero-banners-actions .button:active {
	transform: translateY(0);
}

.sytehero-banners-actions .button .dashicons {
	font-size: 18px !important;
	width: 18px !important;
	height: 18px !important;
	line-height: 1 !important;
	margin: 0 !important;
	flex-shrink: 0;
}

.sytehero-banners-actions .button-primary {
	font-weight: 600;
}

/* ========================================================
   BANNER EDITOR: CONSISTENT SPACING
   Updated 2026-02-28: Enhanced shadows for better visual depth
   ======================================================== */

.sytehero-banners-editor {
	max-width: 100%;
}

.sytehero-banners-editor .wp-editor-wrap {
	border-radius: 0;
	overflow: hidden;
	/* Updated 2026-03-02: Remove the elevated border/shadow surrounding the Banners editor. */
	box-shadow: none !important;
	border: none !important;
}

/* Updated 2026-02-28: Hide WP editor toolbar borders/shadows so boxes appear clean. */
.sytehero-banners-editor .wp-editor-tools,
.sytehero-banners-editor .wp-editor-tools .wp-editor-tabs,
.sytehero-banners-editor .wp-editor-tools .wp-media-buttons {
	border: none !important;
	box-shadow: none !important;
	background: transparent !important;
}

.sytehero-banners-editor textarea.wp-editor-area {
	/* Updated 2026-03-02: Keep the textarea flat with no shadow/border. */
	box-shadow: none !important;
	border: none !important;
}

/* ========================================================
   SHORTCODE SECTION: IMPROVED COPY UX
   Laws of UX: Fitts's Law (larger copy button), immediate feedback
   Updated 2026-02-28: Enhanced button alignment
   ======================================================== */

.sytehero-banners-shortcode-wrapper {
	display: flex;
	align-items: center;
	gap: var(--sytehero-space-md, 12px);
	flex-wrap: wrap;
	margin-top: var(--sytehero-space-md, 12px);
	padding: var(--sytehero-space-lg, 16px);
	background: var(--sytehero-color-bg-gray-50, #eef2f7);
	border: 1px solid var(--sytehero-color-border-light, #e2e8f0);
	border-radius: 0;
}

.sytehero-banners-shortcode {
	font-family: var(--sytehero-font-mono);
	font-size: var(--sytehero-font-md, 14px);
	line-height: var(--sytehero-line-height-base, 1.5);
	padding: var(--sytehero-space-xs, 4px) var(--sytehero-space-sm, 8px);
	background: #fff;
	border: 1px solid var(--sytehero-color-border, #cbd5e1);
	border-radius: 0;
	user-select: all;
}

.sytehero-banners-shortcode-wrapper .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sytehero-space-xs, 4px);
	min-height: 32px;
	padding: 6px var(--sytehero-space-lg, 16px) !important;
	line-height: var(--sytehero-line-height-base, 1.5) !important;
	vertical-align: middle;
	border-radius: var(--sytehero-radius-md, 4px);
	transition: background-color var(--sytehero-transition-base, 150ms ease),
	            border-color var(--sytehero-transition-base, 150ms ease),
	            transform var(--sytehero-transition-fast, 100ms ease),
	            box-shadow var(--sytehero-transition-base, 150ms ease);
}

.sytehero-banners-shortcode-wrapper .button:hover {
	transform: translateY(-1px);
	box-shadow: none;
}

.sytehero-banners-shortcode-wrapper .button:active {
	transform: translateY(0);
}

.sytehero-banners-shortcode-wrapper .button .dashicons {
	font-size: 18px !important;
	width: 18px !important;
	height: 18px !important;
	line-height: 1 !important;
	margin: 0 !important;
	flex-shrink: 0;
}

.sytehero-banners-copy-status {
	font-size: var(--sytehero-font-sm, 12px);
	font-weight: 600;
	color: #28a745;
	line-height: var(--sytehero-line-height-base, 1.5);
	opacity: 0;
	transition: opacity 200ms ease;
	align-self: center;
}

.sytehero-banners-copy-status.is-visible {
	opacity: 1;
}

/* ========================================================
   SECTION HEADINGS: CONSISTENT SPACING
   Using project's established heading pattern
   Updated 2026-02-28: Standardized spacing for headings and dividers
   ======================================================== */

.sytehero-admin .sytehero-admin-box h3.sytehero-heading {
	font-size: var(--sytehero-font-lg, 15px);
	font-weight: 600;
	color: var(--sytehero-color-text, #0f172a);
	margin-top: var(--sytehero-space-3xl, 32px);
	margin-bottom: var(--sytehero-space-lg, 16px);
	padding-top: var(--sytehero-space-lg, 16px);
	border-top: 1px solid var(--sytehero-color-border-light, #e2e8f0);
	line-height: var(--sytehero-line-height-tight, 1.3);
}

/* Updated 2026-02-28: First heading has consistent top spacing without border. */
.sytehero-admin .sytehero-admin-box h3.sytehero-heading:first-of-type,
.sytehero-admin .sytehero-admin-box h2.sytehero-heading:first-of-type {
	margin-top: 0 !important;
	padding-top: 0 !important;
	border-top: none !important;
}

/* Updated 2026-02-28: H2 headings in admin boxes should have same spacing pattern. */
.sytehero-admin .sytehero-admin-box h2.sytehero-heading {
	font-size: var(--sytehero-font-xl, 16px);
	font-weight: 600;
	color: var(--sytehero-color-text, #0f172a);
	margin-top: var(--sytehero-space-3xl, 32px);
	margin-bottom: var(--sytehero-space-lg, 16px);
	padding-top: var(--sytehero-space-lg, 16px);
	border-top: 1px solid var(--sytehero-color-border-light, #e2e8f0);
	line-height: var(--sytehero-line-height-tight, 1.3);
}

/* Updated 2026-02-28: Consistent spacing for description text after headings. */
.sytehero-admin .sytehero-admin-box h2.sytehero-heading + p.description,
.sytehero-admin .sytehero-admin-box h3.sytehero-heading + p.description {
	margin-top: var(--sytehero-space-sm, 8px) !important;
	margin-bottom: var(--sytehero-space-lg, 16px) !important;
}

/* Updated 2026-02-28: Add sale matcher helper and modal presentation. */
.sytehero-sale-sync {
	margin-top: var(--sytehero-space-lg, 16px);
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-xs, 4px);
}

.sytehero-sale-sync .sytehero-match-sale-dates {
	display: inline-flex;
	align-items: center;
	gap: var(--sytehero-space-xs, 4px);
}

.sytehero-sale-matcher-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: var(--sytehero-z-modal, 600);
}

body.sytehero-sale-matcher-open {
	overflow: hidden;
}

.sytehero-sale-matcher-modal.is-open {
	display: flex;
}

.sytehero-sale-matcher-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.50);
	backdrop-filter: blur(2px);
}

.sytehero-sale-matcher-modal__panel {
	position: relative;
	background: var(--sytehero-color-bg-white, #fff);
	padding: var(--sytehero-space-lg, 16px);
	border-radius: var(--sytehero-radius-xl, 8px);
	width: min(520px, 100%);
	box-shadow: var(--sytehero-shadow-xl, 0 24px 64px rgba(0, 0, 0, 0.35));
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-md, 12px);
	animation: sytehero-modal-enter var(--sytehero-transition-slow, 200ms ease);
}

.sytehero-sale-matcher-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sytehero-space-md, 12px);
}

.sytehero-sale-matcher-modal__close {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: inherit;
}

.sytehero-sale-matcher-modal__tabs {
	display: flex;
	gap: var(--sytehero-space-sm, 8px);
}

.sytehero-sale-matcher-modal__tabs button {
	background: var(--sytehero-color-bg-gray-50, #eef2f7);
	border: 1px solid var(--sytehero-color-border-light, #e2e8f0);
	border-radius: 999px;
	padding: 6px 16px;
	cursor: pointer;
	font-size: var(--sytehero-font-sm, 12px);
	font-weight: 600;
}

.sytehero-sale-matcher-modal__tabs button.is-active {
	background: var(--sytehero-color-primary);
	color: #fff;
	border-color: var(--sytehero-color-primary);
}

.sytehero-sale-matcher-modal__feedback {
	font-size: var(--sytehero-font-sm, 12px);
	color: var(--sytehero-color-text-tertiary, #64748b);
	min-height: 20px;
}

.sytehero-sale-matcher-modal__loading,
.sytehero-sale-matcher-modal__error {
	display: block;
}

.sytehero-sale-matcher-modal__error {
	color: #c00;
}

.sytehero-sale-matcher-modal__panels {
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-md, 12px);
}

.sytehero-sale-matcher-modal__tab-panel {
	display: none;
}

.sytehero-sale-matcher-modal__tab-panel.is-active {
	display: block;
}

.sytehero-sale-matcher-modal__list {
	display: flex;
	flex-direction: column;
	gap: var(--sytehero-space-sm, 8px);
	max-height: 320px;
	overflow: auto;
}

.sytehero-sale-matcher-modal__empty {
	font-size: var(--sytehero-font-sm, 12px);
	color: var(--sytehero-color-text-tertiary, #64748b);
}

.sytehero-sale-matcher-item {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--sytehero-space-xs, 3px);
	padding: var(--sytehero-space-sm, 8px) var(--sytehero-space-md, 12px);
	border: 1px solid #e2e4e7;
	border-radius: 0;
	background: #fff;
	text-align: left;
	cursor: pointer;
}

.sytehero-sale-matcher-item:hover,
.sytehero-sale-matcher-item:focus-visible {
	border-color: var(--sytehero-color-primary);
	box-shadow: none;
}

.sytehero-sale-matcher-item__title {
	font-weight: 600;
	font-size: var(--sytehero-font-sm, 12px);
}

.sytehero-sale-matcher-item__meta {
	font-size: var(--sytehero-font-xs, 11px);
	color: var(--sytehero-color-text-secondary, #475569);
	display: flex;
	flex-wrap: wrap;
	gap: var(--sytehero-space-xs, 4px);
}

.sytehero-sale-matcher-item__message {
	font-size: var(--sytehero-font-xs, 11px);
	color: var(--sytehero-color-text, #0f172a);
	margin-top: 2px;
	line-height: 1.4;
}

.sytehero-sale-matcher-item__status {
	font-size: var(--sytehero-font-xs, 11px);
	color: var(--sytehero-color-primary);
	font-weight: 500;
}

/* ========================================================
   RESPONSIVE BREAKPOINTS
   Laws of UX: Mobile-first, touch-friendly on all devices
   Updated 2026-02-28: Consistent button sizing on mobile
   ======================================================== */

@media (max-width: 782px) {
	.sytehero-banners-status {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--sytehero-space-md, 12px);
	}

	.sytehero-banners-status__icon {
		width: 32px;
		height: 32px;
	}

	.sytehero-banners-status__icon .dashicons {
		width: 20px !important;
		height: 20px !important;
		font-size: 20px !important;
	}

	.sytehero-datetime-field {
		max-width: 100%;
	}

	.sytehero-datetime-buttons {
		width: 100%;
	}

	.sytehero-datetime-btn {
		flex: 1;
		justify-content: center;
		min-width: 0;
	}

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

	.sytehero-banners-actions .button {
		width: 100%;
		justify-content: center;
	}

	.sytehero-banners-shortcode-wrapper {
		flex-direction: column;
		align-items: stretch;
	}

	.sytehero-banners-shortcode-wrapper .button {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 600px) {
	.sytehero-banners-status {
		padding: var(--sytehero-space-md, 12px) var(--sytehero-space-lg, 16px);
	}

	.sytehero-datetime-buttons {
		flex-direction: column;
	}

	.sytehero-datetime-btn {
		width: 100%;
	}
}

.sytehero-banners-shortcode-slug {
	margin-top: 12px;
}

.sytehero-banners-shortcode-slug > label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.sytehero-banners-shortcode-slug__control {
	display: flex;
	align-items: stretch;
}

.sytehero-banners-shortcode-slug__prefix {
	display: inline-flex;
	align-items: center;
	padding: 0 8px;
	background: #f0f0f1;
	border: 1px solid #8c8f94;
	border-right: 0;
	border-radius: 4px 0 0 4px;
	font-family: Consolas, Monaco, monospace;
	color: #50575e;
	white-space: nowrap;
}

.sytehero-banners-shortcode-slug__input.regular-text {
	border-radius: 0 4px 4px 0;
	margin: 0;
	flex: 1 1 auto;
}

.sytehero-banners-shortcode-slug__input.is-invalid {
	border-color: #d63638;
	box-shadow: 0 0 0 1px #d63638;
}

.sytehero-banners-shortcode-slug__error {
	margin: 4px 0 0;
	color: #d63638;
}
