/* =========================================================
   TGJU Currency Rates
   Frontend Styles
   ========================================================= */

.sg-currency-widget {
	direction: rtl;
	width: 100%;
	background: #fff;
	border-radius: 14px;
	box-sizing: border-box;
}

.sg-currency-widget * {
	box-sizing: border-box;
}


/* =========================================================
   Chart Card
   ========================================================= */

.sg-currency-chart-wrap {
	position: relative;
	margin: 0 !important;
	padding: 20px 20px 16px;

	border: 1px solid #e5e7eb;
	border-bottom: 0;
	border-radius: 14px 14px 0 0 !important;

	background:
		linear-gradient(
			180deg,
			#ffffff 0%,
			#fdfdfd 100%
		);

	overflow: hidden;
}

.sg-currency-chart-wrap::before {
	content: "";

	position: absolute;
	top: -100px;
	left: -80px;

	width: 220px;
	height: 220px;

	border-radius: 50%;

	background: rgba(255, 190, 0, 0.055);

	filter: blur(30px);

	pointer-events: none;
}


/* =========================================================
   Chart Header
   ========================================================= */

.sg-currency-chart-header {
	position: relative;
	z-index: 2;

	display: flex;
	align-items: center;
	justify-content: space-between;

	gap: 15px;
	margin-bottom: 12px;
}

.sg-currency-chart-title {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.5;
	color: #20242a;
}

.sg-currency-chart-status {
	font-size: 12px;
	color: #8a8f98;
}


/* =========================================================
   Chart Area
   ========================================================= */

.sg-currency-chart {
	position: relative;

	width: 100%;
	min-height: 340px;

	overflow: hidden;
}

.sg-currency-chart > .sg-currency-chart-status {
	position: absolute;
	inset: 0;

	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	height: 100%;

	margin: 0;
	padding: 0;

	color: #8a8f98;
	font-size: 13px;
	text-align: center;

	z-index: 5;
	pointer-events: none;
}


/* =========================================================
   SVG Chart
   ========================================================= */

.sg-currency-chart-svg {
	display: block;

	width: 100%;
	height: 340px;

	overflow: visible;
}


/* =========================================================
   Chart Grid
   ========================================================= */

.sg-chart-grid-line {
	stroke: #e9edf2;
	stroke-width: 1;

	vector-effect: non-scaling-stroke;

	opacity: 0.75;
}


/* =========================================================
   Chart Axis
   ========================================================= */

.sg-chart-axis-label {
	fill: #9298a1;

	font-size: 11px;
	font-weight: 400;

	pointer-events: none;
}


/* =========================================================
   Chart Date Labels
   ========================================================= */

.sg-currency-chart-svg .sg-chart-date-label {
	fill: #7f858d;

	font-size: 9px;
	font-weight: 500;

	letter-spacing: 0;

	pointer-events: none;
}


/* =========================================================
   Currency Chart Bars
   ========================================================= */

.sg-currency-chart-svg .sg-chart-bar,
.sg-currency-chart-svg rect.sg-chart-bar {
	fill: url(#sgCurrencyBarGradient) !important;

	opacity: 0.88;

	transition:
		opacity 0.18s ease,
		filter 0.18s ease;
}

.sg-currency-chart-svg .sg-chart-bar.is-active {
	opacity: 1;

	filter:
		drop-shadow(
			0 3px 7px
			rgba(255, 190, 0, 0.35)
		);
}


/* =========================================================
   Chart Hover Line
   ========================================================= */

.sg-currency-chart-svg .sg-chart-hover-line {
	stroke: #ffbe00;
	stroke-width: 1;
	stroke-dasharray: 4 4;

	opacity: 0.55;

	pointer-events: none;

	vector-effect: non-scaling-stroke;
}


/* =========================================================
   Chart Tooltip
   ========================================================= */

.sg-chart-tooltip {
	position: absolute;
	z-index: 20;

	min-width: 125px;
	max-width: 180px;

	display: flex;
	flex-direction: column;
	align-items: flex-start;

	gap: 3px;

	padding: 9px 11px;

	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;

	background: rgba(27, 29, 33, 0.96);
	color: #fff;

	font-size: 12px;
	line-height: 1.5;

	text-align: right;

	box-shadow:
		0 8px 25px rgba(0, 0, 0, 0.16),
		0 2px 6px rgba(0, 0, 0, 0.08);

	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);

	pointer-events: none;

	white-space: nowrap;

	transform: translateY(-4px);
}

.sg-chart-tooltip strong {
	display: block;

	font-size: 14px;
	line-height: 1.4;
	font-weight: 700;

	color: #fff;
}

