/**
 * Public Styles for Zioto Pricing
 *
 * @package ZiotoPricing
 */

/* Price Board */
.zioto-price-board {
	margin: 24px auto;
	overflow-x: auto;
	direction: rtl;
}

.zioto-price-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0 12px;
	background: transparent;
	box-shadow: none;
}

.zioto-price-table thead th {
	background: transparent;
	color: #b8b2a5;
	padding: 8px 16px;
	text-align: right;
	font-size: 0.82em;
	font-weight: 700;
	border-bottom: 1px solid rgba(209, 173, 91, 0.24);
}

.zioto-price-table tbody td {
	padding: 16px;
	border-top: 1px solid rgba(209, 173, 91, 0.22);
	border-bottom: 1px solid rgba(209, 173, 91, 0.14);
	background: linear-gradient(180deg, rgba(33, 32, 28, 0.96), rgba(24, 24, 22, 0.96));
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.zioto-price-table tbody td:first-child {
	border-right: 1px solid rgba(209, 173, 91, 0.22);
	border-radius: 10px 0 0 10px;
}

.zioto-price-table tbody td:last-child {
	border-left: 1px solid rgba(209, 173, 91, 0.22);
	border-radius: 0 10px 10px 0;
}

.zioto-price-table tbody tr:hover {
	background: transparent;
}

.zioto-price-table tbody tr:hover td {
	border-color: rgba(226, 190, 106, 0.42);
	background: linear-gradient(180deg, rgba(39, 37, 31, 0.98), rgba(27, 26, 23, 0.98));
}

.zioto-price-table tbody tr:last-child td {
	border-bottom: 1px solid rgba(209, 173, 91, 0.14);
}

/* Metal Name */
.metal-name {
	font-weight: 800;
	color: #f5f0e6;
}

/* Price Display */
.metal-price {
	font-size: 1.1em;
	font-weight: 700;
}

.price-value {
	color: #e5c26f;
	direction: ltr;
	display: inline-block;
}

.price-currency {
	color: #d8d0c0;
	font-size: 0.9em;
	margin-right: 5px;
}

/* Trend Indicators */
.metal-trend {
	text-align: center;
	font-size: 1.2em;
}

.trend-up {
	color: #27ae60;
}

.trend-down {
	color: #e74c3c;
}

.trend-stable {
	color: #8d918f;
}

/* Single Price - Minimal styling for Elementor customization */
.zioto-single-price {
	display: flex;
	position: relative;
	flex-direction: column;
	justify-content: space-between;
	width: min(100%, 300px);
	min-height: 112px;
	margin-inline: auto;
	padding: 14px 16px;
	background: linear-gradient(180deg, rgba(33, 32, 28, 0.96), rgba(24, 24, 22, 0.96));
	border: 1px solid rgba(209, 173, 91, 0.22);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
	color: #f5f0e6;
	direction: rtl;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.zioto-single-price:hover {
	border-color: rgba(226, 190, 106, 0.44);
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
	transform: translateY(-1px);
}

.zioto-single-price .price-label {
	display: block;
	min-height: 28px;
	margin-bottom: 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(209, 173, 91, 0.2);
	color: #f5f0e6;
	font-size: 0.96em;
	font-weight: 800;
	line-height: 1.5;
	text-align: right;
}

.zioto-single-price .price-value {
	color: #e5c26f;
	font-size: 1.05em;
	font-weight: 700;
	direction: ltr;
	display: inline-block;
}

.zioto-single-price .price-pair {
	display: flex;
	flex-direction: column;
	gap: 5px;
	align-items: stretch;
}

.zioto-single-price .price-row {
	display: grid;
	grid-template-columns: 38px 1fr auto;
	align-items: baseline;
	column-gap: 8px;
	white-space: nowrap;
}

.zioto-single-price .price-side {
	color: #9d988e;
	font-size: 0.78em;
	font-weight: 600;
	text-align: right;
}

.zioto-single-price .price-row-sell .price-value {
	color: #e5c26f;
}

.zioto-single-price .price-row-buy .price-value {
	color: #f1d990;
}

.zioto-single-price .price-currency {
	color: #d8d0c0;
	font-size: 0.78em;
	margin-right: 0;
}

.zioto-single-price .price-trend {
	position: absolute;
	top: 15px;
	left: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	margin-right: 0;
}

.zioto-single-price .trend-icon {
	font-size: 0.95em;
}

/* Empty Price State */
.zioto-price-empty {
	opacity: 0.6;
}

.zioto-price-empty .price-label {
	display: block;
	font-weight: 600;
	margin-bottom: 5px;
	color: #9d988e;
}

.zioto-price-empty .price-dash {
	font-size: 1.5em;
	color: #8d918f;
	font-weight: 300;
	display: block;
}

/* Discount Badge */
.zioto-discount-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 15px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	border-radius: 20px;
	font-weight: 600;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.zioto-discount-badge .discount-icon {
	font-size: 1.2em;
}

.zioto-discount-badge .discount-text {
	font-size: 0.95em;
}

/* Product Page Discount Display */
.zioto-product-discount {
	margin: 15px 0;
}

.zioto-product-discount .discount-badge {
	display: inline-block;
	padding: 10px 20px;
	background: #BD9530;
	color: #fff;
	border-radius: 25px;
	font-weight: 600;
	font-size: 1em;
	box-shadow: 0 3px 10px rgba(189, 149, 48, 0.4);
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 3px 10px rgba(189, 149, 48, 0.4);
	}
	50% {
		transform: scale(1.02);
		box-shadow: 0 5px 15px rgba(189, 149, 48, 0.6);
	}
}

/* Error State */
.zioto-price-error {
	color: #e74c3c;
	font-style: italic;
}

/* Loading State */
.zioto-price-board.loading,
.zioto-single-price.loading {
	opacity: 0.7;
	pointer-events: none;
	position: relative;
}

.zioto-loading {
	color: #666;
	font-style: italic;
	font-size: 0.9em;
	animation: pulse-loading 1.5s ease-in-out infinite;
}

@keyframes pulse-loading {
	0%, 100% { opacity: 0.5; }
	50% { opacity: 1; }
}

/* Loading spinner for price board */
.zioto-price-board.loading tbody::after {
	content: "";
	display: block;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #3498db;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 10;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Price change animation */
.price-changed {
	animation: priceFlash 1s ease-in-out;
}

@keyframes priceFlash {
	0%, 100% {
		box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
	}
	50% {
		box-shadow: 0 12px 30px rgba(209, 173, 91, 0.2);
		transform: scale(1.01);
	}
}

/* Empty price state */
.zioto-price-empty {
	opacity: 0.6;
}

.zioto-price-empty .price-dash {
	font-size: 1.2em;
	color: #8d918f;
}

/* RTL Support */
[dir="rtl"] .zioto-price-table thead th,
[dir="rtl"] .zioto-price-table tbody td {
	text-align: right;
}

/* Responsive */
@media screen and (max-width: 768px) {
	.zioto-price-board {
		margin: 18px auto;
	}

	.zioto-price-table {
		font-size: 0.9em;
	}

	.zioto-price-table thead th,
	.zioto-price-table tbody td {
		padding: 8px 10px;
	}

	.zioto-single-price {
		width: min(100%, 300px);
		min-height: 110px;
		padding: 14px 16px;
		font-size: 0.94em;
	}

	.zioto-discount-badge {
		font-size: 0.9em;
		padding: 6px 12px;
	}
}
