/* ═══════════════════════════════════════════════════════
   IRC4Fun Widgets — World Clock, Health, Tips
   matches home-hero.css aesthetic
   ═══════════════════════════════════════════════════════ */

/* ── Widget Grid Layout ──────────────────────────────── */
.hp-widgets-section {
	padding: 50px 0;
	position: relative;
}

.hp-widgets-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 24px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ── Base Widget Card ────────────────────────────────── */
.hp-widget {
	background: #fff;
	border: 1px solid rgba(0, 118, 249, 0.08);
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
	transition: transform 0.2s ease, box-shadow 0.3s ease;
	position: relative;
	overflow: hidden;
}

.hp-widget:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 118, 249, 0.15);
}

.hp-widget::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #0076f9 0%, #60a5fa 50%, #0076f9 100%);
	background-size: 200% auto;
	animation: hpWidgetShimmer 3s linear infinite;
}

.hp-widget-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(0, 118, 249, 0.1);
}

.hp-widget-icon {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	background: rgba(0, 118, 249, 0.12);
	color: #0076f9;
	box-shadow: 0 4px 12px rgba(0, 118, 249, 0.15);
}

.hp-widget-title {
	flex: 1;
}

.hp-widget-title h3 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: #1a1a2e;
	letter-spacing: 0.2px;
}

.hp-widget-title p {
	margin: 4px 0 0;
	font-size: 0.8rem;
	color: #6b6b7b;
}

/* ── World Clock Widget ──────────────────────────────── */
.hp-clock-zones {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.hp-clock-zone {
	display: grid;
	grid-template-columns: 40px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: rgba(0, 118, 249, 0.04);
	border: 1px solid rgba(0, 118, 249, 0.08);
	border-radius: 12px;
	transition: all 0.2s ease;
}

.hp-clock-zone:hover {
	background: rgba(0, 118, 249, 0.08);
	border-color: rgba(0, 118, 249, 0.16);
	transform: translateX(4px);
}

.hp-clock-flag {
	font-size: 26px;
	line-height: 1;
	text-align: center;
}

.hp-clock-info {
	flex: 1;
}

.hp-clock-label {
	display: block;
	font-size: 0.88rem;
	font-weight: 600;
	color: #2c2c3e;
	margin-bottom: 2px;
}

.hp-clock-city {
	display: block;
	font-size: 0.75rem;
	color: #7b7b8b;
}

.hp-clock-time {
	font-size: 1.1rem;
	font-weight: 700;
	font-family: 'Courier New', monospace;
	color: #0076f9;
	letter-spacing: 0.5px;
	text-align: right;
	min-width: 85px;
}

.hp-clock-indicator {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #34d399;
	margin-right: 6px;
	animation: hpClockPulse 2s ease-in-out infinite;
}

.hp-clock-indicator.night {
	background: #6b7280;
	animation: none;
}

/* ── Network Health Widget ───────────────────────────── */
.hp-health-metrics {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.hp-health-metric {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hp-health-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.86rem;
	font-weight: 600;
	color: #3c3c4e;
}

.hp-health-value {
	font-size: 1.25rem;
	font-weight: 700;
	color: #0076f9;
}

.hp-health-bar {
	height: 8px;
	background: rgba(0, 118, 249, 0.08);
	border-radius: 999px;
	overflow: hidden;
	position: relative;
}

.hp-health-fill {
	height: 100%;
	background: linear-gradient(90deg, #0076f9 0%, #60a5fa 100%);
	border-radius: 999px;
	transition: width 0.6s ease;
	position: relative;
	overflow: hidden;
}

.hp-health-fill::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
	animation: hpHealthSheen 2s ease-in-out infinite;
}

.hp-health-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
}

.hp-health-status.excellent {
	background: rgba(16, 185, 129, 0.12);
	color: #059669;
}

.hp-health-status.good {
	background: rgba(0, 118, 249, 0.12);
	color: #0076f9;
}

.hp-health-status.fair {
	background: rgba(251, 191, 36, 0.12);
	color: #d97706;
}

.hp-health-graph {
	height: 80px;
	background: rgba(0, 118, 249, 0.04);
	border: 1px solid rgba(0, 118, 249, 0.08);
	border-radius: 10px;
	padding: 10px;
	margin-top: 12px;
	position: relative;
	overflow: hidden;
}

.hp-health-sparkline {
	width: 100%;
	height: 100%;
}

/* ── IRC Tip Widget ──────────────────────────────────── */
.hp-tip-content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.hp-tip-body {
	padding: 20px;
	background: linear-gradient(135deg, rgba(0, 118, 249, 0.06) 0%, rgba(96, 165, 250, 0.04) 100%);
	border: 1px solid rgba(0, 118, 249, 0.12);
	border-radius: 12px;
	position: relative;
	overflow: hidden;
	min-height: 120px;
	display: flex;
	align-items: center;
}

.hp-tip-body::before {
	content: '"';
	position: absolute;
	top: 10px;
	left: 14px;
	font-size: 60px;
	font-family: Georgia, serif;
	color: rgba(0, 118, 249, 0.08);
	line-height: 1;
	pointer-events: none;
}

.hp-tip-text {
	font-size: 0.95rem;
	line-height: 1.65;
	color: #2c2c3e;
	position: relative;
	z-index: 1;
}

.hp-tip-text strong {
	color: #0076f9;
	font-weight: 700;
}

.hp-tip-text code {
	background: rgba(0, 118, 249, 0.1);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: 'Courier New', monospace;
	font-size: 0.88em;
	color: #0076f9;
	border: 1px solid rgba(0, 118, 249, 0.15);
}

.hp-tip-category {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgba(124, 58, 237, 0.12);
	color: #7c3aed;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
}

.hp-tip-actions {
	display: flex;
	gap: 10px;
	margin-top: 4px;
}

.hp-tip-btn {
	flex: 1;
	padding: 10px;
	border: 1px solid rgba(0, 118, 249, 0.2);
	background: rgba(0, 118, 249, 0.04);
	color: #0076f9;
	border-radius: 8px;
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.hp-tip-btn:hover {
	background: rgba(0, 118, 249, 0.12);
	border-color: rgba(0, 118, 249, 0.35);
	transform: translateY(-1px);
}

.hp-tip-btn i {
	font-size: 0.9em;
}

/* ── Animations ──────────────────────────────────────── */
@keyframes hpWidgetShimmer {
	0% { background-position: 0% 50%; }
	100% { background-position: 200% 50%; }
}

@keyframes hpClockPulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.6; transform: scale(0.85); }
}

