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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  min-height: 100vh;
}

#app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  margin-bottom: 30px;
  border-bottom: 1px solid #2a2a2a;
  padding-bottom: 20px;
}

h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tabs {
  display: flex;
  gap: 10px;
}

.tab {
  padding: 10px 20px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #888;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 14px;
}

.tab:hover {
  background: #222;
  color: #aaa;
}

.tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.controls {
  background: #1a1a1a;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #2a2a2a;
}

.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  font-weight: 500;
}

select, input[type="text"], input[type="url"], input[type="number"] {
  width: 100%;
  padding: 10px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 14px;
  transition: border-color 0.3s;
}

select:focus, input:focus {
  outline: none;
  border-color: #667eea;
}

.file-input {
  position: relative;
  display: inline-block;
  width: 100%;
  margin-bottom: 10px;
}

.file-input input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input span {
  display: block;
  padding: 10px;
  background: #0a0a0a;
  border: 2px dashed #333;
  border-radius: 6px;
  text-align: center;
  color: #888;
  cursor: pointer;
  transition: all 0.3s;
}

.file-input:hover span {
  border-color: #667eea;
  color: #667eea;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

.checkbox input {
  margin-right: 8px;
  width: auto;
}

.checkbox span {
  color: #aaa;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-size: 12px;
  margin: 0;
}

.input-group input {
  width: 100%;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

button {
  padding: 12px 24px;
  background: #2a2a2a;
  border: none;
  border-radius: 6px;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
}

button:hover:not(:disabled) {
  background: #333;
}

button.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

button.primary:hover {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  padding: 15px;
  background: #1a1a1a;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 3px solid #667eea;
  display: none;
}

.status.show {
  display: block;
}

.preview {
  background: #1a1a1a;
  padding: 20px;
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.preview.show {
  display: block;
}

.preview pre {
  background: #0a0a0a;
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #aaa;
}

.info {
  background: #1a1a1a;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.info-item {
  text-align: center;
}

.info-item .value {
  font-size: 24px;
  font-weight: bold;
  color: #667eea;
}

.info-item .label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  margin-top: 5px;
}

.trace-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.trace-item {
  background: #1a1a1a;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid #2a2a2a;
}

.trace-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
}

.trace-item.selected {
  border-color: #667eea;
  background: #222;
}

.trace-item .word {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
}

.trace-item .meta {
  font-size: 12px;
  color: #888;
}

#trace-canvas {
  width: 100%;
  max-width: 700px;
  height: auto;
  aspect-ratio: 1.4;
  background: #0a0a0a;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  margin: 20px auto;
  display: block;
}

.details {
  background: #1a1a1a;
  padding: 20px;
  border-radius: 8px;
  display: none;
}

.details.show {
  display: block;
}

.details h3 {
  margin-bottom: 15px;
  color: #667eea;
}

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

.details td {
  padding: 8px;
  border-bottom: 1px solid #2a2a2a;
}

.details td:first-child {
  color: #888;
  width: 150px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444;
}