/* ═══════════════════════════════════════════════
   ISS Tracker Widget v2.0 — Styles
   Palette aligned to css/site.css tokens: gold #ffe9aa / cyan #8ed8f0
   accents on deep blue-black grounds (var() with hex fallbacks so the
   widget also renders standalone in preview/test pages).
   ═══════════════════════════════════════════════ */

/* ── Base container ───────────────────────────── */
.iss-tracker-widget {
	position: relative;
	width: 100%;
	margin: 24px auto;
	background: #0c1016;
	border-radius: 7px;   /* halved from 14px — squarer corners on the embedded window */
	overflow: hidden;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 233, 170, 0.04);
	border: 1px solid rgba(255, 233, 170, 0.15);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
	color: var(--text, #dfe6f5);
}

/* ── Layout: full ─────────────────────────────── */
.iss-layout-full {
	max-width: 1200px;
}
.iss-layout-full .iss-info-panel {
	padding: 20px 24px;
}

/* ── Layout: compact ──────────────────────────── */
.iss-layout-compact {
	max-width: 500px;
}
.iss-layout-compact .iss-info-panel {
	padding: 10px 14px;
}
.iss-layout-compact .iss-info-header {
	margin-bottom: 8px;
}
.iss-layout-compact .iss-info-header h3 {
	font-size: 14px;
}
.iss-layout-compact .iss-speed-badge {
	font-size: 11px;
	padding: 3px 10px;
}
.iss-layout-compact .iss-meta {
	margin-top: 0;
	font-size: 10px;
}
.iss-layout-compact .iss-daynight {
	font-size: 10px;
	padding: 2px 8px;
}
.iss-layout-compact .iss-update-time {
	font-size: 10px;
}

