/**
 * Auction Bar Styles - Version 2.8.4
 * Premium Dashboard Design - RTL Optimized with Full-Width Header
 * Professional auction status card with proper Arabic alignment
 * 
 * @package MEC_AR_Shortcodes
 * @version 2.8.4
 */

/* ============================================
   Reset & Base Styles
   ============================================ */

.auction-bar {
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: #1f2937;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.auction-bar * {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ============================================
   Side Layout - Premium Card
   ============================================ */

.auction-bar-side {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
	padding: 20px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
	direction: rtl;
	text-align: right;
	position: relative;
}

.auction-bar-side:hover {
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
	border-color: #d1d5db;
}

/* ============================================
   Header Section - Full-Width Colored Strip
   ============================================ */

.auction-bar-header {
	width: calc(100% + 40px); /* Compensate for parent padding */
	margin: -20px -20px 20px -20px; /* Negative margin to extend to edges */
	padding: 18px 0; /* No horizontal padding - full width */
	border-radius: 14px 14px 0 0;
	text-align: center;
	direction: rtl;
	border-bottom: none;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	min-height: 56px;
}

.auction-bar-status-header {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0;
	margin: 0;
	border-radius: 0;
}

/* Upcoming Status - Soft Yellow Background */
.auction-bar-status-header.auction-status-upcoming {
	background: rgba(234, 179, 8, 0.18);
	color: #854d0e;
}

/* Running Status - Soft Green Background */
.auction-bar-status-header.auction-status-running {
	background: rgba(22, 163, 74, 0.18);
	color: #166534;
}

/* Ended Status - Soft Red Background */
.auction-bar-status-header.auction-status-ended {
	background: rgba(220, 38, 38, 0.18);
	color: #991b1b;
}

.auction-status-text {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.4;
	text-align: center;
	width: 100%;
	color: inherit;
}

/* ============================================
   Content Section - Structured Layout (RTL)
   ============================================ */

.auction-bar-content {
	padding: 0;
	direction: rtl;
	text-align: right;
	background: #ffffff;
}

/* ============================================
   Item Structure - RTL Proper Alignment
   ============================================ */

.auction-bar-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 0;
	text-align: right;
	direction: rtl;
	border-bottom: 1px solid #f3f4f6;
	position: relative;
	gap: 16px;
	flex-direction: row; /* RTL: Label right (natural), Value left */
	flex-wrap: nowrap; /* Prevent wrapping to multiple lines */
}

.auction-bar-item:last-child {
	border-bottom: none;
}

/* Time-related items grouping */
.auction-bar-item:nth-child(1),
.auction-bar-item:nth-child(2),
.auction-bar-item:nth-child(3),
.auction-bar-item:nth-child(4) {
	padding: 15px 0;
}

/* Separator after time section */
.auction-bar-item:nth-child(4) {
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 4px;
}

/* ============================================
   Typography - Clear RTL Hierarchy
   ============================================ */

/* Labels - RIGHT side (RTL - Natural order) */
.auction-bar-label {
	font-size: 13px;
	font-weight: 500;
	color: #6b7280;
	display: inline-block;
	text-align: right;
	direction: rtl;
	line-height: 1.5;
	flex-shrink: 0;
	min-width: auto; /* Remove fixed min-width to prevent wrapping */
	white-space: nowrap; /* Prevent text wrapping */
	order: 1; /* RTL: Label comes first (right side) */
}

/* Values - LEFT side (RTL - Natural order) */
.auction-bar-value {
	font-size: 14px;
	font-weight: 700;
	color: #111827;
	display: inline-block;
	text-align: right; /* RTL: Text flows right-to-left */
	direction: rtl;
	line-height: 1.5;
	flex: 1;
	word-break: break-word;
	order: 2; /* RTL: Value comes second (left side) */
	margin-right: auto; /* Push to left in RTL */
	min-width: 0; /* Allow flex shrinking */
}

