/* ===================================================================
   css/shell.css
   The application "OS" shell: the bottom taskbar, the start menu, the
   mobile app-launcher home screen, and the floating window manager -
   plus the shared brand / dropdown / avatar / notification pieces that
   used to live in the (now removed) top navigation bar.

   The top <nav> bar was removed entirely; everything it did (account
   menu, balances, sim status, notifications, primary navigation) now
   lives in the taskbar, so these shared bits moved here with it.
=================================================================== */

/* ===================================================================
   Shell layout
   The shell owns the viewport: <body> is a fixed-height flex column, the
   routed page (#contentContainer) is the one element that scrolls, and
   the taskbar is a non-shrinking row pinned to the bottom. This is what
   keeps the taskbar on screen no matter how tall (or short) a page is.
=================================================================== */
html, body {
	height: 100%;
}
body {
	overflow: hidden;
}
#contentContainer {
	flex: 1 1 auto;
	min-height: 0;     /* let the flex child shrink so overflow can scroll */
	overflow-y: auto;
}

/* ---- Brand ---- */
.ss-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: white;
	font-size: 1.28em;
}
.ss-brand:hover {
	color: white;
}
.ss-brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	flex-shrink: 0;
	background: linear-gradient(135deg, rgb(150, 105, 230), rgb(98, 60, 180));
	box-shadow: 0 2px 8px rgba(120, 80, 200, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.ss-brand-mark i {
	font-size: 14px;
	color: white;
	transform: rotate(45deg);
}
.ss-brand-text {
	font-family: 'Space Grotesk', 'DINPro-Medium', sans-serif;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.ss-brand-text .accent {
	color: rgb(190, 150, 255);
}

/* ---- Avatar (taskbar user chip + account menu) ---- */
.ss-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	flex-shrink: 0;
	font-size: 12px;
	font-weight: bold;
	color: white;
	background: linear-gradient(135deg, rgb(120, 80, 200), rgb(60, 40, 110));
	overflow: hidden;
}
.ss-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- Sign up CTA (logged-out taskbar + home hero) ---- */
.ss-cta {
	border-radius: 20px;
	font-weight: bold;
	padding: 7px 18px;
}

/* ---- Dropdown shell (account menu + notifications) ---- */
.ss-dropdown {
	background: rgb(24, 26, 32);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 12px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
	padding: 8px;
}
.ss-dropdown .dropdown-item {
	color: rgb(210, 212, 218);
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 0.92em;
	font-weight: 500;
}
.ss-dropdown .dropdown-item:hover, .ss-dropdown .dropdown-item:focus {
	background: rgba(255, 255, 255, 0.07);
	color: white;
}
.ss-dropdown .dropdown-item.active {
	background: rgba(150, 105, 230, 0.18);
	color: white;
}
.ss-dropdown .dropdown-item.disabled {
	color: rgb(120, 122, 128);
}
.ss-dropdown .dropdown-item.disabled:hover {
	background: none;
}
.ss-dropdown .dropdown-divider {
	border-color: rgba(255, 255, 255, 0.08);
	margin: 6px 4px;
}
.ss-dropdown .dropdown-item-text {
	padding: 4px 10px 8px;
}
/* Bootstrap's .text-muted is tuned for light backgrounds - override it on
   this near-black dropdown rather than reach for dropdown-menu-dark. */
.ss-dropdown .text-muted {
	color: rgb(150, 152, 158) !important;
}

/* ---- Account menu (opens upward from the taskbar user chip) ---- */
.ss-account-dropdown {
	min-width: 250px;
	margin-bottom: 10px !important;
}
.ss-stat-row {
	display: flex;
	gap: 6px;
	padding: 4px 4px 8px;
}
.ss-stat {
	flex: 1 1 0;
	text-align: center;
	background: rgba(255, 255, 255, 0.04);
	border-radius: 8px;
	padding: 8px 4px;
}
.ss-stat-label {
	font-size: 0.68em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgb(150, 152, 158);
	margin-bottom: 2px;
}
.ss-stat-value {
	font-family: 'JetBrains Mono', 'DINPro-Medium', monospace;
	font-weight: 600;
	font-size: 0.95em;
	color: white;
	white-space: nowrap;
}
.ss-stat-value.cash {
	color: rgb(110, 215, 130);
}
.ss-stat-value.bank {
	color: rgb(120, 180, 235);
}

/* ---- Notifications (opens upward from the taskbar bell) ---- */
.ss-notif-dropdown {
	width: 320px;
	max-width: 90vw;
	padding: 0;
	margin-bottom: 10px !important;
}
.ss-notif-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	font-weight: 600;
	color: white;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ss-notif-header a {
	font-size: 0.8em;
	font-weight: 500;
	color: rgb(150, 152, 158);
}
.ss-notif-header a:hover {
	color: white;
}
.ss-notif-list {
	max-height: 340px;
	overflow-y: auto;
}
.ss-notif-item {
	padding: 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ss-notif-item:last-child {
	border-bottom: none;
}
.ss-notif-item.unread {
	background: rgba(150, 105, 230, 0.08);
}
.ss-notif-item-title {
	color: white;
	font-weight: 600;
	font-size: 0.9em;
}
.ss-notif-item-message {
	color: rgb(190, 192, 198);
	font-size: 0.85em;
	margin-top: 2px;
}
.ss-notif-item-message a {
	color: rgb(190, 150, 255);
}
.ss-notif-item-time {
	color: rgb(130, 132, 138);
	font-size: 0.75em;
	margin-top: 4px;
}

/* ===================================================================
   Taskbar
   Fixed bottom bar - the single piece of persistent chrome now that the
   top nav is gone. Left: start button + quick page nav. Right: a chip
   cluster (sim status / flight hours / cash / bank / user / bell).
=================================================================== */
.taskbar {
	z-index: 500;
	position: relative;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	background: black;
	height: 46px;
	padding-right: 8px;
}

.taskbar .start-button {
	height: 100%;
	background: rgb(40, 40, 60);
	color: white;
	border: none;
	padding: 0 16px;
	flex-shrink: 0;
}
.taskbar .start-button:hover {
	background: rgb(50, 50, 70);
}

/* ---- Quick page nav (Home / Airports) - the links that used to sit in
   the top nav bar, pinned to the taskbar like OS taskbar shortcuts. ---- */
.taskbar .tb-nav {
	display: flex;
	align-items: center;
	gap: 4px;
}
.taskbar .tb-nav-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 32px;
	padding: 0 13px;
	border-radius: 8px;
	background: transparent;
	border: none;
	color: rgb(190, 192, 198);
	font-weight: 600;
	font-size: 0.9em;
	white-space: nowrap;
	text-decoration: none;
	transition: color 0.15s, background-color 0.15s;
}
.taskbar .tb-nav-btn:hover {
	color: white;
	background: rgba(255, 255, 255, 0.07);
}
.taskbar .tb-nav-btn.active {
	color: white;
	background: rgba(150, 105, 230, 0.2);
}

/* ---- Right-side chip cluster ---- */
.ts-spacer {
	flex: 1 1 auto;
}
.taskbar .ts-group {
	display: flex;
	align-items: center;
	height: 100%;
	gap: 10px;
}
.taskbar .ts-divider {
	width: 1px;
	height: 22px;
	background: rgba(255, 255, 255, 0.12);
}
.taskbar .ts-chip {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 32px;
	padding: 0 12px;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: rgb(220, 220, 220);
	white-space: nowrap;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.taskbar .ts-chip:hover {
	background: rgba(255, 255, 255, 0.09);
	border-color: rgba(255, 255, 255, 0.16);
}

/* Sim status */
.taskbar .ts-sim {
	cursor: pointer;
}
.taskbar .ts-sim-label {
	font-size: 12px;
	font-weight: 600;
}
.taskbar .ts-sim-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgb(220, 70, 70);
	box-shadow: 0 0 0 3px rgba(220, 70, 70, 0.18);
	flex-shrink: 0;
}
.taskbar .ts-sim-dot.connected {
	background: rgb(60, 200, 120);
	box-shadow: 0 0 0 3px rgba(60, 200, 120, 0.18);
}

/* Flight hours */
.taskbar .ts-hours {
	min-width: 150px;
}
.taskbar .ts-hours > i {
	font-size: 12px;
	color: rgb(190, 140, 255);
}
.taskbar .ts-hours-body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	line-height: 1;
}
.taskbar .ts-hours-value {
	font-size: 12px;
	font-weight: 600;
	color: white;
}
.taskbar .ts-hours-of {
	font-weight: 400;
	color: rgb(160, 160, 160);
}
.taskbar .ts-hours-bar {
	width: 100%;
	height: 3px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.12);
	overflow: hidden;
}
.taskbar .ts-hours-fill {
	height: 100%;
	background: linear-gradient(90deg, rgb(120, 80, 200), rgb(190, 140, 255));
	border-radius: 2px;
}

