.invoice-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  border-radius: 8px;
}

/* Header Section */
.invoice-container header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.invoice-container .logo {
  display: flex;
  align-items: center;
  gap: 20px;
}

.invoice-container .logo img {
  max-height: 80px;
  max-width: 150px;
  object-fit: contain;
}

.invoice-container .logo h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: #2c3e50;
}

.invoice-container .status {
  text-align: right;
}

.invoice-container .status p {
  margin: 5px 0;
  font-size: 14px;
}

.invoice-container .status p.unpaid {
  background-color: #ffecec;
  color: #d63031;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
}

.invoice-container .status button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.terms-conditions {
  page-break-before: always;
  font-size: 0.85rem;
  line-height: 1.5;
  max-height: 500px;
  overflow-y: auto;
}

/* Address Section */
.address-section {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 30px;
}

.address-section h2 {
  font-size: 18px;
  color: #2c3e50;
  margin-bottom: 15px;
  font-weight: 600;
}

.address-section p {
  margin: 5px 0;
  font-size: 14px;
  line-height: 1.5;
}

/* Details Section */
.details-section {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 30px;
}

.details-section h2 {
  font-size: 18px;
  color: #2c3e50;
  margin-bottom: 15px;
  font-weight: 600;
}

/* Table Styling */
.invoice-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.invoice-container table thead {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.invoice-container table th {
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.invoice-container table td {
  padding: 12px 15px;
  border-bottom: 1px solid #dee2e6;
  font-size: 14px;
}

.invoice-container .note {
  font-size: 12px;
  color: #7f8c8d;
  font-style: italic;
  margin-top: -20px;
  margin-bottom: 30px;
}

/* Transactions Section */
.transactions-section {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.transactions-section table td[colspan="4"] {
  text-align: center;
  color: #7f8c8d;
  padding: 20px;
}

.transactions-section table tr:last-child td {
  font-weight: 600;
  background-color: #f8f9fa;
}

/* Footer Buttons */
.invoice-container footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.invoice-container footer button {
  padding: 10px 25px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.invoice-container footer #btnPrint {
  background-color: #3498db;
  color: white;
}

.invoice-container footer #download {
  background-color: #27ae60;
  color: white;
}

/* Print Specific Styles */
@media print {
  body * {
    visibility: hidden;
  }

  .invoice-container,
  .invoice-container * {
    visibility: visible;
  }

  .invoice-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .invoice-container footer,
  .invoice-container .status button {
    display: none !important;
  }

  /* Ensure tables don't break across pages */
  table {
    page-break-inside: avoid;
  }
  tr {
    page-break-inside: avoid;
  }
  td {
    page-break-inside: avoid;
  }
}
