/* ============================================
   TRANSACTIONS GRID - BASE LAYOUT
   ============================================ */

.transactions-grid {
  display: grid;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  gap: 12px;
}

/* Desktop - All 12 columns visible */
@media (min-width: 1600px) {
  .transactions-grid {
    grid-template-columns: 
      60px      /* 1. ID */
      140px     /* 2. Machine ID */
      180px     /* 3. Transaction ID */
      180px     /* 4. Product */
      70px      /* 5. Qty */
      140px     /* 6. Status */
      110px     /* 7. Amount */
      120px     /* 8. Payment */
      180px     /* 9. Receiving Status */
      130px     /* 10. Return Amount */
      180px     /* 11. Date & Time */
      200px;    /* 12. Actions */
  }
}

/* Large Laptop (1200px - 1599px) */
@media (min-width: 1200px) and (max-width: 1599px) {
  .transactions-grid {
    grid-template-columns: 
      50px 120px 150px 150px 60px 130px 100px 110px 160px 120px 160px 180px;
  }
}

/* Tablet Landscape (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
  .transactions-grid {
    grid-template-columns: 
      50px 120px 150px minmax(120px, 1fr) 130px 100px 160px;
  }
  
  .transactions-grid > div:nth-child(5),
  .transactions-grid > div:nth-child(8),
  .transactions-grid > div:nth-child(9),
  .transactions-grid > div:nth-child(10),
  .transactions-grid > div:nth-child(11) {
    display: none !important;
  }
}

/* Tablet Portrait (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .transactions-grid {
    grid-template-columns: 45px 100px minmax(120px, 1fr) 180px;
    padding: 10px 12px;
  }
  
  .transactions-grid > div:nth-child(4),
  .transactions-grid > div:nth-child(5),
  .transactions-grid > div:nth-child(6),
  .transactions-grid > div:nth-child(7),
  .transactions-grid > div:nth-child(8),
  .transactions-grid > div:nth-child(9),
  .transactions-grid > div:nth-child(10),
  .transactions-grid > div:nth-child(11) {
    display: none !important;
  }
}

/* Mobile (< 576px) */
@media (max-width: 575px) {
  .transactions-grid {
    grid-template-columns: 40px minmax(100px, 1fr) 130px;
    padding: 8px;
    gap: 8px;
    font-size: 12px;
  }
  
  .transactions-grid > div:nth-child(2),
  .transactions-grid > div:nth-child(4),
  .transactions-grid > div:nth-child(5),
  .transactions-grid > div:nth-child(6),
  .transactions-grid > div:nth-child(7),
  .transactions-grid > div:nth-child(8),
  .transactions-grid > div:nth-child(9),
  .transactions-grid > div:nth-child(10),
  .transactions-grid > div:nth-child(11) {
    display: none !important;
  }
}

/* ============================================
   HEADER ROW STYLING
   ============================================ */

.transactions-grid.text-secondary {
  background: #f9fafb;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dark .transactions-grid.text-secondary {
  background: rgba(0, 0, 0, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   DATA ROW STYLING
   ============================================ */

.transactions-grid:not(.text-secondary) {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #e5e7eb;
}

.transactions-grid:not(.text-secondary):hover {
  background-color: #f3f4f6;
}

.dark .transactions-grid:not(.text-secondary):hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.transactions-grid > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  
  &.success {
    background-color: #dcfce7;
    color: #166534;
  }
  
  &.failed {
    background-color: #fee2e2;
    color: #991b1b;
  }
  
  &.unprocessed {
    background-color: #fef3c7;
    color: #92400e;
  }
}

/* ============================================
   GRID CONTAINER
   ============================================ */

.grid.min-w-max {
  min-width: 0 !important;
  width: 100%;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 767px) {
  .transactions-grid .flex.gap-2 {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }
  
  .transactions-grid button {
    width: 100%;
    font-size: 11px;
    padding: 6px 4px;
    min-height: 36px;
  }
}
/* ============================================
   FILTER SECTION BUTTON ALIGNMENT
   ============================================ */

/* Fix button heights to match mat-form-field */
.bg-white.dark\:bg-gray-800.border-b button {
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Alternative: Target buttons in the filter grid specifically */
.grid.grid-cols-1.gap-4 button,
.grid.gap-4 button {
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure mat-icon inside buttons is centered */
.grid.gap-4 button mat-icon {
  margin: 0;
}

@media (max-width: 767px) {
  .bg-white.dark\:bg-gray-800.border-b button {
    height: 48px;
    min-height: 48px;
  }
}
/* Transaction Details Dialog */
.dialog-container {
  padding: 0;
}

.dialog-content {
  padding: 20px 24px !important;
  max-height: 70vh;
  overflow-y: auto;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
  
  &:last-child {
    border-bottom: none;
  }
}

.detail-label {
  font-weight: 600;
  color: #666;
  font-size: 14px;
}

.detail-value {
  font-weight: 500;
  color: #333;
  font-size: 14px;
  text-align: right;
}

::ng-deep .mat-mdc-dialog-container {
  --mdc-dialog-container-shape: 12px;
}

::ng-deep .mat-mdc-dialog-surface {
  border-radius: 12px !important;
}

/* Dark mode for dialog */
.dark {
  .detail-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  
  .detail-label {
    color: #999;
  }
  
  .detail-value {
    color: #fff;
  }
}