/* Cash / bank */
.taskbar .ts-money {
	padding: 0 10px;
}
.taskbar .ts-money-icon {
	font-size: 12px;
}
.taskbar .ts-money-icon.ts-cash,
.taskbar .ts-money-value.ts-cash {
	color: rgb(110, 220, 140);
}
.taskbar .ts-money-icon.ts-bank,
.taskbar .ts-money-value.ts-bank {
	color: rgb(120, 180, 255);
}
.taskbar .ts-money-value {
	font-size: 13px;
	font-weight: 600;
}

/* Account (now a dropdown toggle) */
.taskbar .ts-user {
	padding: 0 10px 0 6px;
	cursor: pointer;
}
.taskbar .ts-user .ss-avatar {
	width: 24px;
	height: 24px;
	font-size: 12px;
}
.taskbar .ts-user-name {
	font-size: 13px;
	font-weight: 600;
	color: white;
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
}
.taskbar .ts-user .ts-caret {
	font-size: 10px;
	color: rgb(160, 160, 160);
}

/* Notification bell */
.taskbar .ts-bell {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: white;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.taskbar .ts-bell:hover {
	background: rgba(255, 255, 255, 0.09);
	border-color: rgba(255, 255, 255, 0.16);
	color: white;
}
.taskbar .ts-bell i {
	font-size: 14px;
}
.taskbar .ts-bell-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: rgb(220, 70, 70);
	color: white;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

/* Logged-out taskbar (just brand + auth actions) */
.taskbar .tb-auth {
	display: flex;
	align-items: center;
	gap: 10px;
}
.taskbar .tb-auth .tb-login {
	color: rgb(200, 202, 208);
	font-weight: 600;
	font-size: 0.9em;
	text-decoration: none;
	padding: 6px 10px;
	border-radius: 8px;
}
.taskbar .tb-auth .tb-login:hover {
	color: white;
	background: rgba(255, 255, 255, 0.07);
}

@media (max-width: 768px) {
	.taskbar .ts-hours { display: none; }
	.taskbar .ts-divider { display: none; }
	.taskbar .ts-user-name { display: none; }
	.taskbar .ts-group { gap: 6px; }
	/* Cash/bank now live on the app-launcher header instead - the taskbar's
	   job on mobile is mainly "tap start to get back to the launcher", so
	   keep it down to a few easy-to-hit targets rather than a packed strip
	   of small chips. */
	.taskbar .ts-money { display: none; }
	/* On mobile the start button is "home" and the springboard handles
	   launching, so the pinned page nav collapses to icons only. */
	.taskbar .tb-nav-btn span { display: none; }
	.taskbar .tb-nav-btn { padding: 0 14px; min-width: 44px; justify-content: center; }
	.taskbar .start-button { padding: 0 18px; min-width: 52px; justify-content: center; }
	.taskbar .start-button .ss-brand-text { display: none; }
	.taskbar .ts-chip { padding: 0 10px; }
	.taskbar .ts-sim-label { display: none; }
}

/* ===================================================================
   Start menu (desktop)
   A pop-up list of apps anchored to the start button. On mobile this is
   suppressed in favor of the full-screen app launcher below.
=================================================================== */
.start-menu-container {
	pointer-events: none;
	overflow: hidden;
	position: absolute;
	bottom: 46px;
	left: 0;
	z-index: 400;
}
.start-menu {
	pointer-events: none;
	width: 460px;
	height: 620px;
	max-height: calc(100vh - 46px);
	background: rgba(0, 0, 0, 0.8);
	border-top-right-radius: 15px;
	padding: 20px;
	backdrop-filter: blur(8px);
	overflow-y: auto;
	transform: translateY(20%);
	opacity: 0;
	transition: 0.2s ease;
}
.start-menu .app-button {
	user-select: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	color: white;
	padding: 8px 6px;
	border-radius: 8px;
}
.start-menu .app-button .icon {
	font-size: 26px;
	width: 44px;
	text-align: center;
	color: rgb(190, 150, 255);
	flex-shrink: 0;
}
.start-menu .app-button p {
	color: gray;
	margin-bottom: 0;
	font-size: 0.85em;
}
.start-menu .app-button:hover {
	background: rgba(255, 255, 255, 0.1);
}
.start-menu.open {
	pointer-events: auto;
	transform: translateY(0);
	opacity: 1;
}

/* ===================================================================
   App launcher (mobile home screen)
   An iOS / Android style springboard. Shown for logged-in pilots on the
   home route on narrow screens; tapping a tile either opens that app as
   a full-screen window or navigates to a routed page (Home / Airports).
   Sits beneath the window layer so an open window covers it.
=================================================================== */
.app-launcher {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 46px;
	z-index: 200;
	overflow-y: auto;
	background-color: rgb(10, 10, 14);
	background-image:
		radial-gradient(ellipse 80% 50% at 20% -6%, rgba(120, 80, 200, 0.35), transparent 60%),
		radial-gradient(ellipse 70% 45% at 100% 12%, rgba(170, 120, 255, 0.18), transparent 60%),
		radial-gradient(ellipse 75% 55% at 50% 112%, rgba(90, 55, 160, 0.25), transparent 60%);
}
.app-launcher-header {
	padding: 28px 24px 8px;
}
.app-launcher-greeting {
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.85em;
	font-weight: 500;
}
.app-launcher-name {
	font-family: 'Space Grotesk', 'DINPro-Medium', sans-serif;
	font-weight: 700;
	font-size: 1.8em;
	color: white;
	letter-spacing: -0.01em;
	line-height: 1.1;
}
.app-launcher-balances {
	display: flex;
	gap: 10px;
	margin-top: 18px;
}
.al-balance {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 14px;
	color: white;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.08);
}
.al-balance i {
	font-size: 15px;
	flex-shrink: 0;
}
.al-balance.al-cash i { color: rgb(110, 220, 140); }
.al-balance.al-bank i { color: rgb(120, 180, 255); }
.al-balance-body {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}
.al-balance-label {
	font-size: 0.72em;
	color: rgba(255, 255, 255, 0.55);
	font-weight: 500;
}
.al-balance-value {
	font-size: 1.05em;
	font-weight: 700;
	color: white;
}
.al-balance.al-cash .al-balance-value { color: rgb(110, 220, 140); }
.al-balance.al-bank .al-balance-value { color: rgb(120, 180, 255); }
.app-launcher-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px 8px;
	padding: 22px 18px 32px;
}
.app-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.app-tile-icon {
	width: 58px;
	height: 58px;
	border-radius: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 25px;
	color: white;
	background: linear-gradient(150deg, rgb(150, 105, 230), rgb(88, 52, 168));
	box-shadow: 0 6px 16px rgba(60, 30, 120, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
	transition: transform 0.12s ease;
}
.app-tile:active .app-tile-icon {
	transform: scale(0.92);
}
.app-tile-label {
	font-size: 0.74em;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.92);
	text-align: center;
	line-height: 1.15;
}
/* A couple of tiles get their own hue so the grid isn't a wall of purple,
   the way a real home screen mixes app colors. */
