/* =========================================
   ANIMATION TABLEAU DE BORD GPS
========================================= */

.fleet-animation {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-height: 560px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  padding-bottom: 40px;
}

/* Tableau principal */
.fleet-dashboard {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;

  width: 86%;
  height: 440px;
  margin: 0 auto;

  overflow: hidden;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 24px;

  box-shadow: 0 35px 80px rgba(26, 63, 104, 0.16);
  animation: dashboardAppear 1s ease both;
}

/* Barre latérale */
.fleet-sidebar {
  position: relative;
  z-index: 4;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;

  padding-top: 28px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid #e5ebf2;
}

.fleet-sidebar span {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #dfe6ef;
}

.fleet-sidebar .sidebar-main {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #168dde;
  box-shadow: 0 8px 20px rgba(22, 141, 222, 0.25);
}

/* Carte */
.fleet-map {
  position: relative;
  overflow: hidden;

  background:
linear-gradient(rgba(255,255,255,.25),rgba(255,255,255,.25)),
url("../img/bg/c0.png") center center/cover no-repeat;
}

/* Barre supérieure */
.fleet-topbar {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  z-index: 5;

  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 46px;
  padding: 0 18px;

  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 25px rgba(31, 55, 85, 0.1);
  backdrop-filter: blur(10px);
}

.topbar-search {
  width: 115px;
  height: 13px;
  border-radius: 20px;
  background: #e1e8f1;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.topbar-actions span {
  width: 34px;
  height: 13px;
  border-radius: 20px;
  background: #dfe7f0;
}

.topbar-actions span:last-child {
  background: #c9e8f8;
}

/* Route */
.fleet-route {
  position: absolute;
  inset: 0;
  z-index: 2;

  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-shadow,
.route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-shadow {
  stroke: rgba(10, 92, 155, 0.14);
  stroke-width: 10;
}

.route-line {
  stroke: #1599e8;
  stroke-width: 5;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: drawRoute 3.2s ease forwards infinite alternate;
}

.route-point {
  fill: #fff;
  stroke: #1599e8;
  stroke-width: 3;
  animation: routePulse 1.8s ease-in-out infinite;
}

.point-two {
  animation-delay: 0.7s;
}

/* Labels */
.map-label {
  position: absolute;
  z-index: 5;

  display: inline-flex;
  align-items: center;
  gap: 7px;

  padding: 8px 11px;

  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: #15243b;

  font-size: 0.72rem;
  font-weight: 700;

  box-shadow: 0 8px 22px rgba(32, 55, 82, 0.12);
}

.depot-label {
  top: 88px;
  left: 18px;
}

.depot-label span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #21c76b;
}

.destination-label {
  right: 18px;
  bottom: 80px;
}

.destination-label i {
  color: #f25263;
}

/* Véhicule */
.moving-vehicle {
  position: absolute;
  left: 47%;
  top: 60%;
  z-index: 6;

  display: flex;
  flex-direction: column;
  align-items: center;

  animation: vehicleDrive 5s ease-in-out infinite alternate;
}

.vehicle-icon {
  width: 56px;
  height: 56px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 8px solid rgba(225, 255, 238, 0.95);
  border-radius: 50%;

  background: #fff;
  color: #1399e7;
  font-size: 1.45rem;

  box-shadow:
    0 0 0 8px rgba(22, 199, 108, 0.13),
    0 12px 30px rgba(31, 65, 104, 0.22);
}

.vehicle-speed {
  margin-top: 6px;
  padding: 5px 10px;

  border-radius: 20px;
  background: #172036;
  color: #fff;

  font-size: 0.7rem;
  font-weight: 800;
}

/* Carte performance */
.fleet-kpi-card {
  position: absolute;
  top: 80px;
  right: 0;
  z-index: 10;

  display: flex;
  align-items: center;
  gap: 14px;

  min-width: 255px;
  padding: 18px 20px;

  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 45px rgba(21, 52, 89, 0.18);

  animation: floatKpi 4s ease-in-out infinite;
}

.kpi-icon {
  width: 46px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;
  border-radius: 13px;

  background: #ddfae8;
  color: #19b85d;
  font-size: 1.4rem;
}

.fleet-kpi-card span,
.fleet-fuel-card span {
  display: block;
  color: #75839a;
  font-size: 0.8rem;
}

