:root {
  --primary-color: #3498db;
  --secondary-color: #2980b9;
  --accent-color: #e74c3c;
  --text-color: #333;
  --light-gray: #f5f5f5;
  --border-color: #ddd;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f9f9f9;
  color: var(--text-color);
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
}

.form-section {
  background-color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  min-width: 200px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

input,
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: var(--secondary-color);
}

.btn-print {
  background-color: #27ae60;
  margin-right: 10px;
}

.btn-print:hover {
  background-color: #219653;
}

.btn-download {
  background-color: var(--accent-color);
}

.btn-download:hover {
  background-color: #c0392b;
}

.action-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* Invoice Preview Styling */
#invoice-preview {
  background-color: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  overflow: hidden;
}

.invoice-container {
  padding: 40px;
}

/* Invoice Header */
.invoice-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
}

.company-info {
  flex: 1;
}

.company-logo {
  margin-bottom: 15px;
}

.invoice-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 30px;
  text-align: center;
}

.customer-info {
  flex: 1;
  text-align: right;
}

.info-title {
  font-weight: bold;
  margin-bottom: 5px;
}

/* Invoice Table */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.invoice-table th {
  background-color: var(--primary-color);
  color: white;
  padding: 12px;
  text-align: left;
}

.invoice-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.invoice-table tr:last-child td {
  border-bottom: none;
}

.description-cell {
  width: 40%;
}

/* Invoice Footer */
.invoice-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.totals-table {
  width: 300px;
  margin-left: auto;
  border-collapse: collapse;
}

.totals-table td {
  padding: 8px;
}

.totals-table tr:last-child {
  font-weight: bold;
  font-size: 18px;
}

.payment-terms {
  margin-top: 30px;
}
.print-table {
  display: none;
}
/* Print Styles */
@media print {
  .print-table {
    display: table;
  }
  :root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
  }
  body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    /* visibility: hidden; */
    margin: 0px 50px 0 50px;
  }

  @page {
    /* size: A4; */
    margin: 0;
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .font-semibold {
    font-weight: 600;
  }

  .invoice_header_title {
    display: block;
    font-size: 32px;
    font-weight: 400;
    padding-bottom: 14px;
    border: 1 px solid red;
  }
  .invoice_header_num {
    font-weight: 600;
  }

  .invoice_header_date {
    margin-bottom: 15px;
  }

  .invoice_header_bill {
    font-weight: 600;
  }

  .invoice-table {
    width: 100%;
    border-collapse: collapse;
  }

  .invoice-table thead tr th {
    background-color: #441333 !important;
    -webkit-print-color-adjust: exact; /* For Chrome/Safari */
    print-color-adjust: exact; /* Standard */
    color: white;
    padding: 12px;
    text-align: left;
  }

  .invoice_print_footer {
    position: block;
    width: 100%;
    bottom: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 50px 50px 0 50px;
  }

  .invoice_print_footer::before {
    content: "";
    display: block;
    height: 1px; /* Your desired spacing */
    margin-top: 1cm;
  }

  .print-totals-table {
    width: 50%;
    margin-left: auto;
  }

  .print-totals-table div span {
    padding: 8px;
  }

  .print-totals-table div:last-child span {
    font-weight: bold;
    font-size: 18px;
  }

  .invoice_print_body:last-child {
    width: 100%;
  }

  #invoice-preview,
  #invoice-preview * {
    visibility: visible;
  }
  #invoice-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  .no-print {
    display: none !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .invoice-header {
    flex-direction: column;
  }
  .customer-info {
    text-align: left;
    margin-top: 20px;
  }
  .form-row {
    flex-direction: column;
  }
}
