/* docket-popup.css */
/* עיצוב פופ-אפ להצגת טבלת השוברים בדוקט - עיצוב מקצועי ומודרני */

.docket-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeInOverlay 0.2s ease-out;
}

@keyframes fadeInOverlay {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.docket-popup {
  background: #ffffff;
  padding: 32px;
  border-radius: 16px;
  max-width: 96%;
  width: 1500px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  position: relative;
  direction: ltr;
  text-align: left;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.docket-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: #f3f4f6;
  font-size: 1.4em;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
}

.docket-popup-close:hover {
  background-color: #e5e7eb;
  color: #1f2937;
  transform: scale(1.1);
}

.docket-popup-title {
  color: #007bff;
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 2em;
  font-weight: 700;
  direction: ltr;
  text-align: left;
  letter-spacing: -0.02em;
}

.docket-balance-info {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 28px;
  direction: ltr;
  text-align: left;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.docket-balance-info p {
  margin: 0;
  direction: ltr;
  text-align: left;
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
}

.docket-balance-info p strong {
  color: #1e293b;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Table Container with scroll */
.docket-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.docket-vouchers-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  direction: ltr;
  text-align: left;
  font-size: 0.875rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.docket-vouchers-table thead {
  background: linear-gradient(135deg, #007bff, #00c6ff);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.docket-vouchers-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  direction: ltr;
  white-space: nowrap;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.docket-vouchers-table th:first-child {
  border-top-left-radius: 12px;
}

.docket-vouchers-table th:last-child {
  border-top-right-radius: 12px;
}

.docket-vouchers-table td {
  padding: 14px 16px;
  direction: ltr;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
  transition: background-color 0.15s ease;
}

.docket-vouchers-table tbody tr {
  transition: all 0.15s ease;
}

.docket-vouchers-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.docket-vouchers-table tbody tr:hover {
  background-color: #f0f4ff;
  transform: scale(1.001);
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
}

.docket-vouchers-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 12px;
}

.docket-vouchers-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 12px;
}

.docket-vouchers-table tbody tr:last-child td {
  border-bottom: none;
}

/* Number columns - align right for better readability */
.docket-vouchers-table td:nth-child(3),
.docket-vouchers-table td:nth-child(4),
.docket-vouchers-table td:nth-child(5),
.docket-vouchers-table td:nth-child(6),
.docket-vouchers-table td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
}

.docket-vouchers-table th:nth-child(3),
.docket-vouchers-table th:nth-child(4),
.docket-vouchers-table th:nth-child(5),
.docket-vouchers-table th:nth-child(6),
.docket-vouchers-table th:nth-child(7) {
  text-align: right;
}

.docket-vouchers-table th:nth-child(11) {
  text-align: center;
}

.profit-positive {
  color: #16a34a;
  font-weight: 600;
  font-size: 0.9rem;
}

.profit-negative {
  color: #dc2626;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Customer name column - better styling */
.docket-vouchers-table td:nth-child(8) {
  font-weight: 500;
  color: #1e293b;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* PNR column */
.docket-vouchers-table td:nth-child(9) {
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 0.85rem;
  color: #6366f1;
  font-weight: 500;
}

/* Remark column */
.docket-vouchers-table td:nth-child(10) {
  color: #64748b;
  font-style: italic;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Actions column */
.docket-vouchers-table td:nth-child(11) {
  text-align: center;
}

/* Delete button styling */
.voucher-delete-btn {
  background: #ffffff;
  border: 1px solid #dc2626;
  color: #dc2626;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
}

.voucher-delete-btn:hover:not(:disabled) {
  background: #dc2626;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.voucher-delete-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.voucher-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #9ca3af;
}

/* Scrollbar styling */
.docket-popup::-webkit-scrollbar,
.docket-table-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.docket-popup::-webkit-scrollbar-track,
.docket-table-wrapper::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 5px;
}

.docket-popup::-webkit-scrollbar-thumb,
.docket-table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

.docket-popup::-webkit-scrollbar-thumb:hover,
.docket-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive design */
@media (max-width: 1400px) {
  .docket-popup {
    width: 98%;
    padding: 24px;
  }
  
  .docket-vouchers-table {
    font-size: 0.8rem;
  }
  
  .docket-vouchers-table th,
  .docket-vouchers-table td {
    padding: 12px 12px;
  }
}

@media (max-width: 1024px) {
  .docket-popup {
    width: 98%;
    padding: 20px;
  }
  
  .docket-vouchers-table {
    font-size: 0.75rem;
  }
  
  .docket-vouchers-table th,
  .docket-vouchers-table td {
    padding: 10px 8px;
  }

  .docket-balance-info {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .docket-popup {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 16px;
  }
  
  .docket-popup-title {
    font-size: 1.5em;
    margin-bottom: 16px;
  }

  .docket-balance-info {
    grid-template-columns: 1fr;
    padding: 16px;
    margin-bottom: 20px;
  }
  
  .docket-vouchers-table {
    font-size: 0.7rem;
  }
  
  .docket-vouchers-table th,
  .docket-vouchers-table td {
    padding: 8px 6px;
  }

  .docket-vouchers-table th {
    font-size: 0.7rem;
    padding: 10px 6px;
  }
}