/* Numbers remain readable (LTR inside RTL context) */
.auction-bar-value:has(.duration-days-number),
.auction-bar-value:has([class*="number"]) {
	font-variant-numeric: tabular-nums;
	direction: ltr; /* Numbers read left-to-right */
	display: inline-block;
	text-align: left;
}

/* ============================================
   Duration Highlight - RTL-Aware Key Metric Box
   ============================================ */

.auction-bar-item.auction-bar-duration {
	background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	border-top: 2px solid #3b82f6;
	border-bottom: 1px solid #bfdbfe;
	margin-top: 16px;
	padding: 18px 20px;
	position: relative;
	box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	flex-direction: row; /* RTL: Label right (natural), Value left */
}

.auction-bar-item.auction-bar-duration::before {
	display: none;
}

/* Duration Label - RIGHT */
.auction-bar-item.auction-bar-duration .auction-bar-label {
	font-size: 14px;
	font-weight: 600;
	color: #1e40af;
	min-width: auto;
	order: 1;
}

/* Duration Value - LEFT (Mini Box Design) */
.auction-bar-item.auction-bar-duration .auction-bar-value {
	font-size: 0; /* Reset to allow inline-flex children */
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #ffffff;
	padding: 10px 16px;
	border-radius: 6px;
	border: 1px solid #bfdbfe;
	box-shadow: 0 1px 2px rgba(59, 130, 246, 0.08);
	flex: 0 0 auto;
	order: 2;
	direction: rtl; /* RTL: "يوم" first, then number */
	text-align: center;
	justify-content: center;
	flex-direction: row-reverse; /* Reverse to show label first */
}

/* Duration Label Text - Shows first (right side in RTL) */
.auction-bar-item.auction-bar-duration .auction-bar-value .duration-days-label {
	font-size: 12px;
	font-weight: 600;
	color: #3b82f6;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1;
	direction: rtl; /* Arabic text in RTL */
	text-align: right;
	order: 1; /* First in visual order */
}

/* Duration Number - Emphasized - Shows second (left side in RTL) */
.auction-bar-item.auction-bar-duration .auction-bar-value .duration-days-number {
	font-size: 20px;
	font-weight: 800;
	color: #1e3a8a;
	letter-spacing: -0.5px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	direction: ltr; /* Numbers in LTR for readability */
	text-align: left;
	order: 2; /* Second in visual order */
}

/* ============================================
   Empty Value Placeholder
   ============================================ */

.auction-bar-value:empty::before {
	content: "—";
	color: #9ca3af;
	font-style: normal;
	font-weight: 400;
}

/* ============================================
   Responsive Design - Mobile First
   ============================================ */