.fleet-kpi-card strong {
  display: block;
  margin-top: 3px;

  color: #111b2d;
  font-size: 0.98rem;
  font-weight: 900;
}

/* Carte carburant */
.fleet-fuel-card {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 10;

  width: 285px;
  padding: 18px;

  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);

  box-shadow: 0 20px 50px rgba(21, 52, 89, 0.18);
  animation: floatFuel 4.8s ease-in-out infinite;
}

.fuel-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.fuel-icon {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: #fff4d7;
  color: #007bff;
  font-size: 1.25rem;
}

.fleet-fuel-card strong {
  display: block;
  margin-top: 3px;

  color: #111b2d;
  font-size: 0.95rem;
  font-weight: 900;
}

.fuel-progress {
  height: 6px;
  margin: 18px 0 12px;

  overflow: hidden;
  border-radius: 20px;
  background: #e8edf3;
}

.fuel-progress span {
  width: 68%;
  height: 100%;
  border-radius: inherit;

  background: linear-gradient(90deg, #007bff, #358eec);
  animation: fuelDrop 3s ease-in-out infinite alternate;
}

.fuel-card-footer {
  display: flex;
  justify-content: space-between;
}

.fuel-card-footer small {
  color: #78869a;
  font-size: 0.7rem;
}

.fuel-card-footer small:last-child {
  color: #007bff;
}

/* Animations */
@keyframes dashboardAppear {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawRoute {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes routePulse {
  0%,
  100% {
    r: 5;
    opacity: 1;
  }

  50% {
    r: 8;
    opacity: 0.55;
  }
}

@keyframes vehicleDrive {
  0% {
    transform: translate(-22px, -16px);
  }

  100% {
    transform: translate(20px, 22px);
  }
}

@keyframes floatKpi {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes floatFuel {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(10px);
  }
}

@keyframes fuelDrop {
  from {
    width: 75%;
  }

  to {
    width: 52%;
  }
}

/* Tablettes */
@media (max-width: 991px) {
  .fleet-animation {
    max-width: 700px;
    min-height: 540px;
  }

  .fleet-dashboard {
    width: 90%;
  }

  .fleet-kpi-card {
    right: 10px;
  }

  .fleet-fuel-card {
    left: 10px;
  }
}

/* Mobile */
@media (max-width: 650px) {
  .fleet-animation {
    min-height: 430px;
    padding: 10px 0 75px;
  }

  .fleet-dashboard {
    grid-template-columns: 48px 1fr;
    width: 100%;
    height: 330px;
    border-radius: 18px;
  }

  .fleet-sidebar {
    gap: 21px;
    padding-top: 20px;
  }

  .fleet-sidebar span {
    width: 20px;
    height: 20px;
  }

  .fleet-sidebar .sidebar-main {
    width: 30px;
    height: 30px;
  }

  .fleet-topbar {
    top: 12px;
    left: 12px;
    right: 12px;
    height: 38px;
  }

  .topbar-search {
    width: 70px;
  }

  .fleet-kpi-card {
    top: 62px;
    right: 8px;

    min-width: 190px;
    padding: 12px 14px;
  }

  .kpi-icon {
    width: 36px;
    height: 36px;
  }

  .fleet-kpi-card span {
    font-size: 0.67rem;
  }

  .fleet-kpi-card strong {
    font-size: 0.78rem;
  }

  .fleet-fuel-card {
    left: 8px;
    bottom: 5px;

    width: 235px;
    padding: 14px;
  }

  .fuel-icon {
    width: 36px;
    height: 36px;
  }

  .fleet-fuel-card span {
    font-size: 0.68rem;
  }

  .fleet-fuel-card strong {
    font-size: 0.8rem;
  }

  .map-label {
    font-size: 0.58rem;
    padding: 6px 8px;
  }

  .vehicle-icon {
    width: 45px;
    height: 45px;
    border-width: 6px;
    font-size: 1.1rem;
  }

  .vehicle-speed {
    font-size: 0.57rem;
  }
}

/* Très petits écrans */
@media (max-width: 390px) {
  .fleet-animation {
    min-height: 405px;
  }

  .fleet-dashboard {
    height: 300px;
  }

  .fleet-kpi-card {
    transform: scale(0.9);
    transform-origin: top right;
  }

  .fleet-fuel-card {
    width: 215px;
  }

  .destination-label {
    right: 8px;
    bottom: 60px;
  }
}