/*
 * shared.css
 * Link this in every HTML page — ensures consistent layout and scaling
 * across all pages regardless of browser zoom level.
 */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* ── Root scale variables ───────────────────────────────────────────────────── */
:root {
  --sidebar-w: 256px;
  --topbar-h:  64px;
  --content-max: 1600px;
}

/* ── Base reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  /* Prevents text from inflating on mobile/zoom */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Manrope', sans-serif;
  background: #f9f9fc;
  color: #1a1a1c;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  /* Smooth font rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Top bar — consistent height and position ───────────────────────────────── */
header.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

/* ── Sidebar — consistent width and position ────────────────────────────────── */
aside.sidebar {
  position: fixed;
  left: 0;
  top: var(--topbar-h);
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Main content area ──────────────────────────────────────────────────────── */
main.content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  width: calc(100% - var(--sidebar-w));
}

/* ── Inner page padding — consistent across all pages ──────────────────────── */
.page-inner {
  padding: 2rem;
  max-width: var(--content-max);
  width: 100%;
}

/* ── Bento grid — same gap and columns everywhere ───────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

/* ── Scrollbar — consistent across pages ───────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4c6cf; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a0a3ab; }
* { scrollbar-width: thin; scrollbar-color: #c4c6cf transparent; }

/* ── Typography scale — rem-based so zoom scales everything uniformly ────────── */
.text-display { font-size: clamp(1.5rem, 2.5vw, 2rem);   font-weight: 800; line-height: 1.15; }
.text-title   { font-size: clamp(1rem,   1.5vw, 1.25rem); font-weight: 700; line-height: 1.3;  }
.text-body    { font-size: clamp(0.8rem, 1vw,   0.875rem);font-weight: 400; line-height: 1.6;  }
.text-label   { font-size: clamp(0.65rem,0.8vw, 0.75rem); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* ── Cards — consistent shadow and radius ───────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 0.5rem;
  border: 1px solid #e7e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.03);
}

/* ── Tables — consistent row height ────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th { padding: 0.75rem 1.5rem; }
tbody td { padding: 1rem 1.5rem; }

/* ── Skeleton loader ────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e8e8ea 25%, #f3f3f6 50%, #e8e8ea 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  display: inline-block;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Zoom breakpoints — layout holds at common zoom levels ──────────────────── */

/* 75% zoom (browser renders as if viewport is wider) */
@media (min-width: 1600px) {
  .page-inner { padding: 2rem 2.5rem; }
}

/* 90% zoom */
@media (min-width: 1400px) {
  .page-inner { padding: 2rem; }
}

/* 110%+ zoom (viewport gets narrower) */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .page-inner { padding: 1.25rem; }
  .bento-grid { gap: 1rem; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  aside.sidebar { display: none; }
  main.content  { margin-left: 0; width: 100%; }
  .page-inner   { padding: 1rem; }
}
/* ── The Roadway ────────────────────────────────────────────────────────── */
.road-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: #051024;
  overflow: hidden;
  z-index: 1;
}

.road-surface {
  position: absolute;
  top: 50%;
  width: 200%;
  height: 2px;
  background: repeating-linear-gradient(90deg, #FF5F00 0, #FF5F00 40px, transparent 40px, transparent 80px);
  animation: road-speed 0.6s linear infinite;
}

@keyframes road-speed {
  from { transform: translateX(0); }
  to { transform: translateX(-80px); }
}

/* ── THE TRUCK (Smooth, Continuous Motion) ────────────────────────────── */
.truck-unit {
  position: absolute;
  bottom: 45px;
  left: -400px;
  display: flex;
  align-items: flex-end;
  /* 'linear' makes the speed perfectly constant from start to finish */
  animation: delivery-drive-by 10s linear infinite;
  z-index: 50;
}

@keyframes delivery-drive-by {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100vw + 600px)); }
}

/* ── THE FUMES (Highly Visible) ───────────────────────────────────────── */
.exhaust {
  position: absolute;
  left: -10px; 
  bottom: 8px;
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.8); /* Brighter white */
  border-radius: 50%;
  filter: blur(3px);
  animation: exhaust-puff 0.4s ease-out infinite;
}

@keyframes exhaust-puff {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(4) translate(-40px, -5px); opacity: 0; }
}

/* ── THE TRUCK BODY ──────────────────────────────────────────────────── */
.truck-body {
  background: #FF5F00;
  width: 140px;
  height: 50px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 14px;
  position: relative;
  z-index: 10;
  box-shadow: 0 10px 15px rgba(0,0,0,0.3);
}

.truck-cab {
  background: #001B44;
  width: 40px;
  height: 35px;
  border-radius: 0 8px 2px 0;
  position: relative;
  z-index: 10;
}

/* ── THE WHEELS (Anti-Squish Version) ────────────────────────────────── */
.wheel {
  position: absolute;
  /* Use 'bottom' relative to the truck-unit so they stay on the road */
  bottom: -10px; 
  width: 26px;
  height: 26px;
  background: #111;
  border-radius: 50%;
  border: 3px solid #333;
  /* CRITICAL: Prevents flexbox from squishing the circles into ovals */
  flex-shrink: 0; 
  z-index: 60; 
}

.wheel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  background: #555;
  transform: translate(-50%, -50%);
  animation: wheel-spin 0.2s linear infinite;
}

@keyframes wheel-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Precise positioning from the left of the truck-unit */
.w-back-1 { left: 10px; }
.w-back-2 { left: 45px; }
.w-front  { right: 10px; }

/* ── THE UNIT ───────────────────────────────────────────────────────── */
.truck-unit {
  position: absolute;
  bottom: 30px; /* Adjust this to move the whole truck up/down */
  left: -400px;
  display: flex;
  align-items: flex-end;
  animation: delivery-drive-by 10s linear infinite;
  z-index: 50;
  /* Important: Remove overflow: hidden if it exists here */
}