/* 2026-10-01 [PL] FI dashboard styles, sized for TV screens (FPD-7170). */

/* 2026-10-16 [DL] Fleetplan theme: Roboto and the colors of fp-web-ui ThemeLight / ThemeDark and fp-web's AG Grid theme */
@font-face {
	font-family: Roboto;
	font-weight: 400;
	src: url("/assets/0.5.1-b6c3254d/vendor/roboto-400.woff2") format("woff2");
}

@font-face {
	font-family: Roboto;
	font-weight: 500;
	src: url("/assets/0.5.1-b6c3254d/vendor/roboto-500.woff2") format("woff2");
}

:root {
	--bg: #f5f7f7;
	--card: #ffffff;
	--line: #dddddd;
	--text: #181d1f;
	--muted: #777777;
	--header-bg: #ffffff;
	--header-text: #000000;
	/* 2026-10-16 [DL] fp-web-ui Card: border and --fp-border-radius */
	--card-border: #e4e4e4;
	--card-radius: 0.35em;

	/* 2026-10-14 [DL] FPD-7127: flights title bar defaults (Fleetplan primary) */
	--title-bg: #337ab7;
	--title-text: #ffffff;

	font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
	/* Scales with the screen, so 1080p and 4K TVs need no extra tuning. --scale is the dashboard's zoom (0.25–3). */
	font-size: calc(clamp(16px, 1.25vw, 48px) * var(--scale, 1));
}

/* 2026-10-14 [DL] FPD-7127: dark mode from the dashboard config */
body.dark {
	--bg: #000000;
	--card: #292f33;
	--line: #222222;
	--text: #ffffff;
	--muted: #777777;
	--header-bg: #292f33;
	--header-text: #ffffff;
	--card-border: #222222;
}

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

/* A TV must never show scrollbars */
html, body {
	height: 100%;
	margin: 0;
	overflow: hidden;
}

body {
	background: var(--bg);
	color: var(--text);
}

#app {
	height: 100%;
}

/* Neutral message screen (no token, invalid token, gateway unavailable) */
.message {
	display: grid;
	place-items: center;
	padding: 2rem;
}

.card {
	max-width: 32rem;
	padding: 2.5rem 3rem;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 0.75rem;
	text-align: center;
}

.card h1 {
	margin: 0 0 0.75rem;
	font-size: 1.5rem;
	font-weight: 600;
}

.card p {
	margin: 0;
	color: var(--muted);
	line-height: 1.5;
}

/* 2026-10-14 [DL] FPD-7127: dashboard = the configured widgets stacked top to bottom */
.widgets {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	height: 100%;
	overflow: hidden;
	padding: 1rem;
}

/* 2026-10-16 [DL] every widget is a card like fp-web-ui's Card with elevation 0 (border, no shadow) */
.widget-header,
.widget-news,
.widget-flights {
	flex-shrink: 0;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--card-border);
	border-radius: var(--card-radius);
}

/* Header: logo left, clock right (swapped with .swap) */
.widget-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 2rem;
	background: var(--header-bg);
	color: var(--header-text);
}

.widget-header.swap {
	flex-direction: row-reverse;
}

.widget-header .logo img {
	display: block;
	max-height: 4rem;
	max-width: 30vw;
}

.clock {
	text-align: right;
}

.widget-header.swap .clock {
	text-align: left;
}

.clock-date {
	font-size: 1.25rem;
}

.clock-time {
	font-size: 2.5rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* the ":" of the clock blink like a terminal cursor: 1s visible, 1s hidden */
.clock-colon {
	animation: blink 2s steps(1, end) infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

/* News ticker: one line scrolling right to left, 40s per run (the legacy marquee took 20s) */
.widget-news {
	overflow: hidden;
	white-space: nowrap;
	padding: 0.5rem 0;
	font-size: 1.5rem;
}

.news-text {
	display: inline-block;
	padding-left: 100%;
	animation: ticker 40s linear infinite;
}

@keyframes ticker {
	to {
		transform: translateX(-100%);
	}
}

/* Flights: title bar plus a read-only grid that grows with its rows (domLayout autoHeight) */
/* the plane in front of the title, per mode (MODE_ICONS in widgets.js) */
.flights-icon {
	height: 1em;
	width: auto;
	margin-right: 0.5em;
	vertical-align: -0.125em;
}

/* the card already has the border */
.flights-grid .ag-root-wrapper {
	border: 0;
}

.flights-title {
	margin: 0;
	padding: 0.5rem 1rem;
	background: var(--title-bg);
	color: var(--title-text);
	font-size: 1.5rem;
	font-weight: 600;
}

/* The AG Grid theme sizes in px, these make it follow the TV font size and --scale */
.flights-grid {
	--ag-font-size: 1rem;
	/* fp-web's grid ratio: 4px grid at 12px font */
	--ag-grid-size: calc(1rem / 3);
	--ag-font-family: inherit;
	/* fp-web's overrides of Balham (fp-web agGrid.tsx), the rest is Balham's default */
	--ag-foreground-color: var(--text);
	--ag-balham-active-color: #337ab7;
	--ag-border-radius: 0;
	/* Read by AG Grid's autoHeight layout, but not defined by the legacy CSS theme (AG Grid warning #9) */
	--ag-auto-height-max-body-height: 100vh;
}

.flights-grid .ag-header-cell-text {
	font-weight: 500;
}

/* FLT STATUS label, same look as the Label of fp-web-ui */
.flt-status {
	display: inline-block;
	text-transform: uppercase;
	padding: 4px 7px;
	font-size: 0.85em;
	line-height: 1;
	white-space: nowrap;
}

/* Small marker when the flights could not be refreshed for a while; the last good rows stay visible */
.stale {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	padding: 0.25rem 0.75rem;
	border-radius: 0.375rem;
	background: #b45309;
	color: #ffffff;
	font-size: 0.875rem;
}
