/* ===========================
   BASE STYLES
   =========================== */
body {
  margin: auto;
}

/* ===========================
   CARD COMPONENTS
   =========================== */
.card {
  border-radius: 16px;
}

.card-header {
  padding: 10px;
  color: white;
  background-color: var(--theme-color);
  border-radius: 10px;
}

.card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.card-footer {
  background: #f8f9fa;
  font-size: 0.9rem;
  padding: 0.3rem;
}

.card-footer .right {
  font-weight: 600;
  color: #198754;
}

.modern-card {
}

/* ===========================
   TABLE STYLES
   =========================== */
.thistable {
  width: 100%;
  border-collapse: collapse;
}

.thistable td {
  padding: 8px 60px;
  vertical-align: top;
}

.thistable p {
  margin: 0;
  font-size: 0.95rem;
  font-style: italic;
}

.thistable strong {
  color: #495057;
  min-width: 100px;
  display: inline-block;
}

.thistable-wrapper {
  flex-grow: 1;
  display: flex;
  justify-content: flex-start;
  order: 1;
  min-width: 0;
}

/* ===========================
   IMAGE CONTAINER
   =========================== */
.image-container {
  /* Ensure image appears on the left across all breakpoints */
  order: 0;
  margin-left: 0;
  margin-right: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Make the image container a fixed/bounded column so details can occupy remaining space */
  width: 120px;
  flex: 0 0 120px;
  max-width: 25%;
  min-width: 70px;
}

.image-placeholder {
  object-fit: cover;
  border-radius: 8px;
  display: block;
  width: 100%;
  height: auto;
}

/* Wrapper that enforces a left-image / right-details horizontal layout on each order card.
   Use this class on the inner card area (or rely on existing .card-body + .row combos). */
.order-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.order-inner .thistable-wrapper,
.order-inner .details {
  flex: 1;
  min-width: 0; /* allow content to truncate/wrap inside */
}

/* ===========================
   FILTER CARD
   =========================== */
.filter-card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: linear-gradient(145deg, #ffffff, #f8f9ff);
  position: sticky;
  top: 90px;
}

.filter-title {
  color: #4c63d2;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.filter-title i {
  margin-right: 8px;
}