@media (max-width: 768px) {
	.auction-bar-side {
		border-radius: 12px;
		padding: 16px;
	}

	.auction-bar-header {
		width: calc(100% + 32px);
		margin: -16px -16px 16px -16px;
		padding: 16px 0; /* No horizontal padding - full width */
		border-radius: 12px 12px 0 0;
		min-height: 52px;
	}

	.auction-status-text {
		font-size: 14px;
	}

	.auction-bar-item {
		padding: 12px 20px;
		gap: 12px;
	}

	.auction-bar-item:nth-child(1),
	.auction-bar-item:nth-child(2),
	.auction-bar-item:nth-child(3),
	.auction-bar-item:nth-child(4) {
		padding: 13px 20px;
	}

	.auction-bar-label {
		font-size: 12px;
		min-width: auto;
		white-space: nowrap;
	}

	.auction-bar-value {
		font-size: 13px;
	}

	.auction-bar-item.auction-bar-duration {
		padding: 16px 18px;
		margin-top: 12px;
		gap: 12px;
	}

	.auction-bar-item.auction-bar-duration .auction-bar-value {
		padding: 8px 14px;
	}

	.auction-bar-item.auction-bar-duration .auction-bar-value .duration-days-number {
		font-size: 18px;
	}

	.auction-bar-item.auction-bar-duration .auction-bar-value .duration-days-label {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.auction-bar-side {
		border-radius: 10px;
		padding: 14px;
	}

	.auction-bar-header {
		width: calc(100% + 28px);
		margin: -14px -14px 14px -14px;
		padding: 14px 0; /* No horizontal padding - full width */
		border-radius: 10px 10px 0 0;
		min-height: 48px;
	}

	.auction-status-text {
		font-size: 13px;
	}

	.auction-bar-item {
		padding: 11px 16px;
		gap: 10px;
		flex-wrap: wrap;
	}

	.auction-bar-item:nth-child(1),
	.auction-bar-item:nth-child(2),
	.auction-bar-item:nth-child(3),
	.auction-bar-item:nth-child(4) {
		padding: 12px 16px;
	}

	.auction-bar-label {
		font-size: 11px;
		min-width: 100%;
		margin-bottom: 4px;
		order: 1;
	}

	.auction-bar-value {
		font-size: 12px;
		width: 100%;
		order: 2;
	}

	.auction-bar-item.auction-bar-duration {
		padding: 14px 16px;
		margin-top: 10px;
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.auction-bar-item.auction-bar-duration .auction-bar-label {
		width: 100%;
		margin-bottom: 0;
	}

	.auction-bar-item.auction-bar-duration .auction-bar-value {
		width: 100%;
		justify-content: center;
	}
}

/* ============================================
   RTL Support - Enhanced & Explicit
   ============================================ */

body[dir="rtl"] .auction-bar-side,
[dir="rtl"] .auction-bar-side {
	direction: rtl;
	text-align: right;
}

body[dir="rtl"] .auction-bar-header,
[dir="rtl"] .auction-bar-header {
	direction: rtl;
	text-align: center;
}

body[dir="rtl"] .auction-bar-content,
[dir="rtl"] .auction-bar-content {
	direction: rtl;
	text-align: right;
}

body[dir="rtl"] .auction-bar-item,
[dir="rtl"] .auction-bar-item {
	direction: rtl;
	text-align: right;
	flex-direction: row; /* RTL: Label right (natural), Value left */
}

body[dir="rtl"] .auction-bar-label,
[dir="rtl"] .auction-bar-label {
	text-align: right;
	direction: rtl;
	order: 1; /* RTL: Label first */
}

body[dir="rtl"] .auction-bar-value,
[dir="rtl"] .auction-bar-value {
	text-align: right;
	direction: rtl;
	order: 2; /* RTL: Value second */
}

/* Numbers in LTR context within RTL */
body[dir="rtl"] .auction-bar-value .duration-days-number,
[dir="rtl"] .auction-bar-value .duration-days-number {
	direction: ltr;
	text-align: left;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
	.auction-bar-side {
		box-shadow: none;
		border: 1px solid #000;
		page-break-inside: avoid;
	}

	.auction-bar-header {
		border-bottom: 2px solid #000;
	}

	.auction-bar-item {
		border-bottom: 1px solid #000;
	}

	.auction-bar-status-header.auction-status-running,
	.auction-bar-status-header.auction-status-upcoming,
	.auction-bar-status-header.auction-status-ended {
		background: transparent !important;
		color: #000 !important;
		border: 1px solid #000;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}

/* ============================================
   Accessibility & Focus States
   ============================================ */

.auction-bar-side:focus-within {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
	border-radius: 14px;
}

.auction-bar-item:focus-within {
	background-color: #f0f7ff;
	border-radius: 6px;
	padding-left: 20px;
	padding-right: 20px;
}

/* ============================================
   Reduced Motion Support
   ============================================ */

@media (prefers-reduced-motion: reduce) {
	.auction-bar-side,
	.auction-bar-item {
		transition: none;
	}

	.auction-bar-side:hover {
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
		border-color: #e5e7eb;
	}
}