/* ── Map ──────────────────────────────────────── */
.iss-map-wrap {
	position: relative;
}
.iss-map {
	width: 100%;
	background: #0a0d12;
	z-index: 1;
}
/* Leaflet override: dark background for tiles that haven't loaded */
.iss-map .leaflet-container {
	background: #0a0d12;
}
/* Leaflet zoom buttons — dark glass with the site's gold accents */
.iss-map .leaflet-bar a {
	background: rgba(12, 16, 22, 0.92);
	color: var(--gold, #ffe9aa);
	border-bottom: 1px solid rgba(255, 233, 170, 0.12);
}
.iss-map .leaflet-bar a:hover {
	background: rgba(24, 31, 40, 0.95);
	color: var(--yellow, #fbf7ce);
}
/* Leaflet popup — dark panel matching the info panel */
.iss-map .leaflet-popup-content-wrapper {
	background: rgba(14, 18, 24, 0.95);
	color: var(--text, #dfe6f5);
	border: 1px solid rgba(255, 233, 170, 0.18);
	border-radius: 5px;   /* halved from 10px — squarer popup windows */
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}
.iss-map .leaflet-popup-tip {
	background: rgba(14, 18, 24, 0.95);
}
.iss-map .leaflet-container a.leaflet-popup-close-button {
	color: var(--gold-dim, #a89860);
}
.iss-map .leaflet-container a.leaflet-popup-close-button:hover {
	color: var(--gold, #ffe9aa);
}

/* ── Night pane (for night earth imagery) ─────── */
.leaflet-night-pane {
	pointer-events: none;
}
.leaflet-night-pane .leaflet-poly {
	/* Night polygon styling - dark with subtle city lights effect */
	filter: drop-shadow(0 0 6px rgba(142, 216, 240, 0.18));
}
.leaflet-night-pane .leaflet-circle-marker {
	/* City lights - glowing effect */
	filter: drop-shadow(0 0 4px rgba(255, 215, 130, 0.75));
	animation: issCityLightPulse 3s ease-in-out infinite;
}
@keyframes issCityLightPulse {
	0%, 100% { opacity: 0.7; }
	50% { opacity: 1; }
}

/* ── Map overlay: status badge ────────────────── */
.iss-map-overlay {
	position: absolute;
	z-index: 800;
	pointer-events: none;
}
.iss-overlay-status {
	top: 12px;
	left: 12px;
	display: flex;
	align-items: center;
	gap: 7px;
	background: rgba(10, 13, 18, 0.85);
	backdrop-filter: blur(8px);
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	color: #c8b888;
	border: 1px solid rgba(255, 233, 170, 0.2);
}
.iss-overlay-status.iss-live .iss-status-text {
	color: #7dffb0;
}
.iss-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #5a5f78;
	transition: background 0.4s;
}
.iss-overlay-status.iss-live .iss-status-dot {
	background: #00e676;
	box-shadow: 0 0 6px #00e676;
	animation: issPulse 2s ease-in-out infinite;
}
@keyframes issPulse {
	0%, 100% { opacity: 1; box-shadow: 0 0 4px #00e676; }
	50%      { opacity: 0.55; box-shadow: 0 0 10px #00e676; }
}

/* ── ISS marker icon ─────────────────────────── */
.iss-marker-icon {
	background: none !important;
	border: none !important;
	filter: drop-shadow(0 0 8px rgba(142, 216, 240, 0.55));
}
.iss-orbit-arrow {
	background: none !important;
	border: none !important;
}

/* ── Info panel ───────────────────────────────── */
.iss-info-panel {
	border-top: 1px solid rgba(255, 233, 170, 0.1);
}

.iss-info-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.iss-info-titles {
	flex: 1;
	min-width: 0;
}
.iss-info-header h3 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #ffe9aa;
	display: flex;
	align-items: center;
	gap: 8px;
}
.iss-info-header h3 svg {
	color: #ffe9aa;
}
.iss-subtitle {
	margin: 3px 0 0 0;
	font-size: 12px;
	font-weight: 400;
	color: #a89860;
	letter-spacing: 0.2px;
}

.iss-speed-badge {
	font-size: 12px;
	font-weight: 600;
	color: #ffe9aa;
	background: rgba(255, 233, 170, 0.08);
	padding: 4px 12px;
	border-radius: 14px;
	border: 1px solid rgba(255, 233, 170, 0.18);
	letter-spacing: 0.3px;
}

/* ── Stats grid ───────────────────────────────── */
.iss-stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
}

.iss-stat {
	background: rgba(255, 233, 170, 0.03);
	border: 1px solid rgba(255, 233, 170, 0.08);
	border-radius: 5px;   /* halved from 10px — squarer stat-table tiles */
	padding: 12px 10px;
	text-align: center;
	transition: background 0.25s, border-color 0.25s;
}
.iss-stat:hover {
	background: rgba(255, 233, 170, 0.07);
	border-color: rgba(255, 233, 170, 0.18);
}

.iss-stat-label {
	display: block;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #a89860;
	margin-bottom: 6px;
}
.iss-stat-value {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: #ffe9aa;
	font-variant-numeric: tabular-nums;
}

/* ── Meta row ─────────────────────────────────── */
.iss-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 14px;
	font-size: 11px;
	color: #8a7a55;
}

.iss-daynight {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 10px;
	font-size: 11px;
}
.iss-vis-icon {
	flex-shrink: 0;
	vertical-align: middle;
}
.iss-day {
	color: var(--gold, #ffe9aa);
	background: rgba(255, 233, 170, 0.08);
	border: 1px solid rgba(255, 233, 170, 0.18);
}
.iss-night {
	color: var(--blue, #8ed8f0);
	background: rgba(142, 216, 240, 0.08);
	border: 1px solid rgba(142, 216, 240, 0.18);
}

.iss-update-time {
	font-variant-numeric: tabular-nums;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 640px) {
	.iss-layout-full .iss-stats-grid {
		grid-template-columns: 1fr 1fr;
	}
	.iss-layout-full .iss-info-panel {
		padding: 16px;
	}
	.iss-stat-value {
		font-size: 14px;
	}
}

@media (max-width: 380px) {
	.iss-layout-compact .iss-stats-grid {
		grid-template-columns: 1fr;
	}
	.iss-info-header h3 {
		font-size: 14px;
	}
}
