:root {
  --color-primary: #007bff;
  --color-primary-hover: #0056b3;
  --color-success: #28a745;
  --color-success-hover: #1e7e34;
  --color-warning: #856404;
  --color-warning-bg: #fff3cd;
  --color-warning-border: #ffeaa7;
  --color-error: #721c24;
  --color-error-bg: #f8d7da;
  --color-error-border: #f5c6cb;
  --color-success-bg: #d4edda;
  --color-success-border: #c3e6cb;
  --color-success-text: #155724;
  
  /* Text colors */
  --color-text: #333;
  --color-text-muted: #6c757d;
  --color-text-light: #495057;
  --color-text-disabled: #adb5bd;
  
  /* Border colors */
  --color-border: #e9ecef;
  --color-border-light: #ddd;
  
  /* Background colors */
  --color-bg-light: #f8f9fa;
  --color-bg-lighter: #fafafa;
  --color-bg-primary: #f8f9ff;
  --color-bg-secondary: #e9ecef;
  --color-bg-body: #e0e0e0;
  --color-bg-white: white;
  --color-bg-disabled: #ccc;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 1.25rem;
  background: var(--color-bg-body);
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

header img {
  max-width: 15rem;
}

header p {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text-muted);
  font-style: italic;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  background: var(--color-bg-white);
  padding: 2rem;
}

.upload-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 60ch;
}

#uploadForm {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.preview-section {
  flex: 1;
  width: 100%;
  display: none;
}

.preview-section.show {
  display: block;
}

.tabs {
  display: flex;
  border-bottom: 0.125rem solid var(--color-border);
}

.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 0.1875rem solid transparent;
  transition: all 0.3s;
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab:hover:not(:disabled) {
  color: var(--color-primary);
  background: var(--color-bg-light);
}

.tab:disabled {
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

.tab-content {
  display: none;
  width: 100%;
  min-height: 70vh;
  border: 0.0625rem solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-bg-lighter);
}

.tab-content.active {
  display: block;
}

.preview-content {
  padding: 1.25rem;
  width: 100%;
  height: 70vh;
  overflow: auto;
}

h1 {
  color: var(--color-text);
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  border: 0.125rem dashed var(--color-border-light);
  border-radius: 0.5rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
  transition: border-color 0.3s;
}

.hand-span-input {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.hand-span-input input {
  max-width: 10ch;
}

.upload-area.dragover {
  border-color: var(--color-primary);
  background: var(--color-bg-primary);
}

.upload-area input[type="file"] {
  display: none;
}

.upload-btn {
  background: var(--color-primary);
  color: var(--color-bg-white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.upload-btn:hover {
  background: var(--color-primary-hover);
}

.sample-btn {
  background: var(--color-text-muted);
  color: var(--color-bg-white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
  margin-top: 0.5rem;
}

.sample-btn:hover {
  background: var(--color-text-light);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
  font-weight: 500;
  color: var(--color-text);
}

input[type="number"] {
  width: 100%;
  padding: 0.625rem;
  border: 0.0625rem solid var(--color-border-light);
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.3s;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--color-primary);
}

.process-btn {
  width: 100%;
  background: var(--color-success);
  color: var(--color-bg-white);
  border: none;
  padding: 0.9375rem;
  border-radius: 0.375rem;
  font-size: 1.125rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.process-btn:hover:not(:disabled) {
  background: var(--color-success-hover);
}

.process-btn:disabled {
  background: var(--color-bg-disabled);
  cursor: not-allowed;
}

.status {
  padding: 0.9375rem;
  border-radius: 0.375rem;
  text-align: center;
}

.status.loading {
  background: var(--color-warning-bg);
  border: 0.0625rem solid var(--color-warning-border);
  color: var(--color-warning);
}

.status.error {
  background: var(--color-error-bg);
  border: 0.0625rem solid var(--color-error-border);
  color: var(--color-error);
}

.status.success {
  background: var(--color-success-bg);
  border: 0.0625rem solid var(--color-success-border);
  color: var(--color-success-text);
}

.file-info {
  background: var(--color-bg-secondary);
  padding: 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text-light);
}

#downloadBtn {
  background: var(--color-text-muted);
}

.learn-more-details {
  margin-bottom: 1.5rem;
}

.learn-more-details div {
  margin-top: 1rem;
}

.learn-more-summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-primary);
}

.hidden {
  display: none;
}

.download-btn {
  display: none;
  background: #6c757d;
  margin-top: 15px;
}
