body {
  margin: 24px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  --accent-color: #076EFF;
  color: #202124;
  position: relative;
  min-height: 100vh;
  padding-bottom: 150px; /* Add space for the processing sections */
}

main {
  box-sizing: border-box;
  width: 100%;
  padding: 24px;
  max-width: 460px;
  margin: 0 auto;
  border-radius: 20px;
}

* {
  outline-color: var(--accent-color);
}

main {
  background-color: #fff;
}

h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
  font-size: 24px;
}

h1::before {
  content: '';
  display: inline-block;
  background: url(gemini.svg);
  width: 40px;
  height: 40px;
  background-size: cover;
}

form {
  margin: 0;
}

.image-picker {
  display: flex;
  width: 100%;
  gap: 8px;
  margin-top: 24px;
}

.image-choice {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.image-choice:has(:checked)::before {
  pointer-events: none;
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 1;
  color: white;
  content: '✓';
  background-color: var(--accent-color);
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font-weight: bold;
  border-radius: 100px;
  box-shadow: 0 0 0 2px #fff;
}

.image-choice:has(:checked)::after {
  content: '';
  position: absolute;
  pointer-events: none;
  inset: 0;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px var(--accent-color) inset,
    0 0 0 4px #fff inset;
}

.image-choice img {
  width: 100%;
}

.image-choice input {
  opacity: 0;
  position: absolute;
}

.image-choice:focus-within::after {
  box-shadow: 0 0 0 4px var(--accent-color) inset;
}

.prompt-box {
  margin: 24px 0;
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

label {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}

input,
button {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: unset;
  font-size: 16px;
}

button {
  border-color: var(--accent-color);
  background-color: var(--accent-color);
  color: white;
  font-weight: bold;
  cursor: pointer;
  opacity: 1;
}

button:focus-visible {
  outline: 2px solid white;
  outline-offset: -4px;
}

button:hover {
  opacity: 0.95;
}

/* Improved section styling */
.upload-section, #history-section, #results-section {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #eaeaea;
  border-radius: 10px;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Position progress sections at the bottom */
#progress-section, #pdf-progress-section {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid #eaeaea;
  padding: 12px 24px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 100;
  margin-top: 0;
}

/* Enhanced progress bar */
#progress-bar-container, #pdf-progress-bar-container {
  width: 100%;
  background-color: #f3f3f3;
  border-radius: 8px;
  margin: 15px 0;
  overflow: hidden;
}

#progress-bar, #pdf-progress-bar {
  height: 16px;
  background-color: var(--accent-color);
  text-align: center;
  line-height: 16px;
  color: white;
  font-size: 12px;
  font-weight: bold;
  transition: width 0.5s ease;
}

/* Better table styling */
#results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #eaeaea;
}

#results-table th,
#results-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eaeaea;
}

#results-table th {
  background-color: #f5f5f5;
  font-weight: 600;
  color: #444;
}

#results-table tr:hover {
  background-color: rgba(7, 110, 255, 0.05);
}

#results-table tr:last-child td {
  border-bottom: none;
}

/* Download button styling */
#download-button {
  margin-top: 16px;
  padding: 12px 16px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: bold;
  transition: background-color 0.2s;
}

#download-button:hover {
  background-color: #0055cc;
}

/* File upload styling */
#excel-file {
  margin: 12px 0;
  width: 100%;
  padding: 8px;
}

/* Status output styling */
#status-output {
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background-color: #f8f9fa;
  color: #444;
  font-size: 14px;
}

/* History styling */
#history-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#history-list li {
  margin-bottom: 8px;
  padding: 10px 12px;
  background-color: #f5f5f5;
  border-radius: 6px;
  font-size: 14px;
  border-left: 4px solid var(--accent-color);
}

/* Section headers */
h2 {
  font-size: 18px;
  margin: 0 0 12px 0;
  color: #333;
}

/* Tab Styling */
#function-tabs button.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  font-weight: 600;
}

/* Keep the icon for Excel Tool if needed */
h2.excel-title::before {
  content: '';
  display: inline-block;
  background: url(gemini.svg);
  width: 24px;
  height: 24px;
  margin-right: 8px;
  background-size: cover;
}

/* Custom styling for file inputs */
input[type="file"] {
  cursor: pointer;
}

/* PDF File list styling */
.pdf-file-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: #f9fafb;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
}

.pdf-file-item .file-name {
  flex-grow: 1;
}

.pdf-file-item .file-status {
  margin-left: 1rem;
}

.pdf-file-item .status-pending {
  color: #9ca3af;
}

.pdf-file-item .status-processing {
  color: #e67e22;
}

.pdf-file-item .status-complete {
  color: #22c55e;
}

.pdf-file-item .status-error {
  color: #ef4444;
}

/* Animation for processing indicator */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.processing-indicator {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Success item in history */
.success-item {
  border-left-color: #22c55e !important;
}

/* Failed item in history */
.failed-item {
  border-left-color: #ef4444 !important;
}

/* Processing item in history */
.processing-item {
  border-left-color: #f59e0b !important;
}

/* JSON Viewer Styling */
.json-viewer {
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
}

.json-toggle {
  cursor: pointer;
  color: #555;
  padding: 2px;
  border-radius: 2px;
  display: inline-block;
  margin-right: 4px;
}

.json-toggle:hover {
  background-color: #eee;
}

.json-content {
  padding-left: 20px;
  border-left: 1px dotted #ccc;
  margin-left: 2px;
}

.json-key {
  color: #a52a2a;
  font-weight: bold;
  margin-right: 4px;
}

.json-object, .json-array {
  color: #333;
  font-weight: normal;
}

/* Custom styling for invoice data */
.invoice-container, .books-container {
  font-family: system-ui, sans-serif;
  font-size: 14px;
}

.invoice-card {
  margin-bottom: 24px;
}

.invoice-card h3, .invoice-card h4 {
  margin-top: 0;
}

.invoice-card table {
  border-collapse: collapse;
  width: 100%;
}

.invoice-card th, td {
  text-align: left;
  padding: 6px 8px;
}

.invoice-card th {
  background-color: #f3f4f6;
  font-weight: 600;
}

.invoice-card tr:nth-child(even) {
  background-color: #f9fafb;
}

.invoice-card tr:hover {
  background-color: #f1f5f9;
}

/* New styles for multi-file PDF display */
.pdf-file-list {
  margin-bottom: 16px;
}

.pdf-file-item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background-color: #f9fafb;
}

.pdf-file-icon {
  color: #ef4444;
  margin-right: 8px;
}

.pdf-file-name {
  flex: 1;
  font-weight: 500;
}

.pdf-file-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pdf-file-status.processing {
  background-color: #fef3c7;
  color: #92400e;
}

.pdf-file-status.completed {
  background-color: #d1fae5;
  color: #047857;
}

.pdf-file-status.failed {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Tab styling improvements */
#function-tabs button {
  position: relative;
  transition: all 0.2s;
}

#function-tabs button::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: transparent;
  transition: all 0.2s;
}

#function-tabs button.active::after {
  background-color: var(--accent-color);
}

/* Improved table styling */
table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table.data-table thead th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #64748b;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

table.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}

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

table.data-table tbody tr:hover {
  background-color: #f1f5f9;
}

/* Fix for the main content to give space for the fixed progress bar at bottom */
/* #function-content {
  padding-bottom: 100px;
} */