.modern-input,
.modern-select {
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

/* ===========================
   PAGINATION
   =========================== */
.pagination-modern .page-link {
  border: none;
  border-radius: 8px;
  margin: 0 2px;
  color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

.pagination-modern .page-link:hover {
  color: white;
  transform: translateY(-1px);
}

.pagination-modern .page-item.active .page-link {
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pagination-modern .page-item.disabled .page-link {
  background: rgba(0, 0, 0, 0.05);
  color: #ccc;
}

/* ===========================
   ORDER STATS
   =========================== */
.order-stats .stat-number {
  font-size: 1.5rem;
  font-weight: 600;
}

.order-stats .stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
}

/* ===========================
   ACTION BUTTONS
   =========================== */
.action-btn {
  transition: all 0.3s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
}

/* ===========================
   RESPONSIVE: TABLET (768px - 1024px)
   =========================== */
@media (max-width: 1024px) and (min-width: 769px) {
  .container-p-y {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .filter-card {
    position: static;
    margin-bottom: 2rem;
  }

  .col-lg-4 {
    order: 1;
  }

  .col-lg-8 {
    order: 2;
  }

  .gradient-header {
    padding: 12px 16px;
  }

  .order-number {
    font-size: 1rem;
  }

  .action-btn {
    width: 36px;
    height: 36px;
    margin: 0 1px;
  }

  .field-value {
    font-size: 0.9rem;
  }

  .image-placeholder {
    width: 80px;
    height: 80px;
  }

  .order-stats .stat-number {
    font-size: 1.3rem;
  }

  .pagination-modern .page-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* ===========================
   RESPONSIVE: TABLET & BELOW
   =========================== */
@media screen and (max-width: 991px) {
  .thistable td {
    padding: 6px 20px;
    font-size: 0.9rem;
  }

  .image-container {
    margin-left: 0;
    margin-right: 1rem;
    order: 0;
  }
}

/* ===========================
   RESPONSIVE: MOBILE (max-width: 768px)
   =========================== */
@media (max-width: 768px) {
  /* === Layout === */
  .container-p-y {
    padding: 1rem;
  }
  .col-lg-4 {
    order: 1;
  }
  .col-lg-8 {
    order: 2;
  }

  /* === Filters === */
  .filter-card {
    margin-bottom: 2rem;
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
  }

  .filter-card .form-label {
    display: none;
  }

  /*.filter-card input,*/
  /*.filter-card select,*/
  /*.filter-card .modern-input,*/
  /*.filter-card .modern-select {*/
  /*    font-size: 0.8rem;*/
  /*    padding: 5px 8px;*/
  /*    height: 34px;*/
  /*}*/

  .filter-card button {
    width: 100%;
    font-size: 0.8rem;
    padding: 6px 8px;
    margin-top: 5px;
  }

  .filter-card .mb-3 {
    margin: 0 !important;
  }

  /* === Cards & Headers === */
  .modern-card,
  .order-stats {
  }
  .gradient-header {
    padding: 12px 16px;
    flex-direction: column;
  }
  .gradient-header .d-flex {
    width: 100%;
    justify-content: space-between;
  }
  .filter-title {
    font-size: 1.1rem;
  }

  /* === Buttons & Icons === */
  .action-btn {
    width: 32px;
    height: 32px;
    margin: 0 1px;
    border-radius: 8px;
  }
  .action-btn i {
    font-size: 0.8rem;
  }
  .btn-group {
    flex-wrap: nowrap;
  }

  /* === Text & Tables === */
  .field-label {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }
  .field-value {
    font-size: 0.85rem;
    line-height: 1.2;
    word-break: break-word;
  }
  .thistable td {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
  .badge {
    font-size: 0.7rem !important;
    padding: 0.3rem 0.6rem !important;
  }

  /* === Pagination === */
  .pagination-info {
    font-size: 0.75rem;
    text-align: center;
    margin-bottom: 0.5rem;
  }
  .pagination-modern {
    justify-content: center;
  }
  .pagination-modern .page-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    margin: 0 1px;
  }

  /* === Modals === */
  .modal-dialog,
  .modal-body,
  .modal-footer {
    margin: 0.5rem;
    padding: 1rem !important;
  }
  .modal-footer {
    gap: 0.5rem;
  }

  /* === Misc. === */
  /* Keep compact padding, but force a horizontal layout for each order card:
     image on the left, details on the right. */
  .card-body {
    padding-top: 0rem ;
    flex-direction: row; /* ensure image and details are side-by-side */
  }

  /* Ensure the image appears before the details (left side) */
  .image-container {
    order: 0;
    margin-left: 0;
    margin-right: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Make sure details area follows the image */
  .thistable-wrapper {
    order: 1;
    flex-grow: 1;
    min-width: 0; /* allow truncation / wrapping inside */
  }

  .image-placeholder {
    width: 70px;
    height: 70px;
  }
  /*.col-md-6 {*/
  /*  flex: 0 0 100%;*/
  /*  max-width: 100%;*/
  /*}*/
  /*.col-6.col-md-4 {*/
  /*  flex: 0 0 50%;*/
  /*  max-width: 50%;*/
  /*  padding: 0 0.5rem;*/
  /*  margin-bottom: 1rem;*/
  /*}*/
  /* make search input adapt better on very small screens */
  .search-order {
    min-width: auto;
    width: 100%;
  }
  .mobile-div {
    display: flex;
    flex-direction: row;
  }
  .overscroll-stop{
      width: 70%;
  }
}

/* ===========================
   RESPONSIVE: LANDSCAPE MOBILE
   =========================== */
@media (max-height: 500px) and (orientation: landscape) {
  .filter-card {
    position: static;
  }

  .modern-card {
    margin-bottom: 1rem;
  }

  .gradient-header {
    padding: 8px 12px;
  }

  .card-body {
    padding: 0.75rem !important;
  }
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.big-container {
  display: flex;
}
/* === Image Preview Overlay === */
.image-overlay {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);

    /* Centering setup */
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    object-fit: contain;
    cursor: zoom-out;
}
label{
    color : var(--theme-color) !important;
}