/* Frontend styles for Hinden Finance Widgets */
.hinden-widget {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.hinden-widget * {
	box-sizing: border-box;
}

/* Ticker Tag */
.hinden-ticker-tag {
	display: inline-flex;
	align-items: center;
	font-size: 15px;
	font-weight: 500;
	color: #0f172a;
	position: relative;
	cursor: pointer;
}
.hinden-ticker-tag-content {
	display: flex;
	align-items: center;
	gap: 6px;
}
.hinden-ticker-tag .hf-logo {
	width: 20px;
	height: 20px;
	border-radius: 50%;
}
.hinden-ticker-tag .hf-change.positive { color: #16a34a; }
.hinden-ticker-tag .hf-change.negative { color: #dc2626; }

/* Ticker Tag Hover Tooltip */
.hinden-ticker-tag-tooltip {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-top: 10px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
	padding: 16px;
	width: 280px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s, visibility 0.2s;
	z-index: 9999;
	cursor: default;
}
.hinden-ticker-tag:hover .hinden-ticker-tag-tooltip {
	opacity: 1;
	visibility: visible;
}

/* Tooltip internal styling */
.hinden-tt-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.hinden-tt-header .hf-logo {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}
.hinden-tt-symbol {
	font-weight: 600;
	font-size: 16px;
	color: #0f172a;
}
.hinden-tt-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #10b981;
}

.hinden-tt-price-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 12px;
}
.hinden-tt-price {
	font-size: 22px;
	font-weight: 600;
	color: #0f172a;
}
.hinden-tt-currency {
	font-size: 12px;
	color: #64748b;
}
.hinden-tt-change {
	font-size: 15px;
	font-weight: 500;
}
.hinden-tt-change.positive { color: #16a34a; }
.hinden-tt-change.negative { color: #dc2626; }

.hinden-tt-chart-container {
	height: 80px;
	width: 100%;
	position: relative;
	margin-bottom: 8px;
}
.hinden-tt-footer {
	text-align: center;
	font-size: 12px;
	color: #64748b;
}

/* Tickers */
.hinden-tickers {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #ffffff;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.hinden-tickers-container {
	display: flex;
	overflow-x: auto;
	scrollbar-width: none;
}
.hinden-tickers-container::-webkit-scrollbar {
	display: none;
}
.hinden-ticker-item {
	padding: 12px 20px;
	border-right: 1px solid #e2e8f0;
	min-width: 150px;
}
.hinden-ticker-item:last-child {
	border-right: none;
}
.hinden-ticker-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
}
.hinden-ticker-header .hf-logo {
	width: 20px;
	height: 20px;
	border-radius: 50%;
}
.hinden-ticker-symbol {
	font-weight: 600;
	font-size: 15px;
	color: #0f172a;
}
.hinden-ticker-price-row {
	display: flex;
	align-items: baseline;
	gap: 6px;
}
.hinden-ticker-price {
	font-weight: 500;
	font-size: 14px;
	color: #0f172a;
}
.hinden-ticker-currency {
	font-size: 10px;
	color: #64748b;
	text-transform: uppercase;
}
.hinden-ticker-change {
	font-size: 13px;
	font-weight: 500;
}
.hinden-ticker-change.positive { color: #16a34a; }
.hinden-ticker-change.negative { color: #dc2626; }

/* Symbol Overview */
.hinden-symbol-overview {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	overflow: hidden;
}

.hinden-symbol-overview.hf-no-border {
	border: none;
}

.hinden-overview-header {
	display: flex;
	align-items: center;
	padding: 12px 20px;
}
.hinden-overview-logo {
	width: 36px;
	height: 36px;
	border-radius: 6px;
	margin: 0 12px 0 0 !important;
	padding: 0 !important;
	object-fit: contain;
	display: block;
	flex-shrink: 0;
}
.hf-hide-symbol .hinden-overview-logo {
	display: none !important;
}
.hf-hide-symbol .hinden-skeleton-header > .hinden-skeleton-box:first-child {
	display: none !important;
}

/* Floating Tooltip */
.hf-floating-tooltip {
	width: 140px;
	position: absolute;
	display: none;
	padding: 8px;
	box-sizing: border-box;
	font-size: 14px;
	color: #fff;
	background-color: #1e293b;
	text-align: left;
	z-index: 1000;
	pointer-events: none;
	border-radius: 6px;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	font-family: inherit;
}
.hf-floating-tooltip-date {
	font-size: 12px;
	color: #94a3b8;
	margin-bottom: 4px;
	font-weight: 500;
}
.hf-floating-tooltip-price {
	font-size: 16px;
	font-weight: bold;
	color: #fff;
}
.hinden-overview-titles {
	flex: 1;
	display: flex;
	align-items: center;
}
.hinden-overview-titles h2 {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 24px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 8px;
	line-height: 1;
}
.hinden-overview-titles .hf-company-name {
	font-size: 16px;
	font-weight: 400;
	color: #64748b;
}
.hinden-overview-titles .hf-exchange-inline {
	font-size: 13px;
	font-weight: 400;
	color: #94a3b8;
}
.hinden-overview-price-data {
	margin-left: auto;
	text-align: right;
}
.hinden-overview-price {
	font-size: 28px;
	font-weight: 700;
	display: flex;
	align-items: baseline;
	justify-content: flex-end;
	line-height: 1;
}
.hinden-overview-currency {
	font-size: 12px;
	color: #64748b;
	margin-left: 4px;
}
.hinden-overview-change {
	font-size: 16px;
	font-weight: 500;
	line-height: 1;
	margin-top: 4px;
}
.hinden-overview-change.positive { color: #16a34a; }
.hinden-overview-change.negative { color: #dc2626; }

.hinden-chart-container {
	position: relative;
	height: 250px;
	width: 100%;
}
/* Prevent WordPress themes from adding borders to LightweightCharts internal tables */
.hinden-chart-container table,
.hinden-chart-container tr,
.hinden-chart-container td,
.hinden-chart-container th {
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
}

/* Hide legacy text loaders that might be cached in Gutenberg block HTML */
.hinden-loading {
	display: none !important;
}

.hinden-skeleton-box {
	background: #f1f5f9;
	background-image: linear-gradient(90deg, #f1f5f9 0px, #e2e8f0 40px, #f1f5f9 80px);
	background-size: 600px;
	animation: hinden-shimmer 1.5s infinite linear;
	border-radius: 4px;
	flex-shrink: 0;
}


@keyframes hinden-shimmer {
	0% { background-position: -200px 0; }
	100% { background-position: calc(200px + 100%) 0; }
}

@keyframes hinden-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}
.hinden-skeleton-header {
	display: flex;
	padding: 15px 20px;
	gap: 12px;
	border-bottom: 1px solid #f1f5f9;
}
.hinden-skeleton-title-area {
	display: flex;
	flex-direction: column;
	gap: 8px;
	justify-content: center;
}
.hinden-skeleton-price-area {
	margin-left: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-end;
	justify-content: center;
}
.hinden-skeleton-chart {
	height: 250px;
	width: 100%;
	border-radius: 0;
}

.hinden-time-ranges {
	display: flex;
	gap: 4px;
	padding: 6px 20px;
	margin-bottom: 0;
}

.hinden-range-btn {
	background: transparent;
	border: none;
	color: #64748b;
	font-weight: 600;
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s;
}

.hinden-range-btn:hover {
	color: #0f172a;
}

.hinden-range-btn.active {
	background: #e2e8f0;
	color: #0f172a;
}

.hinden-overview-stats {
	display: flex;
	justify-content: space-between;
	padding: 15px 20px;
}

.hinden-stat-col {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 0 10px;
}

.hinden-stat-col:first-child {
	padding-left: 0;
}
.hinden-stat-col:last-child {
	padding-right: 0;
}

.hinden-stat-item {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
}

.hinden-stat-item span {
	color: #64748b;
}

.hinden-stat-item strong {
	color: #0f172a;
	font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
	.hinden-overview-header, .hinden-skeleton-header {
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 12px;
	}
	.hinden-overview-titles {
		min-width: 0;
	}
	.hinden-overview-titles h2 {
		flex-wrap: nowrap;
		font-size: 18px;
		min-width: 0;
		width: 100%;
	}
	.hinden-overview-titles h2 .hf-company-name {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.hinden-overview-titles h2 .hf-exchange-inline {
		white-space: nowrap;
	}
	.hinden-overview-price-data, .hinden-skeleton-price-area {
		margin-left: 0 !important;
		text-align: left;
		width: 100%;
		margin-top: 5px;
	}
	.hinden-skeleton-price-area {
		align-items: flex-start;
	}
	.hinden-overview-price {
		justify-content: flex-start;
	}
	.hinden-time-ranges {
		overflow-x: auto;
		white-space: nowrap;
		-webkit-overflow-scrolling: touch;
	}
	.hinden-overview-stats {
		flex-wrap: wrap;
		gap: 15px 0;
	}
	.hinden-stat-col {
		flex: 0 0 50%;
		padding: 0 10px;
	}
	.hinden-stat-col:nth-child(odd) {
		padding-left: 0;
	}
	.hinden-stat-col:nth-child(even) {
		padding-right: 0;
	}
}

/* -----------------------------------------
   3. Ticker Tape Widget
----------------------------------------- */
.hinden-ticker-tape {
	overflow: hidden;
	white-space: nowrap;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	border-bottom: 1px solid #e2e8f0;
	position: relative;
	box-sizing: border-box;
}

.hinden-ticker-tape-wrapper {
	display: inline-flex;
	align-items: stretch;
	animation: hinden-scroll 30s linear infinite;
}

/* Pause animation on hover */
.hinden-ticker-tape:hover .hinden-ticker-tape-wrapper {
	animation-play-state: paused;
}

@keyframes hinden-scroll {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

.hinden-tape-item {
	display: inline-flex;
	align-items: center;
	padding: 10px 24px;
	border-right: 1px solid #e2e8f0;
	gap: 16px;
	min-width: max-content;
}

.hinden-tape-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.hinden-tape-logo {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: contain;
}

.hinden-tape-logo-fallback {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #3b82f6;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 13px;
}

.hinden-tape-symbol-group {
	display: flex;
	flex-direction: column;
}

.hinden-tape-symbol {
	font-weight: 600;
	font-size: 14px;
	color: #0f172a;
	line-height: 1.2;
}

.hinden-tape-price-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hinden-tape-price {
	font-weight: 500;
	font-size: 14px;
	color: #334155;
}

.hinden-tape-currency {
	font-size: 11px;
	color: #64748b;
}

.hinden-tape-change {
	font-weight: 500;
	font-size: 13px;
}

.hinden-tape-change.positive { color: #16a34a; }
.hinden-tape-change.negative { color: #dc2626; }

.hinden-tape-chart {
	width: 80px;
	height: 32px;
	position: relative;
}

/* -----------------------------------------
   4. Multi-Ticker Widget
----------------------------------------- */
.hinden-multi-ticker {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(0,0,0,0.05);
	overflow: hidden;
}

.hinden-mt-row {
	display: flex;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
	transition: background 0.15s;
}
.hinden-mt-row:last-child {
	border-bottom: none;
}
.hinden-mt-row:hover {
	background: #f8fafc;
}

.hinden-mt-left {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.hinden-mt-header {
	display: flex;
	align-items: center;
	gap: 8px;
}
.hinden-mt-header .hf-logo {
	width: 20px;
	height: 20px;
	border-radius: 50%;
}
.hinden-mt-symbol {
	font-weight: 600;
	font-size: 16px;
	color: #0f172a;
}

.hinden-mt-price-row {
	display: flex;
	align-items: baseline;
	gap: 6px;
}
.hinden-mt-price {
	font-weight: 500;
	font-size: 15px;
	color: #0f172a;
}
.hinden-mt-currency {
	font-size: 11px;
	color: #64748b;
}
.hinden-mt-change {
	font-weight: 500;
	font-size: 14px;
}
.hinden-mt-change.positive { color: #16a34a; }
.hinden-mt-change.negative { color: #dc2626; }

.hinden-mt-right {
	width: 120px;
	height: 48px;
	position: relative;
}