.sg-chart-tooltip span {
	display: block;

	margin-top: 1px;

	font-size: 10px;
	line-height: 1.4;
	font-weight: 400;

	color: rgba(255, 255, 255, 0.68);
}


/* =========================================================
   Empty Chart
   ========================================================= */

.sg-chart-empty {
	display: flex;
	align-items: center;
	justify-content: center;

	width: 100%;
	min-height: 340px;

	color: #8a8f98;

	font-size: 13px;

	text-align: center;
}


/* =========================================================
   Currency Table Wrapper
   ========================================================= */

.sg-currency-table-wrap {
	width: 100%;

	margin-top: 0 !important;

	border: 1px solid #e5e7eb;
	border-top: 0;

	border-radius: 0 0 14px 14px !important;

	background: #fff;

	overflow: hidden;
}


/* =========================================================
   Currency Table
   ========================================================= */

.sg-currency-table {
	width: 100%;

	margin: 0;
	padding: 0;

	border-collapse: collapse;
	border-spacing: 0;

	table-layout: fixed;
}


/* =========================================================
   Table Header
   ========================================================= */

.sg-currency-table thead th {
	padding: 10px 18px;

	background: #fafbfc;

	border-bottom: 1px solid #e5e7eb;

	color: #737983;

	font-size: 11px;
	font-weight: 600;

	line-height: 1.3;

	white-space: nowrap;
}

.sg-currency-table thead th:first-child {
	width: 45%;
	text-align: right;
}

.sg-currency-table thead th:last-child {
	width: 55%;
	text-align: left;
}


/* =========================================================
   Table Rows
   ========================================================= */

.sg-currency-table tbody tr {
	cursor: pointer;

	transition:
		background-color 0.2s ease,
		box-shadow 0.2s ease;
}

.sg-currency-table tbody tr:not(:last-child) {
	border-bottom: 1px solid #edf0f4;
}

.sg-currency-table tbody tr:hover {
	background: rgba(255, 190, 0, 0.045);
}

.sg-currency-table tbody tr.is-selected {
	background:
		linear-gradient(
			90deg,
			rgba(255, 190, 0, 0.09),
			rgba(255, 190, 0, 0.025)
		);
}

.sg-currency-table tbody tr.is-selected:hover {
	background:
		linear-gradient(
			90deg,
			rgba(255, 190, 0, 0.12),
			rgba(255, 190, 0, 0.035)
		);
}


/* =========================================================
   Table Cells
   ========================================================= */

.sg-currency-table tbody td {
	padding: 9px 18px;

	color: #25282d;

	vertical-align: middle;

	line-height: 1.25;
}

.sg-currency-table tbody tr:last-child td {
	border-bottom: 0;
}


/* =========================================================
   Currency Name
   ========================================================= */

.sg-currency-name {
	text-align: right;
	font-weight: 600;
}

.sg-currency-name-inner {
	display: flex;
	align-items: center;

	gap: 8px;
}

.sg-currency-name-dot {
	width: 6px;
	height: 6px;

	flex: 0 0 6px;

	border-radius: 50%;

	background: #ffbe00;

	box-shadow:
		0 0 0 2px rgba(255, 190, 0, 0.10);
}

.sg-currency-name-text {
	display: inline-block;

	color: #25282d;

	font-size: 13px;
	font-weight: 600;

	line-height: 1.3;
}


/* =========================================================
   Price
   ========================================================= */

.sg-currency-price {
	text-align: left;

	white-space: nowrap;
}

.sg-currency-price-inner {
	display: flex;
	flex-direction: column;
	align-items: flex-end;

	gap: 3px;

	line-height: 1;
}

.sg-currency-price-value {
	display: block;

	color: #17191c;

	font-size: 16px;
	font-weight: 700;

	line-height: 1.15;

	letter-spacing: -0.1px;
}


/* =========================================================
   Change
   ========================================================= */

.sg-currency-change {
	display: flex;
	align-items: center;
	justify-content: flex-end;

	gap: 3px;

	margin: 0;

	direction: rtl;

	font-size: 10px;
	font-weight: 600;

	line-height: 1.1;
}

.sg-currency-arrow {
	display: inline-block;

	margin-left: 1px;

	font-size: 12px !important;
	font-weight: 800 !important;

	line-height: 1;
}

.sg-currency-change-value {
	font-size: 10px;
	font-weight: 600;

	line-height: 1.1;
}

.sg-currency-percent-value {
	font-size: 9px;
	font-weight: 500;

	line-height: 1.1;

	opacity: 0.9;
}


