/* Main container for orders */
#orders-container {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-height: 500px;
  overflow-x: auto;
  transition: max-height 0.5s ease, opacity 0.5s ease;
  opacity: 0;
  z-index: 1000;
  /* background-color: #efefef; */
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

/* Orders container becomes visible when active */
#orders-container.active {
  max-height: 500px;
  opacity: 1;
}

/* Individual order boxes */
.order-box {
  width: 255px;
  min-width: 255px;
  height: auto;
  min-height: 45px;
  margin: 5px;
  padding: 4px 6px;
  border-radius: 10px;
  box-sizing: border-box;
  background-color: #ffffff;
  border: 1px solid #ececec;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out, font-size 0.3s ease, box-shadow 0.2s ease;
  opacity: 1;
  animation: slideUp 0.3s ease-in-out;
  flex: 0 0 auto;
  cursor: pointer;
}

.order-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Tugmalar qatori */
.order-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}
/* telefon holati (header'da) */
.phone {
  font-size: 14px;
  flex: 0 0 auto;
}
/* time-left pastki qatorда, chapда */
.status-counts .time-left {
  flex: 0 0 auto;
}

/* .order-box.active {
  height: 140px;
} */

/* When clicked, show the action buttons and shrink the text */
/* .order-box.active .order-footer {
  display: block;
} */

/* .order-box.active .order-body {
  font-size: 18px;
  font-weight: bold;
} */

/* .order-box.active .status-counts {
  font-size: 16px;
} */

/* .order-box.active .time-left,
.order-box.active .driver-id {
  font-size: 16px;
} */

/* Larger text when buttons are hidden */
.order-box .order-body {
  font-size: 13px;
  font-weight: bold;
}

.order-box .status-counts {
  font-size: 12px;
  font-weight: bold;
}

.order-box .time-left,
.order-box .driver-id {
  font-size: 13px;
  font-weight: bold;
}

/* Order header: contains driverId and time left */
.order-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: bold;
}

/* Status counts section on the second line */
.status-counts {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 10px; /* header'dan bo'shliq + badge uchun joy */
}

/* Verdikt statistikasi (30 kun): 4 verdikt icon+son + firibgarlik % chip */
.status-counts .vstats {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.status-counts .vstat {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 700;
  color: #444;
}
.status-counts .vstat i {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
/* JUST_CANCEL — yashil ✓ */
.status-counts .vs-just i {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234caf50' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
/* CANCEL_PENALTY_10 — sariq ⚠ */
.status-counts .vs-p10 i {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff9800' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}
/* NOT_CANCEL_PENALTY_20 — qizil ⊘ */
.status-counts .vs-p20 i {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f44336' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='4.93' y1='4.93' x2='19.07' y2='19.07'/%3E%3C/svg%3E");
}
/* DO_NOTHING — kulrang — */
.status-counts .vs-none i {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}
/* Firibgarlik % — rang-kodli chip (driver yonida), kattaroq */
.fraud {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.fr-low { background-color: #2e9e4f; }
.fr-mid { background-color: #ff9800; }
.fr-high { background-color: #e53935; }
.fr-none { background-color: #b0b0b6; }
/* sabab matni — joyga sig'masa qisqartiriladi */
.order-header .order-body {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-header .driver-id { flex: 0 0 auto; }
.order-header .time-left { flex: 0 0 auto; }

/* Driver-id — alohida badge (ramka) */
.driver-id {
  display: inline-flex;
  align-items: center;
  background: #eef1f6;
  border: 1px solid #d6dbe4;
  border-radius: 6px;
  padding: 2px 8px;
  color: #1f2937;
  letter-spacing: 0.3px;
  flex: 0 0 auto;
}

/* Time left — zamonaviy pill + soat iconi */
.time-left {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: bold;
  color: #2563eb;
  background: #eaf1ff;
  border-radius: 999px;
  padding: 2px 9px 2px 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.time-left::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Buttons for XA and YO'Q */
.order-footer button {
  margin: 4px;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* 4 actionType tugmasi — icon (::before) + jarima raqami (::after, faqat jarima bor tugmalarда) */
.order-footer .act {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 22px;
  min-width: 26px;
  padding: 0 5px;
  margin: 0;
  border: none;
  border-radius: 5px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
/* verdikt soni — tugma o'ng tepa burchagida badge */
.order-footer .act .cnt-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #ffffff;
  color: #333333;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  font-size: 9px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
  pointer-events: none;
}
.order-footer .act::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
/* JUST_CANCEL — yashil ✓ (jarimasiz) */
.order-footer .act-just { background-color: #4caf50; }
.order-footer .act-just:hover { background-color: #45a049; }
.order-footer .act-just::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
/* CANCEL_PENALTY_10 — sariq ⚠ + -10 */
.order-footer .act-p10 { background-color: #ff9800; }
.order-footer .act-p10:hover { background-color: #f57c00; }
.order-footer .act-p10::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}
.order-footer .act-p10::after { content: "-10"; }
/* NOT_CANCEL_PENALTY_20 — qizil ⊘ + -20 */
.order-footer .act-p20 { background-color: #f44336; }
.order-footer .act-p20:hover { background-color: #d32f2f; }
.order-footer .act-p20::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='4.93' y1='4.93' x2='19.07' y2='19.07'/%3E%3C/svg%3E");
}
.order-footer .act-p20::after { content: "-20"; }
/* DO_NOTHING — kulrang — (jarimasiz) */
.order-footer .act-none { background-color: #757575; }
.order-footer .act-none:hover { background-color: #616161; }
.order-footer .act-none::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
}

/* Oq fon + tur farqi chap tomonda rang chizig'i bilan (o'lchamга ta'sirsiz) */
/* 'new' tur — yashil chiziq */
.order-box[style*="lightgreen"] {
  background-color: #ffffff !important;
  border: 1px solid #ececec;
  box-shadow: inset 4px 0 0 #34c759, 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 'strictly' tur — oq fon, qizil chiziqsiz */
.order-box[style*="lightcoral"] {
  background-color: #ffffff !important;
  border: 1px solid #ececec;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Animation for sliding the order box upwards */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Media queries for responsiveness */
@media screen and (max-width: 480px) {
  #orders-container {
    width: 100%;
  }

  .order-box {
    margin: 5px;
    padding: 10px;
  }

  .order-header {
    font-size: 12px;
  }

  .order-body {
    font-size: 12px;
  }

  .status-counts {
    font-size: 12px;
  }

  .order-footer button {
    padding: 5px 10px;
    font-size: 12px;
  }
}
