/* San Diego Court Calculator Styling */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  background-color: #f0f0f0;
  padding: 10px;
}

.header {
  background: linear-gradient(to bottom, #1e3a8a 0%, #2563eb 100%);
  color: white;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-radius: 5px 5px 0 0;
}

.seal {
  width: 60px;
  height: 60px;
}

.header h1 {
  font-size: 18px;
  font-weight: normal;
}

.container {
  background-color: white;
  border: 1px solid #ccc;
  border-top: none;
}

.section {
  border: 2px solid #000;
  margin: 10px;
}

.section-header {
  background-color: #c0c0c0;
  border-bottom: 2px solid #000;
  padding: 5px 10px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: 13px;
}

.user-guide {
  color: #0000ff;
  text-decoration: underline;
  font-weight: normal;
}

.input-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #e8e8e8;
}

.input-table td {
  padding: 8px;
  text-align: center;
}

.label {
  font-weight: bold;
  background-color: #e8e8e8;
}

.input-field {
  width: 100%;
  padding: 4px;
  border: 2px inset #ddd;
  font-size: 12px;
  background-color: white;
}

.percent {
  font-weight: bold;
  margin-left: 5px;
}

.toggle-btn {
  background-color: #d4d4d4;
  border: 1px outset #999;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
}

.toggle-btn:active {
  border-style: inset;
}

#paymentEntries {
  background-color: #e8e8e8;
}

.payment-row {
  display: flex;
  gap: 10px;
  padding: 5px 10px;
  align-items: center;
}

.payment-row input {
  padding: 4px;
  border: 2px inset #ddd;
  font-size: 12px;
}

.payment-row .date-input {
  width: 150px;
}

.payment-row .amount-input {
  width: 200px;
}

.remove-btn {
  background-color: #ff4444;
  color: white;
  border: 1px outset #cc0000;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11px;
}

.remove-btn:active {
  border-style: inset;
}

.add-btn {
  margin: 10px;
  background-color: #4caf50;
  color: white;
  border: 1px outset #45a049;
  padding: 5px 15px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
}

.add-btn:active {
  border-style: inset;
}

.button-row {
  text-align: center;
  padding: 15px;
  background-color: #e8e8e8;
  border-top: 1px solid #ccc;
}

.action-btn {
  background-color: #d4d4d4;
  border: 2px outset #999;
  padding: 6px 20px;
  margin: 0 5px;
  cursor: pointer;
  font-size: 12px;
  min-width: 100px;
}

.action-btn:active {
  border-style: inset;
}

.calculate-btn {
  background-color: #4caf50;
  color: white;
  font-weight: bold;
}

.results-section {
  min-height: 200px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #e8e8e8;
}

.results-table td {
  padding: 8px;
}

.result-label {
  font-weight: bold;
  text-align: right;
  padding-right: 10px;
  background-color: #e8e8e8;
}

.result-field {
  width: 100%;
  padding: 4px;
  border: 2px inset #ddd;
  background-color: white;
  font-size: 12px;
  text-align: right;
}

.grand-total {
  background-color: #ffffcc;
  font-weight: bold;
}

.no-results {
  padding: 40px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.disclaimer {
  background-color: #fff3cd;
  border: 2px solid #ffc107;
  padding: 15px;
  margin: 10px;
  font-size: 11px;
  line-height: 1.6;
}

.disclaimer strong {
  color: #856404;
}

#timelineDetails {
  padding: 10px;
  background-color: #f9f9f9;
}

#timelineDetails h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #333;
}

.timeline-entry {
  background-color: white;
  border: 1px solid #ddd;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 3px;
}

.timeline-entry h4 {
  font-size: 13px;
  color: #1e3a8a;
  margin-bottom: 5px;
}

.timeline-entry p {
  font-size: 11px;
  margin: 3px 0;
  color: #555;
}

.error-message {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 10px;
  margin: 10px;
  border-radius: 3px;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .header h1 {
    font-size: 14px;
  }

  .input-table td {
    padding: 5px;
  }

  .action-btn {
    padding: 5px 10px;
    min-width: 80px;
    font-size: 11px;
  }
}

/* Transaction Table Styling - Official Calculator Style */
.transaction-table-wrapper {
  overflow-x: auto;
  margin-top: 15px;
  border: 1px solid #999;
  background-color: white;
}

.transaction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background-color: white;
}

.transaction-table thead {
  background-color: #4a90e2;
  color: white;
  font-weight: bold;
}

.transaction-table th {
  padding: 10px 8px;
  text-align: center;
  border: 1px solid #2d5f99;
  font-size: 11px;
  white-space: nowrap;
}

.transaction-table td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}

.transaction-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.transaction-table tbody tr:hover {
  background-color: #e8f4ff;
}

/* Cell type styling */
.amount-cell {
  text-align: right;
  font-family: "Courier New", monospace;
}

.number-cell {
  text-align: center;
}

.principal-balance {
  font-weight: bold;
  background-color: #fffacd;
}

/* Row type styling */
.payment-row {
  background-color: #e8f5e9 !important;
}

.cost-row {
  background-color: #fff3e0 !important;
}

.end-row {
  background-color: #e3f2fd !important;
  font-weight: bold;
}

.payment-row:hover,
.cost-row:hover,
.end-row:hover {
  opacity: 0.9;
}

/* Responsive table on mobile */
@media (max-width: 1024px) {
  .transaction-table {
    font-size: 10px;
  }

  .transaction-table th,
  .transaction-table td {
    padding: 6px 4px;
  }
}

@media (max-width: 768px) {
  .transaction-table-wrapper {
    font-size: 9px;
  }

  .transaction-table th,
  .transaction-table td {
    padding: 4px 2px;
  }
}