.app-tile-icon.tile-flight { background: linear-gradient(150deg, rgb(95, 175, 255), rgb(40, 95, 200)); }
.app-tile-icon.tile-bank { background: linear-gradient(150deg, rgb(80, 205, 140), rgb(30, 130, 90)); }
.app-tile-icon.tile-logs { background: linear-gradient(150deg, rgb(120, 190, 255), rgb(60, 110, 210)); }
.app-tile-icon.tile-muted { background: linear-gradient(150deg, rgb(110, 112, 122), rgb(60, 62, 72)); }

@media (min-width: 420px) {
	.app-launcher-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===================================================================
   Window manager
   Floating, draggable, resizable app windows. On mobile a single window
   fills the screen between the (removed) header and the taskbar.
=================================================================== */
.window-layer {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 46px;
	z-index: 300;
	pointer-events: none;
}
.app-window {
	position: absolute;
	pointer-events: auto;
	border-radius: 10px;
	overflow: hidden;
}
.window-titlebar {
	height: 36px;
	color: white;
	background: rgba(40, 40, 60, 0.8);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 10px;
	cursor: move;
	user-select: none;
}
.window-titlebar button {
	background: transparent;
	border: 0;
	color: white;
}
.window-titlebar button:hover {
	color: red;
}
.window-content {
	height: calc(100% - 36px);
	overflow: auto;
	background: white;
}
.window-drag-edge {
	position: absolute;
	z-index: 50;
	opacity: 0;
	background: rgba(0, 0, 0, 0.35);
	transition: opacity 0.15s;
}
.app-window .window-drag-edge:hover {
	opacity: 1;
}
.drag-bottom {
	bottom: 0;
	left: 0;
	right: 0;
	height: 5px;
}
.drag-right {
	right: 0;
	top: 0;
	bottom: 0;
	width: 5px;
}
/* Bigger jQuery-UI resize grab areas */
.ui-resizable-n { top: -6px; height: 12px; }
.ui-resizable-s { bottom: -6px; height: 12px; }
.ui-resizable-e { right: -6px; width: 12px; }
.ui-resizable-w { left: -6px; width: 12px; }
.app-window .ui-resizable-handle:hover:not(.ui-resizable-se) {
	background: rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
	.app-window {
		border-radius: 0;
	}
	.window-titlebar {
		background: rgb(40, 40, 60);
		backdrop-filter: none;
	}
}