/* =========================================================
   Positive / Negative / Neutral
   ========================================================= */

/*
 * افزایش
 */
.sg-currency-table tbody tr.sg-direction-up .sg-currency-change,
.sg-currency-table tbody tr.sg-direction-up .sg-currency-arrow,
.sg-currency-table tbody tr.sg-direction-up .sg-currency-change-value,
.sg-currency-table tbody tr.sg-direction-up .sg-currency-percent-value {
	color: #159447 !important;
}


/*
 * کاهش
 */
.sg-currency-table tbody tr.sg-direction-down .sg-currency-change,
.sg-currency-table tbody tr.sg-direction-down .sg-currency-arrow,
.sg-currency-table tbody tr.sg-direction-down .sg-currency-change-value,
.sg-currency-table tbody tr.sg-direction-down .sg-currency-percent-value {
	color: #d94b4b !important;
}


/*
 * بدون تغییر
 */
.sg-currency-table tbody tr.sg-direction-neutral .sg-currency-change,
.sg-currency-table tbody tr.sg-direction-neutral .sg-currency-arrow,
.sg-currency-table tbody tr.sg-direction-neutral .sg-currency-change-value,
.sg-currency-table tbody tr.sg-direction-neutral .sg-currency-percent-value {
	color: #8a8f98 !important;
}


/* =========================================================
   Selected Row Indicator
   ========================================================= */

.sg-currency-table tbody tr.is-selected td:first-child {
	box-shadow:
		inset -3px 0 0 #ffbe00;
}


/* =========================================================
   Empty State
   ========================================================= */

.sg-currency-empty {
	padding: 30px 20px;

	border: 1px solid #e5e7eb;
	border-radius: 14px;

	background: #fff;

	color: #8a8f98;

	font-size: 14px;
	text-align: center;
}


/* =========================================================
   Responsive - Tablet / Mobile
   ========================================================= */

@media (max-width: 767px) {

	.sg-currency-chart-wrap {
		padding: 15px 12px 12px;
	}

	.sg-currency-chart-header {
		margin-bottom: 8px;
	}

	.sg-currency-chart-title {
		font-size: 15px;
	}

	.sg-currency-chart-status {
		font-size: 11px;
	}

	.sg-currency-chart {
		min-height: 260px;
	}

	.sg-currency-chart-svg {
		height: 260px;
	}

	.sg-chart-empty {
		min-height: 260px;
	}

	.sg-chart-axis-label {
		font-size: 10px;
	}

	.sg-currency-chart-svg .sg-chart-date-label {
		font-size: 8px;
	}

	.sg-chart-tooltip {
		min-width: 110px;

		padding: 8px 9px;

		border-radius: 8px;
	}

	.sg-chart-tooltip strong {
		font-size: 13px;
	}

	.sg-chart-tooltip span {
		font-size: 9px;
	}


	/* =====================================================
	   Table
	   ===================================================== */

	.sg-currency-table thead th {
		padding: 9px 12px;

		font-size: 10px;
	}

	.sg-currency-table tbody td {
		padding: 8px 12px;
	}

	.sg-currency-name-text {
		font-size: 12px;
	}

	.sg-currency-price-value {
		font-size: 15px;
	}

	.sg-currency-change {
		font-size: 9px;
	}

	.sg-currency-arrow {
		font-size: 11px !important;
	}

	.sg-currency-change-value {
		font-size: 9px;
	}

	.sg-currency-percent-value {
		font-size: 8px;
	}
}


/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 480px) {

	.sg-currency-chart-wrap {
		padding-left: 7px;
		padding-right: 7px;
	}

	.sg-currency-chart {
		min-height: 230px;
	}

	.sg-currency-chart-svg {
		height: 230px;
	}

	.sg-currency-chart-title {
		font-size: 14px;
	}

	.sg-chart-axis-label {
		font-size: 9px;
	}

	.sg-currency-chart-svg .sg-chart-date-label {
		font-size: 7px;
	}


	/* =====================================================
	   Table
	   ===================================================== */

	.sg-currency-table thead th {
		padding: 8px 10px;
	}

	.sg-currency-table tbody td {
		padding: 7px 10px;
	}

	.sg-currency-name-text {
		font-size: 12px;
	}

	.sg-currency-price-value {
		font-size: 14px;
	}

	.sg-currency-change {
		font-size: 9px;
	}

	.sg-currency-arrow {
		font-size: 11px !important;
	}

	.sg-currency-change-value {
		font-size: 9px;
	}

	.sg-currency-percent-value {
		font-size: 8px;
	}
}