/* Receipt Generation Styles */
.receipts-page {
  max-width: 1200px;
  margin: 0 auto;
}

.receipt-form-container {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section {
  margin-bottom: 30px;
}

.form-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #5B2C6F;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #E8DFF5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.form-control {
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: #5B2C6F;
  box-shadow: 0 0 0 3px rgba(91, 44, 111, 0.1);
}

/* Payments Section */
.payments-section {
  background: #F9F7FC;
  border-radius: 8px;
  padding: 20px;
  margin-top: 10px;
}

#paymentsContainer {
  margin-bottom: 20px;
}

.payment-row {
  background: white;
  border: 1px solid #E8DFF5;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  position: relative;
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.payment-row-number {
  background: #5B2C6F;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 28px;
}

.payment-row-content {
  flex: 1;
}

.btn-remove-payment {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dc3545;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.btn-remove-payment:hover {
  background: #c82333;
}

#addPaymentBtn {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s;
}

#addPaymentBtn:hover {
  background: #218838;
}

/* Action Buttons */
.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #E8DFF5;
}

.btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-primary {
  background: #5B2C6F;
  color: white;
}

.btn-primary:hover {
  background: #4A2359;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 44, 111, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-outline {
  background: white;
  color: #5B2C6F;
  border: 2px solid #5B2C6F;
}

.btn-outline:hover {
  background: #5B2C6F;
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Receipt Preview Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: white;
  margin: 50px auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s;
}

.modal-content.large {
  max-width: 1000px;
}

.modal-header {
  /* Global modal header theme (purple + black accent) */
  background: var(--gradient-modal-header);
  color: white;
  padding: 20px 30px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.3s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 30px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-actions {
  padding: 20px 30px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .receipt-form-container {
    padding: 20px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .payment-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .payment-row-number {
    margin-top: 0;
    align-self: flex-start;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .modal-content {
    width: 95%;
    margin: 20px auto;
  }
}

/* Toast Notifications - Compact Style */
.toast {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 10px !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 150px !important;
  overflow-y: auto !important;
}

.toast.show {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

.toast i {
  font-size: 16px !important;
  flex-shrink: 0 !important;
  width: 16px !important;
  height: 16px !important;
  line-height: 1 !important;
}

.toast-error {
  border-left: 4px solid #dc3545 !important;
}

.toast-error i {
  color: #dc3545 !important;
}

.toast-success {
  border-left: 4px solid #28a745 !important;
}

.toast-success i {
  color: #28a745 !important;
}

.toast-warning {
  border-left: 4px solid #ffc107 !important;
}

.toast-warning i {
  color: #ffc107 !important;
}

.toast-info {
  border-left: 4px solid #17a2b8 !important;
}

.toast-info i {
  color: #17a2b8 !important;
}

.toast span {
  flex: 1 !important;
  color: #333 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  word-wrap: break-word !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  height: auto !important;
  max-width: 100% !important;
}

/* Print Styles */
@media print {
  .sidebar,
  .top-bar,
  .form-actions,
  .btn-remove-payment,
  #addPaymentBtn {
    display: none !important;
  }
  
  .receipt-form-container {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
