/* File Upload Section */
.upload-section {
  margin: 30px 0;
  max-width: 800px;
}

.type-selection {
  margin: 20px 0;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.type-selection label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Text Input Section */
.text-input-section {
  margin: 20px 0;
}

.text-input-section label {
  display: block;
  margin-bottom: 10px;
  color: #495057;
}

.text-input-area {
  width: 100%;
  padding: 15px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.text-input-area:focus {
  outline: none;
  border-color: #3498db;
}

.text-input-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.text-input-info {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.info-badge {
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #0056b3;
}

.divider-text {
  text-align: center;
  margin: 30px 0;
  font-weight: bold;
  color: #6c757d;
  position: relative;
}

.divider-text::before,
.divider-text::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #dee2e6;
}

.divider-text::before {
  left: 0;
}

.divider-text::after {
  right: 0;
}

/* Drop Zone */
.drop-zone {
  border: 3px dashed #dee2e6;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  background: #f8f9fa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.drop-zone:hover {
  border-color: #3498db;
  background: #e9ecef;
}

.drop-zone.drag-over {
  border-color: #28a745;
  background: #d4edda;
  border-style: solid;
}

.upload-icon {
  font-size: 48px;
  color: #6c757d;
  margin-bottom: 15px;
}

.drop-text {
  font-size: 18px;
  color: #495057;
  margin: 10px 0;
}

.drop-text-or {
  font-size: 14px;
  color: #6c757d;
  margin: 15px 0;
}

.file-info {
  font-size: 12px;
  color: #6c757d;
  margin-top: 15px;
}

#fileInfoDisplay {
  margin-top: 20px;
  padding: 20px;
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
}

#fileInfoDisplay p {
  margin: 10px 0;
}

#fileInfoDisplay button {
  margin-right: 10px;
  margin-top: 10px;
}

/* Button Grid Layout */
.button-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 30px 0;
  max-width: 800px;
}

.test-button {
  padding: 15px 20px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.test-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.test-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Results Display */
#resultsContainer {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

#resultsOutput {
  background: #ffffff;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

/* Error Display */
#errorContainer {
  margin-top: 30px;
  padding: 20px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  color: #721c24;
}

#errorOutput {
  background: #ffffff;
  padding: 15px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  overflow-x: auto;
}

/* Loading Spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .button-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .button-grid {
    grid-template-columns: 1fr;
  }
}

/* Results Summary Modal */
.summary-stats {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
}

.stat-badge {
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-badge i {
  font-size: 18px;
}

.success-badge {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error-badge {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.action-buttons .btn {
  flex: 1;
  min-width: 150px;
}

.save-recents-wrapper {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.limit-text {
  color: #6c757d;
  font-size: 11px;
  margin-top: 2px;
}

.error-toggle {
  padding: 5px 10px;
  text-decoration: none;
  font-weight: 600;
  color: #721c24;
}

.error-toggle:hover {
  text-decoration: none;
  color: #491217;
}

.error-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  background: #f8f9fa;
  border-radius: 4px;
  padding: 15px;
}

.error-list li {
  padding: 8px 0;
  border-bottom: 1px solid #dee2e6;
  font-size: 14px;
}

.error-list li:last-child {
  border-bottom: none;
}

.error-list .error-query {
  font-weight: 600;
  color: #dc3545;
}

.error-list .error-message {
  color: #6c757d;
  margin-left: 5px;
}