@keyframes hpHealthSheen {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(200%); }
}

/* ── Dark Mode ───────────────────────────────────────── */
html.theme-dark .hp-widget {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

html.theme-dark .hp-widget:hover {
	box-shadow: 0 12px 32px rgba(0, 118, 249, 0.25);
	border-color: rgba(0, 118, 249, 0.3);
}

html.theme-dark .hp-widget-header {
	border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark .hp-widget-icon {
	background: rgba(0, 118, 249, 0.2);
	color: #60a5fa;
}

html.theme-dark .hp-widget-title h3 {
	color: #e4e7eb;
}

html.theme-dark .hp-widget-title p {
	color: #8c929b;
}

html.theme-dark .hp-clock-zone {
	background: rgba(255, 255, 255, 0.03);
	border-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark .hp-clock-zone:hover {
	background: rgba(0, 118, 249, 0.12);
	border-color: rgba(0, 118, 249, 0.25);
}

html.theme-dark .hp-clock-label {
	color: #e4e7eb;
}

html.theme-dark .hp-clock-city {
	color: #8c929b;
}

html.theme-dark .hp-clock-time {
	color: #60a5fa;
}

html.theme-dark .hp-health-label {
	color: #e4e7eb;
}

html.theme-dark .hp-health-value {
	color: #60a5fa;
}

html.theme-dark .hp-health-bar {
	background: rgba(255, 255, 255, 0.05);
}

html.theme-dark .hp-health-graph {
	background: rgba(255, 255, 255, 0.03);
	border-color: rgba(255, 255, 255, 0.08);
}

html.theme-dark .hp-health-status.excellent {
	background: rgba(16, 185, 129, 0.2);
	color: #34d399;
}

html.theme-dark .hp-health-status.good {
	background: rgba(0, 118, 249, 0.2);
	color: #60a5fa;
}

html.theme-dark .hp-health-status.fair {
	background: rgba(251, 191, 36, 0.2);
	color: #fbbf24;
}

html.theme-dark .hp-tip-body {
	background: linear-gradient(135deg, rgba(0, 118, 249, 0.1) 0%, rgba(96, 165, 250, 0.06) 100%);
	border-color: rgba(255, 255, 255, 0.1);
}

html.theme-dark .hp-tip-body::before {
	color: rgba(255, 255, 255, 0.05);
}

html.theme-dark .hp-tip-text {
	color: #e4e7eb;
}

html.theme-dark .hp-tip-text strong {
	color: #60a5fa;
}

html.theme-dark .hp-tip-text code {
	background: rgba(0, 118, 249, 0.15);
	color: #60a5fa;
	border-color: rgba(0, 118, 249, 0.25);
}

html.theme-dark .hp-tip-category {
	background: rgba(124, 58, 237, 0.2);
	color: #a78bfa;
}

html.theme-dark .hp-tip-btn {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.12);
	color: #60a5fa;
}

html.theme-dark .hp-tip-btn:hover {
	background: rgba(0, 118, 249, 0.15);
	border-color: rgba(0, 118, 249, 0.35);
}

/* ── Crypto Ticker Bar (full-width marquee) ─────────── */
.hp-crypto-bar {
	display: flex;
	align-items: center;
	width: 100%;
	height: 48px;
	background: rgba(247, 147, 26, 0.05);
	border-top: 1px solid rgba(247, 147, 26, 0.15);
	border-bottom: 1px solid rgba(247, 147, 26, 0.15);
	overflow: hidden;
	position: relative;
	gap: 0;
}

.hp-crypto-bar-label {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 0 16px;
	height: 100%;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: #f7931a;
	background: rgba(247, 147, 26, 0.1);
	border-right: 1px solid rgba(247, 147, 26, 0.2);
	z-index: 2;
}

.hp-crypto-bar-label i {
	font-size: 13px;
}

.hp-crypto-bar-track-wrap {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	position: relative;
	height: 100%;
	display: flex;
	align-items: center;
}

/* fade-out edges */
.hp-crypto-bar-track-wrap::before,
.hp-crypto-bar-track-wrap::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: 48px;
	z-index: 2;
	pointer-events: none;
}

.hp-crypto-bar-track-wrap::before {
	left: 0;
	background: linear-gradient(to right, rgba(255,255,255,0.95) 0%, transparent 100%);
}

.hp-crypto-bar-track-wrap::after {
	right: 0;
	background: linear-gradient(to left, rgba(255,255,255,0.95) 0%, transparent 100%);
}

.hp-crypto-marquee {
	display: flex;
	align-items: center;
	height: 100%;
	width: 100%;
	overflow: hidden;
}

.hp-crypto-track {
	display: flex;
	align-items: center;
	gap: 0;
	white-space: nowrap;
	animation: hpMarqueeScroll 40s linear infinite;
	will-change: transform;
}

.hp-crypto-marquee:hover .hp-crypto-track {
	animation-play-state: paused;
}

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

.hp-ticker-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 20px;
	height: 48px;
	cursor: default;
	transition: background 0.15s ease;
	border-right: 1px solid rgba(247, 147, 26, 0.1);
}

