/* Main Styles */
body {
  font-family: Arial, sans-serif;
  background: #f5f6fa;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 150vh;
  margin: 0;
  padding: 20px 0;
}

.container {
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
  width: 700px;
  max-width: 90vw;
  text-align: center;
  max-height: 140vh;
  display: flex;
  flex-direction: column;
}

h2 {
  margin-bottom: 20px;
  color: #333;
}

textarea {
  height: 150px;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  resize: both;
  outline: none;
  transition: border 0.3s;
  min-height: 100px;
  min-width: 200px;
}

textarea:focus {
  border-color: #4CAF50;
}

button {
  margin: 5px;
  padding: 10px 20px;
  font-size: 14px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
  white-space: nowrap;
}

button:hover {
  background: #45a049;
}

button:disabled {
  background: #cccccc;
  cursor: not-allowed;
}

.secondary-btn {
  background: #2196F3 !important;
}

.reset-btn {
  background: #f44336 !important;
}

.reset-btn:hover {
  background: #d32f2f !important;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.output {
  margin-top: 20px;
  padding: 15px;
  background: #f1f1f1;
  border-radius: 8px;
  text-align: left;
  min-height: 200px;
  max-height: 400px;
  font-size: 15px;
  color: #333;
  white-space: pre-wrap;
  overflow-y: auto;
  border: 1px solid #ddd;
  flex-grow: 1;
  line-height: 1.6;
}

.output h3 {
  color: #2c3e50;
  margin-top: 25px;
  margin-bottom: 15px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 5px;
}

.output h4 {
  color: #34495e;
  margin-top: 20px;
  margin-bottom: 10px;
}

.output strong {
  color: #2980b9;
}

.output::-webkit-scrollbar {
  width: 8px;
}

.output::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.output::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.output::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* History Modal Styles */
.history-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.history-modal-content {
  background-color: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
}

.history-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header h3 {
  margin: 0;
  color: #333;
}

.history-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.history-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  background: #f9f9f9;
}

.history-prompt {
  background: #e3f2fd;
  padding: 12px 16px;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #e0e0e0;
}

.history-response {
  padding: 16px;
  background: white;
  border-radius: 0 0 8px 8px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
}

.history-timestamp {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

.history-btn {
  padding: 8px 16px;
  font-size: 12px;
  margin-left: 8px;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.history-btn:hover {
  background: #1976D2;
}

.close-btn {
  background: #666 !important;
}

.close-btn:hover {
  background: #444 !important;
}

.no-history {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 40px 20px;
}

/* File Upload Styles */
.file-upload-section {
  margin: 5px 0;
  text-align: center;
}

.file-status {
  margin-left: 10px;
  font-size: 14px;
  color: #666;
  /* limit characters to 10 and single line */
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
}

.batch-progress {
  background: #e3f2fd;
  border: 1px solid #2196F3;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
  display: none;
}

.batch-progress .progress-text {
  color: #1976D2;
  font-weight: bold;
  margin-bottom: 8px;
}

.batch-progress .progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.batch-progress .progress-fill {
  height: 100%;
  background: #2196F3;
  transition: width 0.3s ease;
  width: 0%;
}

/* Responsive Design */
@media (max-width: 600px) {
  .button-group {
    flex-direction: column;
    align-items: center;
  }

  button {
    width: 100%;
    max-width: 200px;
  }
}