body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 30px;
}

.duet-info {
  background-color: #e8f4fd;
  border: 1px solid #bee5eb;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

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

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #2c3e50;
}

textarea {
  width: 100%;
  height: 300px;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  font-family: monospace;
  font-size: 14px;
}

.settings-panel {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.settings-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: #2c3e50;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.setting {
  margin-right: 30px;
  margin-bottom: 10px;
}

.setting input[type="number"] {
  width: 120px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.setting input[type="checkbox"] {
  margin-right: 5px;
}

.btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 10px 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #2980b9;
}

.btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #95a5a6;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-download {
  background-color: #27ae60;
}

.btn-download:hover {
  background-color: #219653;
}

.btn-toggle {
  background-color: #ecf0f1;
  color: #2c3e50;
  border: 1px solid #bdc3c7;
}

.btn-toggle.active {
  background-color: #34495e;
  color: #fff;
}

.action-buttons {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
}

.stats-panel {
  background-color: #edf7ff;
  padding: 15px;
  border-radius: 4px;
  margin-top: 20px;
  display: none;
}

.stats-title {
  font-weight: bold;
  margin-bottom: 10px;
  color: #2c3e50;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.stat {
  margin-right: 30px;
  margin-bottom: 5px;
}

.stat-label {
  font-weight: bold;
  margin-right: 5px;
}

.footer {
  text-align: center;
  margin-top: 30px;
  color: #7f8c8d;
  font-size: 0.9em;
}

.help-text {
  font-size: 0.9em;
  color: #7f8c8d;
  margin-top: 5px;
}

.gcode-columns {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.gcode-columns .gcode-column {
  flex: 1 1 320px;
  min-width: 280px;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .settings-row {
    flex-direction: column;
  }
  .setting {
    margin-right: 0;
  }
  .stat {
    margin-right: 0;
    margin-bottom: 10px;
  }
  .gcode-columns {
    flex-direction: column;
  }
}

/* --- Zakładki --- */

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: bold;
  color: #7f8c8d;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: color 0.2s, background-color 0.2s;
}

.tab-btn:hover {
  color: #2c3e50;
  background-color: #f8f9fa;
}

.tab-btn.active {
  color: #2980b9;
  border-bottom-color: #2980b9;
}

.tab-btn .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.75em;
  background-color: #95a5a6;
  color: #fff;
}

.tab-btn .badge.badge-error {
  background-color: #e74c3c;
}

.tab-btn .badge.badge-warning {
  background-color: #e67e22;
}

.tab-panel[hidden] {
  display: none;
}

/* --- Wczytywanie plików --- */

.drop-zone {
  border: 2px dashed #bdc3c7;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 12px;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone.dragover {
  border-color: #3498db;
  background-color: #eaf5fd;
  color: #2980b9;
}

.drop-zone .btn {
  margin-top: 8px;
}

.file-status {
  font-size: 0.9em;
  color: #2980b9;
  min-height: 1.2em;
  margin-bottom: 8px;
}

/* --- Walidacja --- */

.validation-panel {
  border-radius: 4px;
  margin-top: 20px;
  display: none;
}

.validation-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.validation-list li {
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 0.9em;
}

.validation-list li.error {
  background-color: #fdecea;
  border: 1px solid #f5c6cb;
  color: #a12622;
}

.validation-list li.warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #7a5a00;
}

.validation-list li.info {
  background-color: #eaf5fd;
  border: 1px solid #bee5eb;
  color: #2980b9;
}

.validation-list .line-tag {
  font-weight: bold;
  margin-right: 6px;
}

.validation-empty {
  color: #27ae60;
  font-weight: bold;
}

/* --- Podgląd ścieżki narzędzia --- */

.viewer-panel {
  margin-top: 20px;
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.viewer-toolbar .btn {
  margin: 0;
  padding: 8px 14px;
  font-size: 14px;
}

.viewer-legend {
  display: flex;
  gap: 16px;
  font-size: 0.85em;
  color: #555;
  margin-left: auto;
  flex-wrap: wrap;
}

.viewer-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-swatch {
  width: 14px;
  height: 3px;
  display: inline-block;
  border-radius: 2px;
}

#viewer3d {
  width: 100%;
  height: 480px;
  background: #fafbfc;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}