.hp-ticker-item:hover {
	background: rgba(247, 147, 26, 0.08);
}

.hp-ticker-item img {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.hp-ticker-item-symbol {
	font-size: 0.8rem;
	font-weight: 800;
	color: #1a1a2e;
	letter-spacing: 0.3px;
}

.hp-ticker-item-price {
	font-size: 0.82rem;
	font-weight: 700;
	color: #3c3c50;
	font-variant-numeric: tabular-nums;
}

.hp-ticker-item-change {
	font-size: 0.75rem;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px;
}

.hp-ticker-item-change.up {
	background: rgba(16, 185, 129, 0.12);
	color: #059669;
}

.hp-ticker-item-change.down {
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
}

.hp-ticker-placeholder {
	padding: 0 24px;
	font-size: 0.82rem;
	color: #9a9aaa;
	display: flex;
	align-items: center;
	gap: 8px;
}

.hp-crypto-bar-cg {
	flex-shrink: 0;
	padding: 0 12px;
	height: 100%;
	display: flex;
	align-items: center;
	font-size: 0.68rem;
	font-weight: 700;
	color: #9a9aaa;
	text-decoration: none;
	border-left: 1px solid rgba(247, 147, 26, 0.15);
	transition: color 0.2s ease;
	z-index: 2;
	background: rgba(255,255,255,0.9);
}

.hp-crypto-bar-cg:hover {
	color: #f7931a;
}

/* Dark mode */
html.theme-dark .hp-crypto-bar {
	background: rgba(247, 147, 26, 0.06);
	border-color: rgba(247, 147, 26, 0.12);
}

html.theme-dark .hp-crypto-bar-label {
	background: rgba(247, 147, 26, 0.12);
	border-right-color: rgba(247, 147, 26, 0.18);
}

html.theme-dark .hp-crypto-bar-track-wrap::before {
	background: linear-gradient(to right, rgba(18,21,26,0.98) 0%, transparent 100%);
}

html.theme-dark .hp-crypto-bar-track-wrap::after {
	background: linear-gradient(to left, rgba(18,21,26,0.98) 0%, transparent 100%);
}

html.theme-dark .hp-ticker-item {
	border-right-color: rgba(255, 255, 255, 0.05);
}

html.theme-dark .hp-ticker-item:hover {
	background: rgba(247, 147, 26, 0.1);
}

html.theme-dark .hp-ticker-item-symbol {
	color: #e4e7eb;
}

html.theme-dark .hp-ticker-item-price {
	color: #b0b7c3;
}

html.theme-dark .hp-ticker-item-change.up {
	background: rgba(16, 185, 129, 0.18);
	color: #34d399;
}

html.theme-dark .hp-ticker-item-change.down {
	background: rgba(239, 68, 68, 0.18);
	color: #f87171;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
	.hp-widgets-grid {
		grid-template-columns: 1fr;
		gap: 20px;
		padding: 0 16px;
	}

	.hp-widget {
		padding: 20px;
	}

	.hp-clock-time {
		font-size: 1rem;
		min-width: 75px;
	}

	.hp-health-value {
		font-size: 1.1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hp-widget::before,
	.hp-clock-indicator,
	.hp-health-fill::after {
		animation: none !important;
	}

	.hp-widget:hover,
	.hp-clock-zone:hover,
	.hp-tip-btn:hover {
		transform: none;
	}
}
