/* ==========================================================================
   Gold & Silver Live Ticker Banner
   ========================================================================== */

.gp-ticker {
	width: 100%;
	position: relative;
	z-index: 99;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.3;
	box-sizing: border-box;
	user-select: none;
	-webkit-font-smoothing: antialiased;
}

.gp-ticker *,
.gp-ticker *::before,
.gp-ticker *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Themes: Dark (Default) & Light
   -------------------------------------------------------------------------- */

/* Dark Mode (Luxury Dark Gold) */
.gp-ticker--dark {
	--gpt-bg: #090c13;
	--gpt-border: rgba(212, 175, 55, 0.22);
	--gpt-badge-bg: #131926;
	--gpt-badge-text: #f2c94c;
	--gpt-badge-border: rgba(212, 175, 55, 0.35);
	--gpt-text: #f8fafc;
	--gpt-name: #e2c068;
	--gpt-unit: #94a3b8;
	--gpt-up: #10b981;
	--gpt-down: #ef4444;
	--gpt-flat: #94a3b8;
	--gpt-divider: rgba(255, 255, 255, 0.1);
	--gpt-fade: #090c13;
	background: linear-gradient(90deg, #07090f 0%, #0d121c 50%, #07090f 100%);
	border-bottom: 1px solid var(--gpt-border);
	color: var(--gpt-text);
}

/* Light Mode (Clean Modern) */
.gp-ticker--light {
	--gpt-bg: #ffffff;
	--gpt-border: #e2e8f0;
	--gpt-badge-bg: #f8fafc;
	--gpt-badge-text: #b48c26;
	--gpt-badge-border: #cbd5e1;
	--gpt-text: #0f172a;
	--gpt-name: #475569;
	--gpt-unit: #64748b;
	--gpt-up: #16a34a;
	--gpt-down: #dc2626;
	--gpt-flat: #64748b;
	--gpt-divider: #e2e8f0;
	--gpt-fade: #ffffff;
	background: #ffffff;
	border-bottom: 1px solid var(--gpt-border);
	color: var(--gpt-text);
}

/* --------------------------------------------------------------------------
   Layout Structure
   -------------------------------------------------------------------------- */

.gp-ticker__inner {
	display: flex;
	align-items: center;
	max-width: 100%;
	height: 38px;
	padding: 0 12px;
	overflow: hidden;
	position: relative;
}

/* Live Badge / Pill */
.gp-ticker__badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	margin-inline-end: 12px;
	border-radius: 99px;
	background: var(--gpt-badge-bg);
	border: 1px solid var(--gpt-badge-border);
	color: var(--gpt-badge-text);
	font-weight: 700;
	font-size: 11.5px;
	white-space: nowrap;
	z-index: 2;
}

.gp-ticker__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--gpt-up);
	box-shadow: 0 0 0 0 var(--gpt-up);
	animation: gp-ticker-pulse 1.8s ease-out infinite;
}

@keyframes gp-ticker-pulse {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gpt-up) 60%, transparent); }
	100% { box-shadow: 0 0 0 6px transparent; }
}

/* Viewport with smooth edge gradients */
.gp-ticker__viewport {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	position: relative;
	mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

/* Continuous scrolling track */
.gp-ticker__track {
	display: inline-flex;
	width: max-content;
	will-change: transform;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

/* LTR scroll direction */
.gp-ticker:not([dir="rtl"]) .gp-ticker__track {
	animation-name: gp-ticker-scroll-ltr;
}
@keyframes gp-ticker-scroll-ltr {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

/* RTL scroll direction */
.gp-ticker[dir="rtl"] .gp-ticker__track,
[dir="rtl"] .gp-ticker .gp-ticker__track {
	animation-name: gp-ticker-scroll-rtl;
}
@keyframes gp-ticker-scroll-rtl {
	0% { transform: translateX(0); }
	100% { transform: translateX(50%); }
}

/* Marquee speed presets */
.gp-ticker--speed-slow .gp-ticker__track   { animation-duration: 45s; }
.gp-ticker--speed-normal .gp-ticker__track { animation-duration: 28s; }
.gp-ticker--speed-fast .gp-ticker__track   { animation-duration: 18s; }

/* Pause on hover */
.gp-ticker--pause:hover .gp-ticker__track {
	animation-play-state: paused;
}

/* Item group */
.gp-ticker__group {
	display: inline-flex;
	align-items: center;
	gap: 20px;
	padding-inline-end: 20px;
}

/* Individual Item */
.gp-ticker__item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	position: relative;
	padding-inline-end: 18px;
}

.gp-ticker__item::after {
	content: "•";
	position: absolute;
	inset-inline-end: 0;
	color: var(--gpt-divider);
	font-size: 11px;
}

.gp-ticker__name {
	font-weight: 700;
	color: var(--gpt-name);
	font-size: 12px;
}

.gp-ticker__price {
	font-weight: 800;
	font-size: 13px;
	color: var(--gpt-text);
}

.gp-ticker__unit {
	font-size: 11px;
	font-weight: 600;
	color: var(--gpt-unit);
}

/* Direction & Change % */
.gp-ticker__chg {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	font-weight: 700;
	padding: 1px 5px;
	border-radius: 4px;
}

.gp-ticker__chg.is-up {
	color: var(--gpt-up);
	background: color-mix(in srgb, var(--gpt-up) 12%, transparent);
}
.gp-ticker__chg.is-down {
	color: var(--gpt-down);
	background: color-mix(in srgb, var(--gpt-down) 12%, transparent);
}
.gp-ticker__chg.is-flat {
	color: var(--gpt-flat);
}

.gp-ticker__arrow {
	font-size: 9px;
	line-height: 1;
}

/* Real-time flash updates */
.gp-ticker__val.flash-up {
	animation: gp-val-flash-up 1.2s ease;
}
.gp-ticker__val.flash-down {
	animation: gp-val-flash-down 1.2s ease;
}

@keyframes gp-val-flash-up {
	0%, 30% { color: var(--gpt-up); }
	100% { color: inherit; }
}
@keyframes gp-val-flash-down {
	0%, 30% { color: var(--gpt-down); }
	100% { color: inherit; }
}

/* --------------------------------------------------------------------------
   Responsive & Accessibility
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
	.gp-ticker__inner { height: 34px; padding: 0 8px; }
	.gp-ticker__badge { padding: 3px 7px; font-size: 10.5px; margin-inline-end: 8px; }
	.gp-ticker__item { gap: 5px; padding-inline-end: 14px; }
	.gp-ticker__name { font-size: 11px; }
	.gp-ticker__price { font-size: 12px; }
	.gp-ticker__unit { font-size: 10px; }
	.gp-ticker__chg { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.gp-ticker__track { animation: none !important; }
	.gp-ticker__viewport { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	.gp-ticker__dot { animation: none !important; }
}
